from django.urls import path from vacancies.views import MainView, VacanciesAllView, VacancyView, \ CompanyView, SpecialitiesView, CompaniesAllView, \ MyCompanylVacancyListView, MyCompanyVacancyEditView, MyCompanyView, VacancySendApplicationView, \ about_view, CustomLoginView, RegisterView urlpatterns = [ path('', MainView.as_view(), name='main'), path('vacancies/', VacanciesAllView.as_view(), name='all_vacancies'), path('vacancies/cat/<str:spec_code>/', SpecialitiesView.as_view(), name='specialty'), path('companies/<int:company_id>/', CompanyView.as_view(), name='company_card'), path('vacancies/<int:vacancy_id>/', VacancyView.as_view(), name='vacancy'), path('companies/', CompaniesAllView.as_view(), name='all_companies'), path('about/', about_view, name='about'), path('vacancies/<int:vacancy_id>/send/', VacancySendApplicationView.as_view(), name='vacancy_send'), path('mycompany/', MyCompanyView.as_view(), name='mycompany'), path('mycompany/vacancies/', MyCompanylVacancyListView.as_view(), name='mycompany_vacancy_list'), path('mycompany/vacancies/<int:vacancy_id>/', MyCompanyVacancyEditView.as_view(), name='mycompany_vacancy'), path('login/', CustomLoginView.as_view(), name='login'), path('logout/', LogoutView.as_view(), name='logout'), path('register/', RegisterView.as_view(), name='register'),
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/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.urls import path from vacancies.views import CompanyView, MainView, VacancyView # regex path for combining vacancies/cat/code and vacancies/id # re_path(r'^vacancies/(?P<id>\d+)?/?(cat/(?P<code>\w+))?/$', VacancyView.as_view(), name='vacancies') urlpatterns = [ path('', MainView.as_view()), path('companies/<int:id>/', CompanyView.as_view(), name='companies'), path('vacancies/cat/<str:code>/', VacancyView.as_view(), name='vacancies/cat'), path('vacancies/<int:id>/', VacancyView.as_view(), name='vacancies/id'), path('vacancies/', VacancyView.as_view()), ]
from vacancies.views import MainView, VacanciesView,\ SpecializationView, CompanyView, VacancyView,\ MySignupView, VacanciesSendView, MyCompanyEditView,\ MyVacanciesView, MyVacancyEditView, MyLoginView,\ MyCompanyCreateView, MyVacanciesСreateView handler404 = custom_handler404 urlpatterns = [ path('admin/', admin.site.urls), path('', MainView.as_view()), path('vacancies/', VacanciesView.as_view()), path('vacancies/cat/<str:specialty>', SpecializationView.as_view()), path('companies/<int:id>', CompanyView.as_view()), path('vacancies/<int:id>', VacancyView.as_view()), path('vacancies/<vacancy_id>/send', VacanciesSendView.as_view()), path('mycompany/edit', MyCompanyEditView.as_view(), name='my_company'), path('mycompany/create', MyCompanyCreateView.as_view(), name='my_company_cr'), path('mycompany/vacancies', MyVacanciesView.as_view(), name='mycompany_vac'), path('mycompany/vacancies/create', MyVacanciesСreateView.as_view(), name='my_vacancy_cr'), path('mycompany/vacancies/<int:id>', MyVacancyEditView.as_view()), path('login', MyLoginView.as_view(), name='login'), path('logout', LogoutView.as_view(), name='logout'), path('register', MySignupView.as_view(), name='register'),
from django.conf import settings from django.urls import include, path, re_path from vacancies.views import CompanyView, MainView, VacanciesView, VacancyView, custom_500 handler500 = custom_500 urlpatterns = [ path("", MainView.as_view(), name="main"), re_path(r"^vacancies/(?:cat/(?P<slug>\w+))?$", VacanciesView.as_view(), name="vacancies"), path("vacancies/<int:pk>", VacancyView.as_view(), name="vacancy"), path("companies/<int:pk>", CompanyView.as_view(), name="company"), ] if settings.DEBUG: import debug_toolbar urlpatterns += [path("__debug__/", include(debug_toolbar.urls))]
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.contrib.auth.views import LogoutView from django.urls import path from vacancies.views import MainView, VacanciesView, VacanciesByCategoryView, VacancyView, ApplicationSendView, \ CompanyView, MyCompanyView, MyCompanyEditView, MyCompanyVacanciesView, MyCompanyVacancyCreateView, \ MyCompanyVacancyEditView, RegisterView, MyLoginView urlpatterns = [ path('', MainView.as_view()), path('vacancies/', VacanciesView.as_view()), path('vacancies/cat/<str:category>/', VacanciesByCategoryView.as_view()), path('vacancies/<int:vacancy_id>/', VacancyView.as_view()), path('vacancies/<int:vacancy_id>/sent/', ApplicationSendView.as_view(), name='application_send'), path('companies/<int:company_id>/', CompanyView.as_view()), path('mycompany/', MyCompanyView.as_view()), path('mycompany/edit/', MyCompanyEditView.as_view()), path('mycompany/vacancies/', MyCompanyVacanciesView.as_view()), path('mycompany/vacancies/new/', MyCompanyVacancyCreateView.as_view()), path('mycompany/vacancies/<int:vacancy_id>/', MyCompanyVacancyEditView.as_view()), path('admin/', admin.site.urls), path('register/', RegisterView.as_view()), path('login/', MyLoginView.as_view(), name="login"), path('logout/', LogoutView.as_view(), name="logout"), ]
from vacancies.views import Login, Registration from vacancies.views import MyCompanyCreateView, MyCompanyDeleteView, MyCompanyLetsstarView, MyCompanyView from vacancies.views import MyResumeCreateView, MyResumeDeleteView, MyResumeLetsstartView, MyResumeView from vacancies.views import MyVacanciesView, MyVacancyCreateView, MyVacancyDeleteView, MyVacancyView from vacancies.views import ResumesAccessView, ResumeSendingView, ResumesView, SearchView, VacanciesSpecialtyView handler404 = custom_handler404 handler500 = custom_handler500 urlpatterns = [ # основные path('', MainView.as_view(), name='main'), path('vacancies', VacanciesView.as_view(), name='vacancies'), # все вакансии path('resumes', ResumesView.as_view(), name='resumes'), # все резюме path('resumes_access', ResumesAccessView.as_view(), name='resumes_access'), # все резюме path('vacancies/<int:vacancy_id>', VacancyView.as_view(), name='vacancy'), # одна вакансия path('vacancies/cat/<str:specialty>', VacanciesSpecialtyView.as_view(), name='vacancies_specialty'), path('vacancies/<int:vacancy_id>/send/', ResumeSendingView.as_view(), name='resume_send'), # отправка заявки path('companies/<int:company_id>', CompanyCardView.as_view(), name='company'), # компания path('search', SearchView.as_view(), name='search'), path('profile/<int:pk>', UserProfile.as_view(), name='user_profile'), # компания path('mycompany/letsstart/', MyCompanyLetsstarView.as_view(), name='my_company_letsstart'), # создать компанию path('mycompany/create/', MyCompanyCreateView.as_view(), name='my_company_empty_form'), # пустая форма path('mycompany/', MyCompanyView.as_view(), name='my_company_form'), # заполненная форма path('mycompany/delete/', MyCompanyDeleteView.as_view(), name='my_company_delete'), # удаление компании # компания -> вакансии path('mycompany/vacancies/', MyVacanciesView.as_view(), name='my_vacancies'), # мои вакансии - список path('mycompany/vacancies/create/', MyVacancyCreateView.as_view(), name='my_vacancy_empty_form'), # пустая форма path('mycompany/vacancies/<int:vacancy_id>', MyVacancyView.as_view(), name='my_vacancy_form'), # заполненная форма
MySignupView, MyLoginView handler404 = custom_handler404 handler500 = custom_handler500 urlpatterns = [ path('admin/', admin.site.urls), path('', MainView.as_view(), name="main"), path('vacancies/', VacanciesView.as_view(), name="vacancies"), path('vacancies/cat/<str:specialization>/', SpecializationByVacanciesView.as_view(), name="vacancies_by_spec"), path('companies/<int:company_id>', CompanyCardView.as_view(), name="company"), path('vacancies/<int:vacancy_id>', VacancyView.as_view(), name="vacancy"), path('login/', MyLoginView.as_view(), name="login"), path('logout/', MyLogoutView.as_view(), name="logout"), path('register/', MySignupView.as_view(), name="register"), path('vacancies/<int:vacancy_id>/send', SendVacancyView.as_view(), name="send"), path('mycompany/letsstart', MyCompanyCreateOfferView.as_view(), name="company_create_offer"), path('mycompany/create', MyCompanyCreateView.as_view(), name="company_create"), path('mycompany/', MyCompanyEditView.as_view(), name="company_edit"), path('mycompany/vacancies', MyVacanciesList.as_view(),
from vacancies.views import VacanciesBySpecialtyView from vacancies.views import MainView from vacancies.views import VacanciesView from vacancies.views import VacancyView urlpatterns = [ path( '', MainView.as_view(), name='main'), path( 'vacancies/', VacanciesView.as_view(), name='vacancies'), path( 'jobs/cat/<str:cat_id>/', VacanciesBySpecialtyView.as_view(), name='vacancies_by_specialty'), path( 'companies/<int:company_id>/', CompanyView.as_view(), name='company'), path( 'jobs/<int:job_id>/', VacancyView.as_view(), name='job'), path( 'admin/', admin.site.urls), ]