from django.conf.urls import url from company.views import CompanyView urlpatterns = [ url(r'^companies$', CompanyView.as_view()), url(r'^companies/(?P<company_id>\w+)/park1s$', CompanyView.as_view()) ]
from django.conf.urls import url from company.views import CompanyView, CompaniesView urlpatterns = [ url(r'^company$', CompanyView.as_view()), url(r'^companies/(?P<company_name>\w+)$', CompanyView.as_view()), url(r'^companies/(?P<company_id>\w+)$', CompaniesView.as_view()) # ]
from django.conf.urls import url from company.views import CompaniesView, CompanyView, CompanyParkingsView urlpatterns = [ url(r'^companies$', CompaniesView.as_view()), url(r'^companies/(?P<company_id>.*)/parkings$', CompanyParkingsView.as_view()), url(r'^companies/(?P<company_id>.*)$', CompanyView.as_view()), ]
from django.conf.urls import include, url from django.contrib import admin from company.views import CompanyView, CompaniesView urlpatterns = [ url(r'^companies$', CompanyView.as_view()), url(r'^companies/(?P<company_id>\w+)$', CompaniesView.as_view()) ]
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 from company.views import CompanyView, CompanyAll, GetIndex from custom_user.views import CreateUserView from review.views import ReviewsByCompany, GiveReview app_name = 'CompanyReview' urlpatterns = [ path('admin/', admin.site.urls), path('', GetIndex.as_view()), path('company/', CompanyView.as_view()), path('all-company/', CompanyAll.as_view(), name='list-company'), path('creat-user/', CreateUserView.as_view()), path('<int:pk>/', ReviewsByCompany.as_view(), name='detail'), path('creat-review/', GiveReview.as_view()), ]
from django.urls import path from company.views import CompanyView # This must be same as the namespace in the config.urls.py # This allows this view to be used as a url tag in the html. app_name = "company" urlpatterns = [ path("<int:id>/", CompanyView.as_view(), name="profile"), ]