1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 07:01:12 +00:00

Disable DEBUG, and let Django serve static file by default.

This commit is contained in:
zhengxie
2012-12-03 21:47:27 +08:00
parent 1fa3724e31
commit 127cb79aa5
2 changed files with 7 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
# Django settings for seahub project.
import os
DEBUG = True
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
@@ -216,6 +216,10 @@ SITE_TITLE = 'Private Seafile'
SITE_BASE = 'http://seafile.com'
SITE_NAME = 'Seafile'
# Using Django to server static file. Set to `False` if deployed behide a web
# server.
SERVE_STATIC = True
try:
import local_settings
except ImportError:
@@ -238,7 +242,7 @@ else:
LOGIN_URL = SITE_ROOT + 'accounts/login'
SEAFILE_VERSION = '1.2.0'
SEAFILE_VERSION = '1.3.0'
USE_SUBDOMAIN = False

View File

@@ -94,7 +94,7 @@ urlpatterns = patterns('',
url(r'^sys/groupadmin/$', sys_group_admin, name='sys_group_admin'),
)
if settings.DEBUG:
if settings.SERVE_STATIC:
media_url = settings.MEDIA_URL.strip('/')
urlpatterns += patterns('',
(r'^%s/(?P<path>.*)$' % (media_url), 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),