From: Radek Czajka Date: Fri, 30 Nov 2012 14:12:22 +0000 (+0100) Subject: fix urls X-Git-Url: https://git.mdrn.pl/fnp-django-template.git/commitdiff_plain/11218c30e676382183cd6713cb0c3d5af5194e38?hp=cce51873845f49cb6dec0efa28e3beb8a23cf472 fix urls --- diff --git a/project_name/urls.py b/project_name/urls.py index aec0289..4471526 100644 --- a/project_name/urls.py +++ b/project_name/urls.py @@ -1,21 +1,26 @@ from django.conf.urls import patterns, include, url +from django.conf import settings -from django.contrib import admin -admin.autodiscover() - -urlpatterns = patterns('', - url(r'^admin/doc/', include('django.contrib.admindocs.urls')), - url(r'^admin/', include(admin.site.urls)), +urlpatterns += patterns('', + # Examples: + # url(r'^$', '{{ project_name }}.views.home', name='home'), + # url(r'^{{ project_name }}/', include('foo.urls')), ) + +# Admin stuff, if necessary. +if 'django.contrib.admin' in settings.INSTALLED_APPS: + from django.contrib import admin + admin.autodiscover() + + urlpatterns += patterns('', + url(r'^admin/doc/', include('django.contrib.admindocs.urls')), + url(r'^admin/', include(admin.site.urls)), + ) + +# Auth stuff, if necessary if 'django_cas' in settings.INSTALLED_APPS: urlpatterns += patterns('', (r'^accounts/login/$', 'django_cas.views.login'), (r'^accounts/logout/$', 'django_cas.views.logout'), ) - -urlpatterns += patterns('', - # Examples: - # url(r'^$', '{{ project_name }}.views.home', name='home'), - # url(r'^{{ project_name }}/', include('{{ project_name }}.foo.urls')), -)