示例#1
0
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from django.contrib import admin
from django.views.generic import TemplateView
from django.contrib.auth.views import LoginView, LogoutView

from menus.views import HomeView
from profiles.views import ProfileFollowToggle, RegisterView, activate_user_view

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^restaurants/', include('restaurants.urls',
                                  namespace='restaurants')),
    url(r'^u/', include('profiles.urls', namespace='profiles')),
    url(r'^profile-follow/$', ProfileFollowToggle.as_view(), name='follow'),
    url(r'^items/', include('menus.urls', namespace='menus')),
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^login/$', LoginView.as_view(), name='login'),
    url(r'^logout/$', LogoutView.as_view(), name='logout'),
    url(r'^register/$', RegisterView.as_view(), name='register'),
    url(r'^activate/(?P<code>[a-z0-9].*)/$',
        activate_user_view,
        name='activate'),
    url(r'^about/$',
        TemplateView.as_view(template_name='about.html'),
        name='about'),
    url(r'^contact/$',
        TemplateView.as_view(template_name='contact.html'),
        name='contact'),
]
示例#2
0
    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, include
from django.contrib import admin

from django.contrib.auth.views import LoginView, LogoutView

from django.views.generic import TemplateView

from profiles.views import ProfileFollowToggle, RegisterView, activate_user_view

from menus.views import HomeView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', HomeView.as_view(), name="home"),
    url(r'^about/$', TemplateView.as_view(template_name='about.html'), name="about"),
    url(r'^register/$', RegisterView.as_view(), name='register'),
    url(r'^activate/(?P<code>[a-z0-9].*)/$', activate_user_view, name='activate'),   
    url(r'^logout/$', LogoutView.as_view(), name='logout'),
    url(r'^login/$', LoginView.as_view(), name='login'),
    url(r'^profile-follow/',ProfileFollowToggle.as_view(), name='follow'),
    url(r'^restaurants/', include('restaurants.urls', namespace='restaurants')),
    url(r'^items/', include('menus.urls', namespace='menus')),
    url(r'^u/', include('profiles.urls', namespace='profile')),
    url(r'^contact/$', TemplateView.as_view(template_name='contact.html'), name="contact"),
]
示例#3
0
    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,include
from django.views.generic import TemplateView
from django.contrib.auth.views import LoginView,LogoutView

from profiles.views import ProfileFollowToggle, RegisterView,activate_user_view
from menus.views import HomeView

urlpatterns = [
    path('restaurants/',include('restaurants.urls',namespace='restaurants')),
    path('items/',include('menus.urls',namespace='menus')),
    path('u/',include('profiles.urls',namespace='profiles')),
    path('profile-follow/',ProfileFollowToggle.as_view(),name='follow'),
    path('login/',LoginView.as_view(),name='login'),
    path('logout/',LogoutView.as_view(),name='logout'),
    path('register/',RegisterView.as_view(),name='register'),
    path('activate/<code>',activate_user_view,name="activate"),
    path('',HomeView.as_view(),name='home'),
    path('about/',TemplateView.as_view(template_name = "about.html"),name='about'),
    path('contact/',TemplateView.as_view(template_name = "contact.html"),name='contact'),
    path('admin/', admin.site.urls),
]
示例#4
0
from django.contrib import admin
from django.urls import path, include
from django.urls import re_path

from django.views.generic import TemplateView

from django.contrib.auth.views import LoginView, LogoutView

from menus.views import HomeView
from profiles.views import ProfileFollowToggle, RegisterView, activate_user_view

app_name = "trydjango1-11"

urlpatterns = [
    re_path(r'^admin/', admin.site.urls),
    re_path(r'^$', HomeView.as_view(), name='home'),
    re_path(r'^register/$', RegisterView.as_view(), name='register'),
    re_path(r'^activate/(?P<code>[a-z0-9].*)/$',
            activate_user_view,
            name='activate'),
    re_path(r'^login/$', LoginView.as_view(), name='login'),
    re_path(r'^logout/$', LogoutView.as_view(), name='logout'),
    re_path(r'^profile-follow/$', ProfileFollowToggle.as_view(),
            name='follow'),
    path('u/', include('profiles.urls', namespace='profiles')),
    path('items/', include('menus.urls', namespace='menus')),
    path('restaurants/', include('restaurants.urls', namespace='restaurants')),
    re_path(r'^about/$',
            TemplateView.as_view(template_name='about.html'),
            name='about'),
    re_path(r'^contact/$',