Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

switching off admin URL for servers with DEBUG=False

  • Loading branch information...
commit 181da0d5b2f6d628dc9ab3a560f1bdb866e99544 1 parent c47e6de
Piotr Zalewa zalun authored
Showing with 15 additions and 10 deletions.
  1. +15 −10 flightdeck/urls.py
25 flightdeck/urls.py
View
@@ -7,24 +7,29 @@
admin.autodiscover()
-try:
- import grappelli
- urls = [(r'^grappelli/', include('grappelli.urls'))]
-except:
- urls = []
-urls.extend([
+urls = [
# home
- # temporary fix - please uncomment after fixing landing page
url(r'^$',base_views.homepage, name='home'),
- #url(r'^$', 'jetpack.views.gallery', {'type': 'jetpack'}, name='home'),
+ ]
+
+if settings.DEBUG:
+ try:
+ import grappelli
+ urls.append((r'^grappelli/', include('grappelli.urls')))
+ except:
+ ""
# admin
- (r'^admin/doc/', include('django.contrib.admindocs.urls')),
- (r'^admin/', include(admin.site.urls)),
+ urls.extend([
+ (r'^admin/doc/', include('django.contrib.admindocs.urls')),
+ (r'^admin/', include(admin.site.urls))
+ ])
+urls.extend([
# static files
# this should be used only in development server
+ # please refer to http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/#serving-media-files
url(r'^media/(?P<path>.*)$', static.serve, {'document_root': settings.MEDIA_ROOT}, name='media'),
# API Browser
Please sign in to comment.
Something went wrong with that request. Please try again.