pandora/pandora/urls.py

51 lines
1.9 KiB
Python
Raw Normal View History

2010-09-15 16:25:54 +00:00
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
import os
2009-06-08 16:08:59 +00:00
from django.conf.urls.defaults import *
2010-09-15 16:25:54 +00:00
from oxdjango.http import HttpFileResponse
2009-06-08 16:08:59 +00:00
2009-08-16 12:23:29 +00:00
from django.conf import settings
2009-06-08 16:08:59 +00:00
# Uncomment the next two lines to enable the admin:
2009-08-16 12:23:29 +00:00
from django.contrib import admin
admin.autodiscover()
2010-09-15 16:25:54 +00:00
def serve_static_file(path, location, content_type):
return HttpFileResponse(location, content_type=content_type)
2009-06-08 16:08:59 +00:00
urlpatterns = patterns('',
2009-12-31 15:04:32 +00:00
(r'^ajax_filtered_fields/', include('ajax_filtered_fields.urls')),
2010-08-07 14:31:20 +00:00
(r'^api/upload/$', 'archive.views.firefogg_upload'),
2010-02-08 10:26:25 +00:00
(r'^site.js$', 'app.views.site_js'),
2010-09-07 13:08:23 +00:00
(r'^pandora.json$', 'app.views.pandora_json'),
2010-08-24 17:16:33 +00:00
(r'^$', 'app.views.intro'),
(r'^ra$', 'app.views.index'),
(r'^timeline$', 'app.views.timeline'),
2010-09-14 14:10:37 +00:00
(r'^file/(?P<oshash>.*)$', 'archive.views.lookup_file'),
2010-10-16 11:58:57 +00:00
(r'^r/(?P<key>.*)$', 'user.views.recover'),
2010-09-07 14:05:38 +00:00
(r'', include('backend.urls')),
2009-06-08 16:08:59 +00:00
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
2010-07-19 17:39:00 +00:00
(r'^admin/(.*)', include(admin.site.urls)),
2010-09-15 16:25:54 +00:00
(r'^robots.txt$', serve_static_file, {'location': os.path.join(settings.STATIC_ROOT, 'robots.txt'), 'content_type': 'text/plain'}),
2010-09-15 16:40:39 +00:00
(r'^favicon.ico$', serve_static_file, {'location': os.path.join(settings.STATIC_ROOT, 'png/icon.16.png'), 'content_type': 'image/x-icon'}),
2009-06-08 16:08:59 +00:00
)
2009-08-16 12:23:29 +00:00
if settings.DEBUG:
urlpatterns += patterns('',
2010-11-06 16:14:40 +00:00
(r'^data/(?P<path>.*)$', 'django.views.static.serve',
2009-08-16 12:23:29 +00:00
{'document_root': settings.MEDIA_ROOT}),
(r'^static/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.STATIC_ROOT}),
(r'^tests/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.TESTS_ROOT}),
2009-08-16 12:23:29 +00:00
)