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-11-23 09:53:12 +00:00
|
|
|
from ox.django.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()
|
|
|
|
|
2013-05-18 21:43:52 +00:00
|
|
|
import app.monkey_patch
|
2011-11-04 18:10:48 +00:00
|
|
|
|
2012-01-03 20:18:47 +00:00
|
|
|
import ox.django.api.urls
|
2010-11-25 15:21:23 +00:00
|
|
|
|
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('',
|
2012-05-23 13:54:36 +00:00
|
|
|
# Uncomment the admin/doc line below to enable admin documentation:
|
|
|
|
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
2010-11-25 15:21:23 +00:00
|
|
|
(r'^admin/', include(admin.site.urls)),
|
2013-02-19 16:39:50 +00:00
|
|
|
(r'^api/upload/text/?$', 'text.views.upload'),
|
2013-05-27 10:13:59 +00:00
|
|
|
(r'^api/upload/document/?$', 'document.views.upload'),
|
2013-03-26 11:54:03 +00:00
|
|
|
(r'^api/upload/direct/?$', 'archive.views.direct_upload'),
|
2012-03-17 00:15:06 +00:00
|
|
|
(r'^api/upload/?$', 'archive.views.firefogg_upload'),
|
2011-09-29 15:16:48 +00:00
|
|
|
(r'^url=(?P<url>.*)$', 'app.views.redirect_url'),
|
2010-09-14 14:10:37 +00:00
|
|
|
(r'^file/(?P<oshash>.*)$', 'archive.views.lookup_file'),
|
2012-01-03 20:18:47 +00:00
|
|
|
(r'^api/?$', include(ox.django.api.urls)),
|
2011-10-21 18:36:21 +00:00
|
|
|
(r'^resetUI$', 'user.views.reset_ui'),
|
2014-02-02 06:30:58 +00:00
|
|
|
(r'^documents/(?P<id>[A-Z0-9]+)/(?P<size>\d*)p(?P<page>\d*).jpg$', 'document.views.thumbnail'),
|
2013-12-23 12:19:11 +00:00
|
|
|
(r'^documents/(?P<id>[A-Z0-9]+)/(?P<name>.*?\..+)$', 'document.views.file'),
|
2013-05-27 20:06:56 +00:00
|
|
|
(r'^edit/(?P<id>.*?)/icon(?P<size>\d*).jpg$', 'edit.views.icon'),
|
2011-09-29 13:05:34 +00:00
|
|
|
(r'^list/(?P<id>.*?)/icon(?P<size>\d*).jpg$', 'itemlist.views.icon'),
|
2013-02-16 01:20:40 +00:00
|
|
|
(r'^text/(?P<id>.*?)/icon(?P<size>\d*).jpg$', 'text.views.icon'),
|
2013-02-21 14:09:23 +00:00
|
|
|
(r'^texts/(?P<id>.*?)/text.pdf$', 'text.views.pdf'),
|
|
|
|
(r'^texts/(?P<id>.*?)/text.pdf.html$', 'text.views.pdf_viewer'),
|
2014-01-17 18:24:34 +00:00
|
|
|
(r'^texts/$', 'text.views.text'),
|
|
|
|
(r'^texts/(?P<id>.*?)/\d+$', 'text.views.text'),
|
2014-01-16 11:01:31 +00:00
|
|
|
(r'^texts/(?P<id>.*?)$', 'text.views.text'),
|
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'}),
|
2011-12-30 10:30:49 +00:00
|
|
|
(r'^opensearch.xml$', 'app.views.opensearch_xml'),
|
2012-01-10 16:00:41 +00:00
|
|
|
(r'^oembed$', 'item.views.oembed'),
|
2012-01-16 08:18:39 +00:00
|
|
|
(r'^atom.xml$', 'item.views.atom_xml'),
|
2012-01-11 07:42:32 +00:00
|
|
|
(r'^robots.txt$', 'app.views.robots_txt'),
|
2012-01-11 07:51:26 +00:00
|
|
|
(r'^sitemap.xml$', 'item.views.sitemap_xml'),
|
2011-12-30 10:30:49 +00:00
|
|
|
(r'', include('item.urls')),
|
2009-06-08 16:08:59 +00:00
|
|
|
)
|
2011-11-03 12:02:12 +00:00
|
|
|
#if settings.DEBUG:
|
|
|
|
#sould this not be enabled by default? nginx should handle those
|
|
|
|
urlpatterns += patterns('',
|
|
|
|
(r'^data/(?P<path>.*)$', 'django.views.static.serve',
|
|
|
|
{'document_root': settings.MEDIA_ROOT}),
|
|
|
|
(r'^static/(?P<path>.*)$', 'django.views.static.serve',
|
|
|
|
{'document_root': settings.STATIC_ROOT}),
|
|
|
|
)
|
2011-01-04 06:03:00 +00:00
|
|
|
|
2011-02-22 16:52:03 +00:00
|
|
|
urlpatterns += patterns('',
|
2013-09-11 16:38:30 +00:00
|
|
|
(r'^(V[a-z0-9]+)$', 'urlalias.views.padma_video'),
|
|
|
|
(r'^(V[a-z0-9]+/.*)$', 'urlalias.views.padma_video'),
|
2012-02-14 09:07:47 +00:00
|
|
|
(r'^find$', 'urlalias.views.padma_find'),
|
2011-02-22 16:52:03 +00:00
|
|
|
)
|
2010-11-29 01:08:21 +00:00
|
|
|
urlpatterns += patterns('',
|
2013-12-23 12:19:11 +00:00
|
|
|
(r'^(?P<id>[A-Z0-9]+)/embed', 'app.views.embed'),
|
2014-01-11 09:02:37 +00:00
|
|
|
(r'^(?P<id>[A-Z0-9]+).*', 'item.views.item'),
|
2011-01-21 19:10:42 +00:00
|
|
|
(r'^[a-z0-9].+$', 'app.views.index'),
|
2010-11-30 23:40:31 +00:00
|
|
|
(r'^$', 'app.views.index'),
|
2011-09-23 10:44:54 +00:00
|
|
|
(r'^.*$', 'app.views.index'),
|
2010-11-29 01:08:21 +00:00
|
|
|
)
|
2009-08-16 12:23:29 +00:00
|
|
|
|