from django.conf.urls.defaults import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin from django.contrib.auth.decorators import login_required from django.views.generic.base import TemplateView admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'myrxstory.views.home', name='home'), # url(r'^myrxstory/', include('myrxstory.foo.urls')), url(r'^$', TemplateView.as_view(template_name='home.html'), name='home'), url(r'^dashboard/$', login_required(TemplateView.as_View(template_name='dashboard.html')), name='dashboard'), url(r'^account/', include('registration.urls')), # Uncomment the admin/doc line below to enable admin documentation: # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: url(r'^admin/', include(admin.site.urls)), )
from django.urls import path from .views import home, my_logout from django.views.generic.base import TemplateView urlpatterns = [ path('', home, name='home'), path('logout/', my_logout, name='logout'), path('home2/', TemplateView.as_View(), name='home2'), ]