from guardian.compat import include, url, patterns, handler404, handler500 from django.conf import settings from django.contrib import admin __all__ = ['handler404', 'handler500'] admin.autodiscover() urlpatterns = patterns( '', (r'^admin/', include(admin.site.urls)), url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='logout'), (r'^', include('example_project.posts.urls')), ) if 'grappelli' in settings.INSTALLED_APPS: urlpatterns += patterns( '', (r'^grappelli/', include('grappelli.urls')), )
# handler404 and handler500 are needed for admin tests from guardian.compat import include, url, handler404, handler500 # pyflakes:ignore from guardian.mixins import PermissionRequiredMixin from django.contrib import admin from django.contrib.auth.views import login from django.views.generic import View admin.autodiscover() class TestClassRedirectView(PermissionRequiredMixin, View): permission_required = 'testapp.change_project' urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^accounts/login/', login, {'template_name': 'blank.html'}), url(r'^permission_required/', TestClassRedirectView.as_view()), ]
from guardian.compat import include, url, handler404, handler500 from django.conf import settings from django.contrib import admin from django.contrib.auth.views import logout from django.conf.urls import url __all__ = ['handler404', 'handler500'] admin.autodiscover() urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^logout/$', logout, {'next_page': '/'}, name='logout'), url(r'^', include('posts.urls')), ] if 'grappelli' in settings.INSTALLED_APPS: urlpatterns += [url(r'^grappelli/', include('grappelli.urls')), ] if 'rosetta' in settings.INSTALLED_APPS: urlpatterns += [url(r'^rosetta/', include('rosetta.urls')), ]
from guardian.compat import include, url, handler404, handler500 from django.conf import settings from django.contrib import admin from django.contrib.auth.views import logout __all__ = ['handler404', 'handler500'] admin.autodiscover() urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^logout/$', logout, {'next_page': '/'}, name='logout'), url(r'^article/', include('articles.urls', namespace='articles')), url(r'^', include('posts.urls')), ] if 'grappelli' in settings.INSTALLED_APPS: urlpatterns += [ url(r'^grappelli/', include('grappelli.urls')), ] if 'rosetta' in settings.INSTALLED_APPS: urlpatterns += [ url(r'^rosetta/', include('rosetta.urls')), ]
from guardian.compat import include, url, handler404, handler500 from django.conf import settings from django.contrib import admin from django.contrib.auth.views import logout __all__ = ['handler404', 'handler500'] admin.autodiscover() urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^logout/$', logout, {'next_page': '/'}, name='logout'), url(r'^article/', include('articles.urls', namespace='articles')), url(r'^', include('posts.urls')), ] if 'grappelli' in settings.INSTALLED_APPS: urlpatterns += [url(r'^grappelli/', include('grappelli.urls')), ] if 'rosetta' in settings.INSTALLED_APPS: urlpatterns += [url(r'^rosetta/', include('rosetta.urls')), ]
from guardian.compat import include, url, patterns, handler404, handler500 from django.conf import settings from django.contrib import admin __all__ = ['handler404', 'handler500'] admin.autodiscover() urlpatterns = patterns( '', (r'^admin/', include(admin.site.urls)), url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='logout'), (r'^', include('posts.urls')), ) if 'grappelli' in settings.INSTALLED_APPS: urlpatterns += patterns( '', (r'^grappelli/', include('grappelli.urls')), ) if 'rosetta' in settings.INSTALLED_APPS: urlpatterns = patterns( '', url(r'^rosetta/', include('rosetta.urls')), ) + urlpatterns
from guardian.compat import include, url, patterns, handler404, handler500 from django.conf import settings from django.contrib import admin __all__ = ['handler404', 'handler500'] admin.autodiscover() urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='logout'), (r'^', include('example_project.posts.urls')), ) if 'grappelli' in settings.INSTALLED_APPS: urlpatterns += patterns('', (r'^grappelli/', include('grappelli.urls')), )
from guardian.compat import include, handler404, handler500 from django.conf import settings from django.urls import path from django.contrib import admin from django.contrib.auth.views import LogoutView __all__ = ['handler404', 'handler500'] admin.autodiscover() urlpatterns = [ path('admin/', admin.site.urls), path('logout/', LogoutView.as_view(next_page='/'), name='logout'), path('article/', include('articles.urls', namespace='articles')), path('', include('posts.urls')), ] if 'grappelli' in settings.INSTALLED_APPS: urlpatterns += [path('grappelli/', include('grappelli.urls')), ] if 'rosetta' in settings.INSTALLED_APPS: urlpatterns += [path('rosetta/', include('rosetta.urls')), ]
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/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. 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 include,url from guardian.compat import include, url, handler404, handler500 from django.contrib import admin from django.contrib.auth.views import logout __all__ = ['handler404', 'handler500'] admin.autodiscover() urlpatterns = [ url(r'^polls/', include('polls.urls')), url(r'^report/', include('report.urls')), url(r'^admin/', include(admin.site.urls)), #url(r'^', include('polls.urls') ), url(r'^', include('mp.urls')), url(r'^logout/$', logout, {'next_page': '/'}, name='logout'), ]