The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/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 from vacancies.views import MainView, AllPositionsView, \ CompanyView, SpecialtyPositionsView, \ PositionView urlpatterns = [ path('admin/', admin.site.urls), path("", MainView.as_view()), path("company/<str:company>/", CompanyView.as_view()), path("vacancies/", AllPositionsView.as_view()), path("vacancy/<int:pk>/", PositionView.as_view()), path("vacancy/cat/<str:specialty>", SpecialtyPositionsView.as_view()), ]
from django.contrib.auth.views import LogoutView 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'),
from django.urls import path from vacancies.views import MainView, VacancyCatView, VacancyListView, CompanyView, VacancyInfoView urlpatterns = [ path('', MainView.as_view(), name='main_page'), path('vacancies/', VacancyListView.as_view(), name='vacancies_page'), path('vacancies/cat/<str:category_name>', VacancyCatView.as_view(), name='category_page'), path('companies/<int:id>', CompanyView.as_view(), name='company_page'), path('vacancies/<int:id>', VacancyInfoView.as_view(), name='vacancy_info'), ]
from django.contrib.auth.views import LogoutView 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'),
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 django.urls import path from django.contrib.auth.decorators import login_required from vacancies.views import MainView, CompanyView, CompaniesView, \ VacancyView, VacanciesView, VacancyBySpecialisationView, \ MyLoginView, MyLogoutView, SignupView, \ MyCompanyUpdateView, MyCompanyCreateView, MyCompanyPlugView, \ MyVacancyUpdateView, MyVacanciesView, MyVacancyCreateView, MyVacancyApplicatiosView,\ MyResumeUpdateView, MyResumeCreateView, MyResumePlugView, SearchView urlpatterns = [ path('', MainView.as_view(), name='index'), path('vacancies/', VacanciesView.as_view(), name='vacancies'), path('vacancies/<int:pk>/', VacancyView.as_view(), name='vacancy'), path('companies/<int:pk>/', CompanyView.as_view(), name='company'), path('companies/', CompaniesView.as_view()), path('vacancies/cat/<str:specialisation>/', VacancyBySpecialisationView.as_view(), name='vacancy_specialisation'), path('login/', MyLoginView.as_view(), name='login'), path('logout/', MyLogoutView.as_view(), name='logout'), path('signup/', SignupView.as_view(), name='signup'), path('mycompany/', login_required(MyCompanyUpdateView.as_view()), name='mycompany'), path('mycompany/plug/', login_required(MyCompanyPlugView.as_view()), name='mycompany_plug'), path('mycompany/create/', login_required(MyCompanyCreateView.as_view()), name='mycompany_create'), path('myresume/', login_required(MyResumeUpdateView.as_view()), name='myresume'), path('myresume/plug/', login_required(MyResumePlugView.as_view()), name='myresume_plug'), path('myresume/create/', login_required(MyResumeCreateView.as_view()), name='myresume_create'), path('myvacancy/<int:pk>', login_required(MyVacancyUpdateView.as_view()), name='myvacancy_update'), path('myvacancy/create/', login_required(MyVacancyCreateView.as_view()), name='myvacancy_create'), path('myvacancies/', login_required(MyVacanciesView.as_view()), name='myvacancies'), path('myvacancy/<int:pk>/applications/',
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))]
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"), ]
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) ''' from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.urls import path from vacancies.views import MainView, CompanyView, SpecialtyView, VacanciesView, VacancyView from vacancies.views import custom_handler404, custom_handler500 urlpatterns = [ path('admin/', admin.site.urls), path('', MainView.as_view(), name='home'), path('companies/<int:company_id>', CompanyView.as_view(), name='company'), path('vacancies/cat/<str:specialty>', SpecialtyView.as_view(), name='specialty'), path('vacancies/', VacanciesView.as_view(), name='vacancies'), path('vacancies/<int:vacancy_id>', VacancyView.as_view(), name='vacancy'), ] handler404 = custom_handler404 handler500 = custom_handler500 if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += staticfiles_urlpatterns()