from django.urls import path #from api.views import company_list, company_detail, com_vacancies, vacancy_list, vacancy_detail, top_ten from api.views.views import com_vacancies from api.views.views_generic import CompanyListAPIView, CompanyDetailAPIView, \ VacancyListAPIView, VacancyDetailAPIView from rest_framework_jwt.views import obtain_jwt_token urlpatterns = [ # path('companies/', company_list), # path('companies/<int:company_id>', company_detail), # path('companies/<int:company_id>/vacancies', com_vacancies), # path('vacancies/', vacancy_list), # path('vacancies/<int:vacancy_id>', vacancy_detail), # path('vacancies/top_ten', top_ten), path('login/', obtain_jwt_token), path('companies/', CompanyListAPIView.as_view()), path('companies/<int:pk>/', CompanyDetailAPIView.as_view()), path('companies/<int:company_id>/vacancies/', com_vacancies), path('vacancies/', VacancyListAPIView.as_view()), path('vacancies/<int:pk>/', VacancyDetailAPIView.as_view()), ]
from django.urls import path # from api.views import company_list, company_detail, company_detail, vacancy_list, vacancy_detail, company_vacancies # from api.views.views_cbv import CompanyListAPIView, CompanyDetailAPIView, CompanyWithVacancyListAPIView, VacancyListAPIView, VacancyDetailAPIView from api.views.views_cbv import CompanyWithVacancyListAPIView from api.views.views_generic import CompanyListAPIView, CompanyDetailAPIView, \ VacancyListAPIView, VacancyDetailAPIView from rest_framework_jwt.views import obtain_jwt_token urlpatterns = [ path('companies/', CompanyListAPIView.as_view()), path('companies/<int:company_id>', CompanyDetailAPIView.as_view()), path('companies/<int:company_id>/vacancies/', CompanyWithVacancyListAPIView.as_view()), path('vacancies/', VacancyListAPIView.as_view()), path('vacancies/<int:vacancy_id>', VacancyDetailAPIView.as_view()), path('login/', obtain_jwt_token), # path('companies/', company_list), # path('companies/<int:company_id>', company_detail), # path('companies/<int:company_id>/vacancies/', company_vacancies), # path('vacancies/', vacancy_list), # path('vacancies/<int:vacancy_id>', vacancy_detail), ]
from django.urls import path from django.views.generic import RedirectView from api.views import companies, company_detail, vacancies, vacancy_detail, all_vacancies_top10, company_vacancies_top10 from api.views.views_cbv import CompaniesAPIView, CompanyDetailView, VacanciesAPIView from api.views.views_generic import CompanyListAPIView, CompanyDetailAPIView, VacancyListAPIView, VacancyDetailAPIView from rest_framework_jwt.views import obtain_jwt_token urlpatterns = [ path('api/login/', obtain_jwt_token), path('api/companies/', CompanyListAPIView.as_view(), name="companies"), path('api/companies/<int:company_id>/', CompanyDetailAPIView.as_view(), name="company_detail"), path('api/companies/<int:company_id>/vacancies/', VacancyListAPIView.as_view(), name="vacancies"), path('api/vacancies/<int:vacancy_id>/', VacancyDetailAPIView.as_view(), name="vacancy_detail"), path('api/vacancies/top_ten', all_vacancies_top10, name="vacancies_top10"), path('api/<int:company_id>/vacancies/top_ten', company_vacancies_top10, name="comp_vacancies_top10") ]
from django.urls import path from django.views.generic import RedirectView from api.views import companies, company_detail, vacancies, vacancy_detail, all_vacancies_top10, company_vacancies_top10 from api.views.views_cbv import CompaniesAPIView, CompanyDetailView, VacanciesAPIView from api.views.views_generic import CompanyListAPIView, CompanyDetailAPIView, VacancyListAPIView, VacancyDetailAPIView from rest_framework_jwt.views import obtain_jwt_token urlpatterns = [ path('api/login/',obtain_jwt_token), path('api/companies/', CompanyListAPIView.as_view(), name="companies"), path('api/companies/<int:company_id>/', CompanyDetailAPIView.as_view(), name="company_detail"), path('api/companies/<int:company_id>/vacancies/', VacancyListAPIView.as_view(), name="vacancies"), path('api/vacancies/<int:vacancy_id>/', VacancyDetailAPIView.as_view(), name="vacancy_detail"), path('api/vacancies/top_ten', all_vacancies_top10, name="vacancies_top10"), path('api/<int:company_id>/vacancies/top_ten', company_vacancies_top10, name="comp_vacancies_top10") ]