Exemplo n.º 1
0
    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 vacancy.views import IndexView, VacanciesView, MySignupView, MyLoginView, HomeView, NewVacancyView
from resume.views import ResumesView, NewResumeView
from django.views.generic import RedirectView

urlpatterns = [
    path('admin/', admin.site.urls),
    path("", IndexView.as_view()),
    path("vacancies", VacanciesView.as_view()),
    path("resumes", ResumesView.as_view()),
    path("signup", MySignupView.as_view()),
    path("login", MyLoginView.as_view()),
    path('login/', RedirectView.as_view(url='/login')),
    path('signup/', RedirectView.as_view(url='/signup')),
    path('resumes/', RedirectView.as_view(url='/resumes')),
    path('vacancies/', RedirectView.as_view(url='/vacancies')),
    path("home", HomeView.as_view()),
    path('home/', RedirectView.as_view(url='/home')),
    path("vacancy/new", NewVacancyView.as_view()),
    path('vacancy/new/', RedirectView.as_view(url='/vacancy/new')),
    path("resume/new", NewResumeView.as_view()),
    path('resume/new/', RedirectView.as_view(url='/resume/new')),
]
Exemplo n.º 2
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.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, re_path
from resume.views import MainMenuView, ResumeListView, SignupView, MyLoginView, NewResumeView, HomeView
from vacancy.views import VacancyListView, NewVacancyView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', MainMenuView.as_view()),
    re_path('vacancies/?', VacancyListView.as_view()),
    re_path('resumes/?', ResumeListView.as_view()),
    re_path('login/?', MyLoginView.as_view()),
    re_path('signup/?', SignupView.as_view()),
    re_path('vacancy/new/?', NewVacancyView.as_view()),
    re_path('resume/new/?', NewResumeView.as_view()),
    re_path('home/?', HomeView.as_view()),
]
Exemplo n.º 3
0
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 django.views.generic import RedirectView
from vacancy.views import MenuView, VacanciesView, MySignUpView, MyLoginView, NewVacancyView, HomeView
from resume.views import ResumesView, NewResumeView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', MenuView.as_view()),
    path('vacancies/', VacanciesView.as_view()),
    path('resumes/', ResumesView.as_view()),
    path('login', MyLoginView.as_view()),
    path('signup', MySignUpView.as_view()),
    path('login/', RedirectView.as_view(url='/login')),
    path('signup/', RedirectView.as_view(url='/signup')),
    path('home/', HomeView.as_view()),  # display forms
    path('vacancy/new', NewVacancyView.as_view()),  # send form data to
    path('resume/new', NewResumeView.as_view()),  # send form data to
]
Exemplo n.º 4
0
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 .views import *
from django.contrib.auth.views import LogoutView
from vacancy.views import VacancyListView, NewVacancyView
from resume.views import ResumeListView, NewResumeView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', MenuView.as_view()),
    path('vacancies', VacancyListView.as_view()),
    path('resumes', ResumeListView.as_view()),
    path('signup', SignupView.as_view()),
    path('login', MyLoginView.as_view()),
    path('logout', LogoutView.as_view()),
    path('home', HomeView.as_view()),
    path('resume/new', NewResumeView.as_view()),
    path('vacancy/new', NewVacancyView.as_view())
]
Exemplo n.º 5
0
    path('vacancies/', VacanciesView.as_view()),  # все вакансии
    path('vacancies/cat/<str:specialization>/',
         SpecializationView.as_view()),  # вакансии по специализации
    path('companies/<int:id>/', CompanyView.as_view()),  # вакансии компании
    path('vacancies/<int:id>/', VacancyView.as_view(),
         name='vacancy'),  # вакансия
    path('mycompany/',
         MyCompanyView.as_view()),  # страница с кнопкой создания компании
    path('mycompany/edit/', CompanyEdit.as_view(),
         name='company_edit'),  # страница редактирования компании
    path('mycompany/vacancies/', MyVacanciesView.as_view()
         ),  # список вакансий в личном кабинете компании
    path('mycompany/vacancies/create/', MyVacanciesCreateView.as_view()
         ),  # страница с кнопкой создания вакансии
    path('mycompany/vacancies/create/new',
         NewVacancyView.as_view()),  # страница создания новой вакансии
    path('mycompany/vacancies/<int:id>',
         MyVacancy.as_view(),
         name='my_vacancy_edit'),  # редактирование вакансии компании
    path('myresume/', MyResumeView.as_view()),  # страница резюме пользователя
    path('myresume/create/', MyResumeCreate.as_view(),
         name='my_resume_create'),  # страница создания/редактирования резюме
    path('signup/', MySignupView.as_view(), name='signup'),  # регистрация
    path('login/', login, name='login'),
    path('logout/', logout, name='logout')
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)