-
Notifications
You must be signed in to change notification settings - Fork 16
/
urls.py
57 lines (43 loc) · 2.3 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
47
48
49
50
51
52
53
54
55
56
57
from django.conf import settings
from django.conf.urls import url, include
from django.contrib import admin
import django.views.static, django.views.generic
import cog.views
from django.http.response import HttpResponseNotFound
from filebrowser.sites import site
admin.autodiscover()
urlpatterns = [
# forbidden extensions (case-insensitive)
url(r'(?i).*\.asp\/?$', HttpResponseNotFound),
url(r'(?i).*\.aspx\/?$', HttpResponseNotFound),
url(r'(?i).*\.cfm\/?$', HttpResponseNotFound),
url(r'.*\.cgi\/?$', HttpResponseNotFound),
url(r'(?i).*\.jsp\/?$', HttpResponseNotFound),
url(r'(?i).*\.php\/?$', HttpResponseNotFound),
url(r'(?i).*\.php3\/?$', HttpResponseNotFound),
url(r'(?i).*\.pl\/?$', HttpResponseNotFound),
url(r'(?i).*\.shtml\/?$', HttpResponseNotFound),
url(r'^robots\.txt$', django.views.generic.TemplateView.as_view(template_name='robots.txt', content_type='text/plain'), name='robots.txt'),
# site index
url(r'^$', cog.views.site_home, name='site_home'),
# Grappelli
url(r'^grappelli/', include('grappelli.urls')),
# Filebrowser Admin pages
#(r'^filebrowser/', include('filebrowser.urls')),
url(r'^admin/filebrowser/', include(site.urls)),
# Administrator application
#(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)),
# django-simple-captcha
url(r'^captcha/', include('captcha.urls')),
# OpenID URLs included within CoG URLs
#(r'^openid/', include('django_openid_auth.urls')),
# COG application
url(r'', include('cog.urls')),
# other media (when NOT served through the Apache web server)
# Note: the media must be located under <application>/static/<application>, not static/<application>
url(r'^static/(?P<path>.*)$', django.views.static.serve, {'document_root': settings.STATIC_ROOT} ),
url(r'^site_media/(?P<path>.*)$', django.views.static.serve, {'document_root': settings.MEDIA_ROOT} ),
url(r'^static_media/(?P<path>.*)$', django.views.static.serve, {'document_root': settings.STATIC_ROOT} ),
url(r'^mymedia/(?P<path>.*)$', django.views.static.serve, {'document_root': settings.MYMEDIA } ),
]