from django.conf.urls import patterns, url from home.views import HomeView, AboutView, ContactView, RegView urlpatterns = patterns( '', url(r'^about/$', AboutView.as_view(), name='about'), url(r'^contact/$', ContactView.as_view(), name='contact'), url(r'^home/$', HomeView.as_view(), name='home'), url(r'^reg/$', RegView.as_view(), name='reg'), )
from django.conf.urls import url from django.urls import include, re_path from home.views import HomeView, CreateView, ShopView, AboutView #, ContactView from django.contrib.auth import views as auth_views from . import views as myapp_views from home import views from . import views app_name = 'home' urlpatterns = [ re_path(r'^$', HomeView.as_view(), name='home'), re_path(r'^connect/(?P<operation>.+)/(?P<pk>\d+)/$', views.change_friends, name='change_friends'), re_path(r'^like/$', views.like_post, name='like_post'), re_path(r'^create/$', CreateView.as_view(), name='create'), re_path(r'^shop/$', ShopView.as_view(), name='shop'), re_path(r'^shop/(?P<pk>\d+)/$', ShopView.as_view(), name='shop_with_pk'), re_path(r'^about/$', AboutView.as_view(), name='about'), re_path(r'contact/$', views.contact, name='contact'), #re_path(r'^search/$', views.post, name='search_posts') #re_path(r'^contact/$', ContactView.as_view(), name='contact') #re_path(r'^create/$', HomeView.as_view(), name='create') #re_path(r'^home/$',) ]
from django.urls import path from . import views from home.views import HomeView, AboutView, profile_view, CreateUser urlpatterns = [ path('', HomeView.as_view(), name='HomePage'), path('about', AboutView.as_view(), name='AboutPage'), path('accounts/profile/', profile_view, name='Profile'), path('accounts/create', CreateUser.as_view(), name='CreateUser') ]
from django.conf.urls import patterns, url from home.rss import LatestVideos from home.views import AboutView, BrowseView, IndexView, CategoryView urlpatterns = patterns( '', url(r'^rss/main', LatestVideos(), name="main_rss"), url(r'^$', IndexView.as_view(), name="index"), url(r'^browse/$', BrowseView.as_view(), name="browse"), url(r'^about/$', AboutView.as_view(), name="about"), url(r'^category/(?P<slug>[-\w]+)/$', CategoryView.as_view(), name='category'), url(r'^favorite/add/$', 'favorite.views.toggle_favorite', name='favorite_toggle'), )
from django.conf.urls import patterns, url from home.views import HomeView,AboutView,ContactView,RegView urlpatterns = patterns('', url(r'^about/$', AboutView.as_view(), name='about'), url(r'^contact/$', ContactView.as_view(), name='contact'), url(r'^home/$', HomeView.as_view(), name='home'), url(r'^reg/$', RegView.as_view(), name='reg'), )
from django.conf.urls import patterns, url from home.rss import LatestVideos from home.views import AboutView, BrowseView, IndexView, CategoryView urlpatterns = patterns( "", url(r"^rss/main", LatestVideos(), name="main_rss"), url(r"^$", IndexView.as_view(), name="index"), url(r"^browse/$", BrowseView.as_view(), name="browse"), url(r"^about/$", AboutView.as_view(), name="about"), url(r"^category/(?P<slug>[-\w]+)/$", CategoryView.as_view(), name="category"), url(r"^favorite/add/$", "favorite.views.toggle_favorite", name="favorite_toggle"), )
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ 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. Add an import: from blog import urls as blog_urls 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) """ from django.conf.urls import include, url from django.contrib import admin from django.views.generic import RedirectView from updates import views as update_views from home.views import AboutView urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^accounts/', include('django.contrib.auth.urls')), url(r'^$', RedirectView.as_view(url='/updates/')), url(r'^(?P<update_id>\d+)$', update_views.UpdateRedirectView.as_view()), url(r'^updates/', include('updates.urls')), url(r'^users/', include('users.urls')), url(r'^about/', AboutView.as_view(), name="about") ]
from django.urls import path from home.views import HomeView , AboutView ,PrivacyView ,ContactView urlpatterns = [ path('', HomeView.as_view(), name = 'home' ), path('about/', AboutView.as_view(), name = 'about' ), path('privacy/', PrivacyView.as_view(), name = 'privacy' ), path('contact/', ContactView.as_view(), name = 'contact' ), ]
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import include, url from django.contrib import admin from home.views import HomePageView, HomePageListView, AboutView, ProfileView, \ GreetingView, TimelineView, PeopleView, NewsView, NewsDetailView, NoticeDetailView, NoticesView, \ ContentView, CurriculumView, FeatureView, PeriodView, PurposeView, \ SponsorView, HowtoView, ApplicationView, InquireView from django.contrib.auth import views as auth_views urlpatterns = [ url(r'^$', HomePageListView.as_view(), name='home'), url(r'^(home)', HomePageListView.as_view(), name='home'), url(r'^introduction/about/', AboutView.as_view(), name='about'), url(r'^introduction/greeting/', GreetingView.as_view(), name='greeting'), url(r'^introduction/timeline/', TimelineView.as_view(), name='timeline'), url(r'^introduction/people/', PeopleView.as_view(), name='people'), url(r'^introduction/news/', NewsView.as_view(), name='news'), url(r'^introduction/news_detail/(?P<pk>[0-9]+)/$', NewsDetailView.as_view(), name='news_detail'), url(r'^introduction/notices/', NoticesView.as_view(), name='notices'), url(r'^introduction/notice_detail/(?P<pk>[0-9]+)/$', NoticeDetailView.as_view(), name='notice_detail'), url(r'^education/content/', ContentView.as_view(), name='content'), url(r'^education/curriculum/', CurriculumView.as_view(), name='curriculum'), url(r'^education/feature/', FeatureView.as_view(), name='feature'),
from django.conf.urls import patterns, url from home.rss import LatestVideos from home.views import AboutView, HomeView, CategoryView urlpatterns = patterns( '', url(r'^rss/main', LatestVideos(), name="main_rss"), url(r'^$', HomeView.as_view(), name="index"), url( r'^about/$', AboutView.as_view(), name="about"), url( r'^category/(?P<slug>[-\w]+)/$', CategoryView.as_view(), name='category'), url( r'^favorite/add/$', 'favorite.views.toggle_favorite', name='favorite_toggle'), )
""" 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.urls import path from home.views import (AboutView, DashboardView, closeAllValvesView) app_name = "home" urlpatterns = [ path("", DashboardView.as_view(), name="home"), path("about/", AboutView.as_view(), name="about"), path("closeallvalves/", closeAllValvesView, name="closeallvalves"), ]
from django.urls import path from home.views import AboutView, HomeView app_name = 'home' urlpatterns = [ path(r'', HomeView.as_view(), name='index'), path(r'about', AboutView.as_view(), name='about'), ]
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, include from django.contrib import admin from django.conf.urls.static import static from django.conf import settings from blog.views import BlogView from home.views import HomeView, AboutView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'', HomeView.as_view()), url(r'^about/', AboutView.as_view()), url(r'^blog/', BlogView.as_view()), url(r'^ckeditor/', include('ckeditor_uploader.urls')), ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT, show_indexes=True) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT, show_indexes=True)