Beispiel #1
0
from django.conf.urls import url
from django.urls import path
from app.views import BaseView, sing_up_for_diagnostic, get_holded_time

urlpatterns = [
    path('', BaseView.as_view(), name='base'),
    path('sing_up_for_diagnostic/',
         sing_up_for_diagnostic,
         name='sing_up_for_diagnostic'),
    path('get_holded_time/', get_holded_time, name='get_holded_time'),
]
Beispiel #2
0
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from app.views import OrderListView, GetMessageView, MyMessageView, MessageView, OrderView, CustomerDetailView, BaseView, UserLoginView, UserLogoutView, NewUserView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^restauracja$', BaseView.as_view(), name='base'),
    url(r'^login$', UserLoginView.as_view(), name='login'),
    url(r'^logout$', UserLogoutView.as_view(), name='logout'),
    url(r'^new_user$', NewUserView.as_view(), name='new'),
    url(r'^customers_detail/(?P<user_id>(\d)+)',
        CustomerDetailView.as_view(),
        name='detale'),
    url(r'^new_order', OrderView.as_view(), name='order'),
    url(r'^message', MessageView.as_view(), name='message'),
    url(r'^my_message', MyMessageView.as_view(), name='my_message'),
    url(r'^get_message', GetMessageView.as_view(), name='get_message'),
    url(r'^order_list', OrderListView.as_view(), name='order_list')
]