Project urls.py file
"""
URL configuration for projet_tout_talent project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('tout_talent.urls')),
path('tinymce/', include('tinymce.urls')),
path('ckeditor/', include('ckeditor_uploader.urls')),
]
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += staticfiles_urlpatterns()
and my app urls.py file :
`from django.contrib import admin
from django.urls import path
from . import views
from django.contrib.auth import views as auth_views
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.staticfiles.storage import staticfiles_storage
from ckeditor_uploader import views as ckeditor_views
from django.conf.urls import handler400, handler403, handler404, handler500
from django.contrib import sitemaps
from django.contrib.sitemaps.views import sitemap
from .sitemaps import JobSitemap, ArticleSitemap
sitemaps = {
‘jobs’: JobSitemap,
‘articles’: ArticleSitemap,
}
handler400 = ‘tout_talent.views.error_400’
handler403 = ‘tout_talent.views.error_403’
handler404 = ‘tout_talent.views.error_404’
handler500 = ‘tout_talent.views.error_500’
urlpatterns = [
path(‘’, views.home, name=‘home’),
path('register/', views.register, name='register'),
path('profile/', views.profile, name='profile'),
path('profile/update/', views.update_profile, name='update_profile'),
path('login/', views.user_login, name='login'),
path('logout/', views.user_logout, name='user_logout'),
path('recherche/', views.recherche, name='recherche'),
path('forfait/', views.subscribe, name='subscribe'),
path('mon/forfait/', views.mon_forfait, name='mon_forfait'),
path('upgrade_subscription/', views.upgrade_subscription, name='upgrade_subscription'),
#path('payment/<int:ref>/<int:days>/<amount>/', views.payment, name='payment'),
path('payment/<int:company_ref>/<int:plan_ref>/<int:days>/<amount>/', views.payment, name='payment'),
path('payment_callback/', views.payment_callback, name='payment_callback'),
path('calculate_amount/', views.calculate_amount, name='calculate_amount'),
path('payment-success/<int:company_ref>/<int:plan_ref>/', views.payment_success, name='payment_success'),
path('subscription-detail/', views.subscription_detail, name='subscription_detail'),
path('days-duration-for-lite-plan/<str:plan_ref>/', views.days_duration_for_lite_plan, name='days_duration_for_lite_plan'),
path('ajouter/formation/', views.formation, name='formation'),
path('ajouter/experience/', views.experience, name='experience'),
path('ajouter/certificat/', views.certificat, name='certificat'),
path('ajouter/portfolio/', views.portfolio, name='portfolio'),
path('update/portfolio/<int:pk>/', views.update_portfolio, name='update_portfolio'),
path('update/certificat/<int:pk>/', views.update_certificat, name='update_certificat'),
path('update/experience/<int:pk>/', views.update_experience, name='update_experience'),
path('update/formation/<int:pk>/', views.update_formation, name='update_formation'),
path('formation/delete/<int:pk>/', views.delete_formation, name='delete_formation'),
path('experience/delete/<int:pk>/', views.delete_experience, name='delete_experience'),
path('certificat/delete/<int:pk>/', views.delete_certificat, name='delete_certificat'),
path('portfolio/delete/<int:pk>/', views.delete_portfolio, name='delete_portfolio'),
path('job/create/', views.create_job, name='create_job'),
path('my_jobs/', views.job_list, name='job_list'),
path('gerer/candidatures/', views.manage_job_application, name='manage_job_application'),
path('job/update/<slug:slug>/<int:ref>/', views.update_job, name='update_job'),
path('job/delete/<slug:slug>/<int:ref>/', views.delete_job, name='delete_job'),
path('job/<slug:slug>/<int:ref>/', views.job_detail, name='job_detail'),
path('company_details/<slug:slug>/<int:ref>/', views.company_details, name='company_details'),
path('offres/', views.jobs, name='jobs'),
path('jobs/<str:country_name>/', views.jobs_by_country, name='jobs_by_country'),
path('emploi/<slug:slug>/<int:ref>/postuler/', views.postuler, name='postuler'),
path('candidate/<int:ref>/', views.voir_profile, name='voir_profile'),
path('job/<int:job_ref>/applications/', views.detail_job_application, name='detail_job_application'),
path('update-status/<int:ref>/<int:job_ref>/', views.update_application_status, name='update_application_status'),
path('mes-candidatures/', views.candidate_applications, name='candidate_applications'),
path('password_reset/', views.CustomPasswordResetView.as_view(), name='password_reset'),
#path('password_reset/', auth_views.PasswordResetView.as_view(template_name='registration/password_reset_form.html',email_template_name='registration/password_reset_email.html',
# subject_template_name='registration/password_reset_subject.txt',
# success_url='/password_reset/done/'
# ), name='password_reset'),
path('password_reset/done/', auth_views.PasswordResetDoneView.as_view(template_name='password_reset_done.html'), name='password_reset_done'),
path('reset/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(template_name='password_reset_confirm.html'), name='password_reset_confirm'),
path('reset/done/', auth_views.PasswordResetCompleteView.as_view(template_name='password_reset_complete.html'), name='password_reset_complete'),
path('quizz_list/', views.quiz_list, name='quiz_list'),
path('quiz/<int:ref>/', views.quiz_detail, name='quiz_detail'),
path('quiz/create/', views.quiz_create, name='quiz_create'),
path('quiz/update/<int:ref>/', views.quiz_update, name='quiz_update'),
path('quiz/delete/<int:ref>/', views.quiz_delete, name='quiz_delete'),
path('quiz/<int:ref>/question/create/', views.question_create, name='question_create'),
path('question/update/<int:ref>/', views.question_update, name='question_update'),
path('question/delete/<int:ref>/', views.question_delete, name='question_delete'),
path('question/<int:ref>/option/create/', views.option_create, name='option_create'),
path('option/update/<int:ref>/', views.option_update, name='option_update'),
path('option/delete/<int:ref>/', views.option_delete, name='option_delete'),
path('tech_skill/<int:tech_skill_id>/quizzes/', views.quizzes_by_tech_skill, name='quizzes_by_tech_skill'),
path('candidate/profile/', views.candidate_profile, name='candidate_profile'),
path('candidate/tech_skill/<int:tech_skill_id>/quiz/', views.candidate_quiz, name='candidate_quiz'),
path('quiz/start/<int:ref>/', views.quiz_start, name='quiz_start'),
path('quiz-question/<int:ref>/<int:question_ref>/', views.quiz_question, name='quiz_question'),
path('quiz-submit/<int:ref>/<int:question_ref>/', views.quiz_submit_question, name='quiz_submit_question'),
path('quiz-results/<int:ref>/', views.quiz_results, name='quiz_results'),
#path('quiz/submit/<int:ref>/', views.quiz_submit, name='quiz_submit'),
path('mes/quiz/', views.mes_quiz, name='mes_quiz'),
path('passer-quizz/', views.passer_quizz, name='passer_quizz'),
path('ckeditor/upload/', ckeditor_views.upload, name='ckeditor_upload'),
path('ckeditor/browse/', ckeditor_views.browse, name='ckeditor_browse'),
path('articles/', views.articles, name='articles'),
path('lire_article/<str:slug>/<int:ref>/', views.lire_article, name='lire_article'),
path('tech-skills-autocomplete/', views.tech_skills_autocomplete, name='tech_skills_autocomplete'),
path('soft-skills-autocomplete/', views.soft_skills_autocomplete, name='soft_skills_autocomplete'),
path('secteurs-autocomplete/', views.secteurs_autocomplete, name='secteurs_autocomplete'),
path('job_tags-autocomplete/', views.job_tags_autocomplete, name='job_tags_autocomplete'),
path('category-autocomplete/', views.category_autocomplete, name='category_autocomplete'),
path('chat/<int:conversation_ref>/', views.chat_view, name='chat_view'),
path('start_conversation/<int:candidate_ref>/<int:job_ref>/', views.start_conversation, name='start_conversation'),
path('candidates/<int:candidate_ref>/conversations/', views.candidate_conversations, name='candidate_conversations'),
path('companies/<int:company_ref>/conversations/', views.company_conversations, name='company_conversations'),
path('send-test-email/', views.send_test_email, name='send_test_email'),
path('sitemap.xml', sitemap, {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap'),
path('exporter/emails/', views.download, name='download'),
path('download-mail/<int:job_ref>/', views.download_mail, name='download_mail'),
path('export-excel/<int:job_ref>/', views.export_excel, name='export_excel'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)`