Beispiel #1
0
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'),
]
if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)

LOGIN_REDIRECT_URL = '/'
Beispiel #2
0
    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"),
]