use seperate setting for disabling admin
This commit is contained in:
parent
132464b35f
commit
a316eb928b
2 changed files with 5 additions and 3 deletions
|
@ -7,6 +7,7 @@ ALLOWED_HOSTS = ['*']
|
|||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = os.environ['DEBUG']
|
||||
ENABLE_ADMIN = DEBUG
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = os.environ['SECRET_KEY']
|
||||
|
@ -47,7 +48,7 @@ INSTALLED_APPS = [
|
|||
'project.search',
|
||||
]
|
||||
|
||||
if DEBUG:
|
||||
if ENABLE_ADMIN:
|
||||
INSTALLED_APPS += ['django.contrib.admin']
|
||||
|
||||
# Harden Django!
|
||||
|
|
|
@ -16,13 +16,14 @@ urlpatterns = [
|
|||
url(r'', include(wagtail_urls)),
|
||||
]
|
||||
|
||||
if settings.ENABLE_ADMIN:
|
||||
urlpatterns = [url(r'^django-admin/', include(admin.site.urls))] + urlpatterns
|
||||
|
||||
|
||||
if settings.DEBUG:
|
||||
from django.conf.urls.static import static
|
||||
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
||||
|
||||
urlpatterns = [url(r'^django-admin/', include(admin.site.urls))] + urlpatterns
|
||||
|
||||
# Serve static and media files from development server
|
||||
urlpatterns += staticfiles_urlpatterns()
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
|
Reference in a new issue