Skip to content

Commit

Permalink
DEBUG=True is not required to serve static files in Django
Browse files Browse the repository at this point in the history
  • Loading branch information
Sridhar Ratnakumar committed Jan 27, 2012
1 parent b2aa6b9 commit 9555ddf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions settings.py
@@ -1,7 +1,7 @@
# Django settings for djangogtd project.
import sys, os

DEBUG = True
DEBUG = False
TEMPLATE_DEBUG = DEBUG

ROOT = os.path.abspath(os.path.dirname(__file__))
Expand All @@ -12,9 +12,10 @@

MANAGERS = ADMINS

STACKATO = 'VCAP_SERVICES' in os.environ

## Pull in CloudFoundry's production settings
if 'VCAP_SERVICES' in os.environ:
if STACKATO:
import json
vcap_services = json.loads(os.environ['VCAP_SERVICES'])
# XXX: avoid hardcoding here
Expand Down Expand Up @@ -117,6 +118,7 @@
'django.contrib.admindocs',
'django.contrib.databrowse',
'django.contrib.humanize',
'django.contrib.staticfiles',
'gtd',
'south',
)
Expand Down
2 changes: 1 addition & 1 deletion urls.py
Expand Up @@ -16,7 +16,7 @@
url(r'^$', lambda request: redirect('/gtd')),
)

if settings.DEBUG:
if settings.DEBUG or settings.STACKATO:
from os.path import join, dirname, abspath
urlpatterns += patterns('',
url(r'^media/admin/(?P<path>.*)$', 'django.views.static.serve',
Expand Down

0 comments on commit 9555ddf

Please sign in to comment.