from django.urls import path from pages.views import IndexView urlpatterns = [ path('', IndexView.as_view()), ]
from django.views.generic import RedirectView, TemplateView from filebrowser.sites import site from rest_framework import routers from api.urls import router as api_router from odinass.views import SearchCategoryViewSet, SearchOfferViewSet from pages.views import IndexView from yandex_kassa.views import notification router = routers.DefaultRouter() router.register(r'search_category', SearchCategoryViewSet) router.register(r'search_offer', SearchOfferViewSet) urlpatterns = [ url(r'^$', IndexView.as_view(), name='index'), url(r'^account/', include('orders.urls', namespace='account')), url(r'^api/v2/', include(api_router.urls, namespace='api-v2')), url(r'^api/', include(router.urls, namespace='api')), url(r'^yandex-notification/$', notification), url( r'^robots.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain')), url( r'^favicon.ico$', RedirectView.as_view(url=staticfiles_storage.url('favicon.ico'), permanent=True)), url(r'^admin/filebrowser/', include(site.urls)), url(r'^admin/', include(admin.site.urls)), url(r'^1c/', include('odinass.urls', namespace='1c')),
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 IndexView, AboutView app_name = 'pages' urlpatterns = [ path('', IndexView.as_view(), name='index'), path('about/', AboutView.as_view(), name='about'), ]
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)) ]
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, include, re_path from django.conf import settings from django.conf.urls.i18n import i18n_patterns from django.views.static import serve from pages.views import TemplateAdminAJAXView, IndexView urlpatterns = i18n_patterns( re_path(r'^$', IndexView.as_view(), name='index'), path('ckeditor/', include('ckeditor_uploader.urls')), re_path(r'^admin/', admin.site.urls), # extra url for fetching template path('template/fetch/<slug:text>/', TemplateAdminAJAXView.as_view()), path('', include('pages.urls')), re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}), re_path(r'^static/(?P<path>.*)$', serve, {'document_root': settings.STATIC_ROOT}), )
# coding: utf-8 ''' Created on 2017年11月10日 @author: likun ''' from django.conf.urls import url from pages.views import LoginView, IndexView, StockSearchView, LogoutView,\ StockForecastView, StockForecastMoreView,\ StockForecastDiffView, StockIndustryRankView, StockArticleDetailView urlpatterns = ( url(r'^login/$', LoginView.as_view(), name='pages_login'), url(r'^logout/$', LogoutView.as_view(), name='pages_logout'), url(r'^$', IndexView.as_view(), name='pages_index'), url(r'^search/$', StockSearchView.as_view(), name='pages_search'), url(r'^forecast/(?P<code>\d+)/$', StockForecastView.as_view(), name='pages_forecast_year'), url(r'^forecast/more/$', StockForecastMoreView.as_view(), name='pages_forecast_more'), url(r'^forecast/diff/$', StockForecastDiffView.as_view(), name='pages_forecast_diff'), url(r'^industryrank/$', StockIndustryRankView.as_view(), name='pages_industryrank'), url(r'^article/$', StockArticleDetailView.as_view(), name='pages_article'), )
from django.urls import re_path from pages.views import IndexView app_name = 'pages' urlpatterns = [ re_path(r'^$', IndexView.as_view(), name="index"), ]
from django.urls import path, include from pdfform.views import list_pdf, upload_pdf, delete_pdf, category_list_pdf from newsletters.views import (newsletter_signup, newsletter_unsubscribe, NewsCreateView, NewsListView, NewsDetailView, NewsDeleteView, NewsUpdateView, email_list_signup) from gallery.views import GalleryListView, GalleryCreateView, GalleryDeleteView from django.views.generic.base import TemplateView #from newsletters.custom_context_processor import newsletter_signup #, newsletter_unsubscribe urlpatterns = [ path('admin/', admin.site.urls), path('tinymce/', include('tinymce.urls')), path('', IndexView.as_view(), name='unity-index'), path('about/', AboutListView.as_view(), name='unity-about'), path('leadership/', TeacherListView.as_view(), name='unity-teacher'), #path('future/',CoursesListView.as_view(), name='unity-courses'), path('pricing/', PricingListView.as_view(), name='unity-pricing'), path('register/', user_views.register, name='register'), path('profile/', user_views.profile, name='profile'), path('post/', PostListView.as_view(), name='blog-home'), path('pdf/', list_pdf, name='list_pdf'), path('pdf/upload/', upload_pdf, name='upload_pdf'), path('pdf/<int:pk>/', delete_pdf, name='delete_pdf'), path('pdf/<str:pdf_cat>', category_list_pdf, name='category_list_pdf'), path('contact/', contactView, name='contact'), path('contact_success/', successView, name='contact_success'), path('calendar/', CalendarView, name='calendar'), path('', include('sendemail.urls')),