adding weltenfall internal serve code to the urls

This commit is contained in:
Gabor Körber 2014-06-25 17:14:04 +02:00
parent 8abcc73df9
commit b6ec851981
2 changed files with 6 additions and 5 deletions

View File

@ -11,7 +11,7 @@ https://docs.djangoproject.com/en/1.6/ref/settings/
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SERVE_INTERNAL = True
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/

View File

@ -11,9 +11,10 @@ urlpatterns = patterns('',
url(r'^crafting/', 'dj.scon.views.crafting', name='scon_crafting'),
)
if settings.DEBUG :
if settings.DEBUG or getattr(settings, 'SERVE_INTERNAL', False):
urlpatterns += patterns('',
(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
url(r'^static/(?P<path>.*)$', 'django.contrib.staticfiles.views.serve'),
url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
'document_root': settings.MEDIA_ROOT,
}),
)