-
Notifications
You must be signed in to change notification settings - Fork 0
/
urls.py
47 lines (37 loc) · 1.42 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python
# encoding=utf-8
# maintainer: rgaudin
import os
from django.conf import settings
from django.conf.urls.defaults import patterns, include, url
from django.views.generic.simple import direct_to_template
from django.contrib import admin
from settings import STATIC_ROOT, MEDIA_ROOT
from pnlp_web import urls as pnlp_urls
from pnlp_web import views
admin.autodiscover()
if hasattr(settings, 'SYSTEM_CLOSED') and settings.SYSTEM_CLOSED:
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'', direct_to_template, {'template': 'closed.html'}, name='index'),
# development only
url(r'^static/admin/(?P<path>.*)$',
'django.views.static.serve',
{'document_root': os.path.join(os.path.dirname(\
os.path.abspath(admin.__file__)), \
'media'), 'show_indexes': True}, \
name='static_admin'),
url(r'^static/(?P<path>.*)$',
'django.views.static.serve',
{'document_root': STATIC_ROOT, 'show_indexes': True}, \
name='static'),
url(r'^media/(?P<path>.*)$',
'django.views.static.serve',
{'document_root': MEDIA_ROOT, 'show_indexes': True}, \
name='media'),
)
else:
urlpatterns = patterns('',
url(r'', include(pnlp_urls)),
url(r'^admin/', include(admin.site.urls)),
)