示例#1
0
"""conf URL Configuration

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 tours.views import MainView, DepartureView, TourView

urlpatterns = [
    path('', MainView.as_view()),
    path('departure/<str:departure>/', DepartureView.as_view()),
    path('tour/<int:id>/', TourView.as_view()),
    path('admin/', admin.site.urls)
]
示例#2
0
文件: urls.py 项目: sofikovr/HW
"""step_tours URL Configuration

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'))
"""
import path as path
from django.contrib import admin
from django.urls import path

from tours.views import MainView, DepartureView, TourView

urlpatterns = [
    path('', MainView.as_view(), name='main'),
    path('departure/<str:departure>/',
         DepartureView.as_view(),
         name='departure'),
    path('tour/<int:id>/', TourView.as_view(), name='tour'),
    path('admin/', admin.site.urls),
]
示例#3
0
"""stepik_tours URL Configuration

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 tours.views import MainView, DepartureView, TourView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', MainView.as_view(), name='home'),
    path('departure/<str:departure>/',
         DepartureView.as_view(),
         name='departure'),
    path('tour/<int:pk>/', TourView.as_view(), name='tour')
]
示例#4
0
    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.contrib import admin
from django.urls import path
#from tours.views import MainView, DepartureView, TourView, TestView
from tours.views import custom_handler404
from tours.views import MainView, TourView, DepartureView

handler404 = custom_handler404

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', MainView.as_view(), name='index'),
    path('tour/<int:id>/', TourView.as_view(), name='tour'),
    path('departure/<str:departure>/',
         DepartureView.as_view(),
         name='departure'),
]
#path('departure/<str:departure>/', DepartureView.as_view(), name='departure'),
#path('tour/<int:id>/', TourView.as_view(), name='tour'),
示例#5
0
"""stepik_tours URL Configuration

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 tours.views import MainView, DepartureView, TourView

handler404 = 'tours.views.page_not_found_view'
handler500 = 'tours.views.error_view'

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', MainView.as_view(), name='Main View'),
    path('departure/<str:departure>',
         DepartureView.as_view(),
         name='Departure View'),
    path('tour/<int:id>', TourView.as_view(), name='Tour View'),
]
"""stepic_tours URL Configuration

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.contrib import admin
from django.urls import path
from tours.views import MainView, DepartureView, TourView

urlpatterns = [
    path('admin/', admin.site.urls),
    path("", MainView.as_view()),
    path("departure/<str:departure>", DepartureView.as_view()),
    path("tour/<int:id>", TourView.as_view()),
]
示例#7
0
from django.urls import path

from tours.views import MainView, DepartureView, TourView, custom_handler404, custom_handler505
"""stepik_tours URL Configuration

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'))
"""

handler404 = custom_handler404
handler500 = custom_handler505

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', MainView.as_view(), name="main"),
    path('departure/<str:departure>/',
         DepartureView.as_view(),
         name="departure"),
    path('tour/<int:id>/', TourView.as_view(), name="tour")
]
示例#8
0
"""stepik_tours URL Configuration

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 tours.views import MainView, DepartureView, TourView

urlpatterns = [
    path('', MainView.as_view(), name='Main_page_all_tours'),
    path('departure/<str:city_id>/',
         DepartureView.as_view(),
         name='Departure_from_city'),
    path('tour/<int:id>/', TourView.as_view(), name='Tour_description_page'),
]
示例#9
0
"""stepik_tours URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.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.contrib import admin
from django.urls import path
from tours.views import MainView, DepartureView, TourView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', MainView.as_view(), name='stepik_title'),
    path('departure/<str:depar_id>/', DepartureView.as_view(), name='depart'),
    path('tour/<int:tour_id>/', TourView.as_view(), name='stepik_tours'),
]