From 623fd7afb4d44ec51713f960099ad33c315f82bc Mon Sep 17 00:00:00 2001 From: Carlos Daniel Ruvalcaba Valenzuela Date: Wed, 23 Jul 2008 03:21:30 -0700 Subject: [PATCH] Fixed servefiles urls --- urls.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/urls.py b/urls.py index 72afcbf..cf39a0e 100644 --- a/urls.py +++ b/urls.py @@ -28,15 +28,16 @@ import os from django.conf.urls.defaults import * from django.conf import settings -if settings.SERVE_FILES: - APP_ROOT = os.sys.path[0] or os.curdir - servefiles = (r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': os.path.join(APP_ROOT, 'media')}) -else: - servefiles = '' - -urlpatterns = patterns('', servefiles, +urls = [ (r'login', 'django.contrib.auth.views.login',{'template_name': 'login.html'}), (r'logout', 'django.contrib.auth.views.logout',{'template_name': 'master.html'}), (r'^admin/', include('django.contrib.admin.urls')), (r'^', include('bcms.pages.urls')), -) +] + +if settings.SERVE_FILES: + APP_ROOT = os.sys.path[0] or os.curdir + servefiles = (r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': os.path.join(APP_ROOT, 'media')}) + urls.insert(0, servefiles) + +urlpatterns = patterns('', *urls) -- 2.11.4.GIT