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 pages.views import home_view, contact_view, about_view from pages.views import (ContactView, HomeView, AboutView) from products.views import product_list_view, product_detail_view, product_create_view, product_delete_view urlpatterns = [ # for products urls path('products/', include('products.urls')), path('', HomeView.as_view(), name='home'), path('about/', AboutView.as_view(), name='about'), path('contact/', ContactView.as_view(), name='contact'), # Functions base urls # path('', home_view, name='home'), # path('about/', about_view, name='about'), # path('contact/', contact_view, name='contact'), # path('product/create/', product_create_view, name='product_create'), # path('products/', product_list_view, name='products'), # path('product/<int:product_id>/', product_detail_view, name='product_update'), # path('product/<int:product_id>/delete/', product_delete_view, name='product_delete'), path('admin/', admin.site.urls, name='admin'), ]
url(r'^buttons$', TemplateView.as_view(template_name='buttons.html'), name="buttons"), url(r'^api-auth/', include('rest_framework.urls',namespace='rest_framework')), url(r'^chaining/', include('smart_selects.urls')), url(r'^admin/property/neighborhood/add/$',include('smart_selects.urls')), url(r'^blog/', BlogView.as_view()), url(r'^mobile/', MobileView.as_view()), url(r'^post/$', views.EmailView.as_view()), #this endpoint is used to send emails url(r'^notifynew/$', views.NotifyView.as_view()), #this endpoint is used to send emails url(r'^activatenew/$', views.ActivateView.as_view()), #this endpoint is used to send emails url(r'^postblog/$', views.PostBlogView.as_view()), #this endpoint is used to send emails url(r'^postcomment/$', views.PostCommentView.as_view()), url(r'^rules/', include('rules_light.urls')), url(r'^sale/', SalesView.as_view()), url(r'^sales/', SalesView.as_view()), url(r'^rent/', RentView.as_view()), url(r'^contact/', ContactView.as_view()), url(r'^contactus/', views.ContactView.as_view()), url(r'^featured/', FeaturedView.as_view()), url(r'^rentals/', RentView.as_view()), url(r'^agents/', AgentView.as_view()), url(r'^about/', AboutView.as_view()), url(r'^dashboard/', DashboardView.as_view()), url(r'^logout/',DashboardLogoutView.as_view()), url(r'^search/', views.SearchView.as_view()), url(r'^rss/', RssSiteNewsFeed()), url(r'^feeds/', RssPostsFeed()), url(r'^atom/', AtomSiteNewsFeed()), url(r'^signup/',MemberSignupView.as_view()), url(r'^signin/',MemberLoginView.as_view()), # url(r'^accounts/login/$',MemberLoginView.as_view()), url(r'^accounts/login/$',RedirectView.as_view(url='/signin/')),
from django.views.decorators.cache import cache_page from django.conf.urls import patterns, url from pages.views import IndexView, VeloView, PalatView, SnowView, SkiView, UslovView, ContactView urlpatterns = patterns( '', # url(r'^$', cache_page(5 * 60)(IndexView.as_view()), name='index'), url(r'^$', IndexView.as_view(), name='index'), url(r'^velosipedy/$', cache_page(60 * 60)(VeloView.as_view()), name='velosipedy'), url(r'^palatki/$', PalatView.as_view(), name='palatki'), url(r'^snoubordy/$', SnowView.as_view(), name='snoubordy'), url(r'^gornye_lyzhi/$', SkiView.as_view(), name='gornye_lyzhi'), url(r'^uslovia/$', UslovView.as_view(), name='uslovia'), url(r'^contacts/$', ContactView.as_view(), name='contacts'), )
from django.urls import path from pages.views import AboutView, IndexView, ContactView urlpatterns = [ path('', IndexView.as_view(), name="index"), path('about/', AboutView.as_view(), name="about"), path('contact/', ContactView.as_view(), name="contact"), #path(route, view, opt(kısayol ismi)) ]
from django.urls import path from pages.views import ContactView, Result, detailPage app_name = 'pages' urlpatterns = [ path('', ContactView.as_view(), name='index'), path('search/query=<str:query>', Result.as_view(), name='query'), path('search/details/<int:fdcId>', detailPage, name='detailPage'), ]
from django.conf import settings from django.conf.urls import patterns, url from django.conf.urls.static import static from pages.views import (HomeView, AboutView, WorkView, ConsultancyView, WorkshopsView, WorkshopView, ContactView) urlpatterns = patterns('', url(r'^$', HomeView.as_view(), name='home'), url(r'^about$', AboutView.as_view(), name='about'), url(r'^work$', WorkView.as_view(), name='work'), url(r'^consultancy$', ConsultancyView.as_view(), name='consultancy'), url(r'^workshops$', WorkshopsView.as_view(), name='workshops'), url(r'^workshops/(?P<wsid>[a-zA-Z0-9-]+)$', WorkshopView.as_view(), name='workshops'), url(r'^contact$', ContactView.as_view(), name='contact'), ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
""" from __future__ import unicode_literals from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings from django.conf.urls.static import static from django.core.urlresolvers import reverse_lazy from django.views.generic import RedirectView from pages.views import LandingView, ServicesView, ContactView admin.autodiscover() urlpatterns = patterns( '', url(r'^$', LandingView.as_view(), name="landing"), url(r'^team/', include('profiles.urls', namespace="profiles"), name="profiles"), url(r'^services/', ServicesView.as_view(), name="services"), url(r'^contact/', ContactView.as_view(), name="contact"), url(r'^blog/', include('blog.urls')), url(r'^work/', include('projects.urls')), url(r'^admin/', include(admin.site.urls)), # Redirects url(r'^feed/', RedirectView.as_view(url=reverse_lazy('blog_feed'))), url(r'^rss/', RedirectView.as_view(url=reverse_lazy('blog_feed'))), url(r'^atom/', RedirectView.as_view(url=reverse_lazy('blog_atom'))), ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)