source: src/django_gheat/urls.py@ 10615

Last change on this file since 10615 was 9749, checked in by rick, 13 years ago

Some awefull quirks to avoid uploading files without authentication.

File size: 1.4 KB
RevLine 
[9139]1from django.conf.urls.defaults import *
2from django.contrib.staticfiles.urls import staticfiles_urlpatterns
[9397]3from django.views.decorators.cache import cache_page
4from django.views.generic.simple import redirect_to, direct_to_template
[9139]5
6# Uncomment the next two lines to enable the admin:
7from django.contrib import admin
[9388]8from django.conf import settings
[9139]9admin.autodiscover()
10
[9386]11
[9139]12urlpatterns = patterns('',
13 # Example:
[9397]14 (r'^robots.txt$', cache_page(60 * 15)(direct_to_template), {'template' : 'robots.txt', 'mimetype' : 'text/plain'}),
[9376]15 (r'^$', redirect_to, { 'url' : 'wlheatmap/', 'permanent' : False }),
16 (r'^wlheatmap/', include('wlheatmap.urls')),
[9139]17 (r'^gheat/', include('gheat.urls')),
18 (r'^admin/', include(admin.site.urls)),
[9749]19 (r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}),
20 (r'^accounts/logout/$', 'django.contrib.auth.views.logout', { 'template_name': 'logout.html'}),
[9139]21)
[9358]22
[9376]23urlpatterns += patterns('wlheatmap.osm_proxy',
[9358]24 url(
25 # Example : today/fire/12/3,2.png
[9547]26 regex = r'^osm-proxy/(?P<zoom>\d+)/(?P<x>\d+)[,/](?P<y>\d+).png$',
[9358]27 view = 'osm_proxy',
28 name = 'osm_proxy',
29 ),
30 )
31
[9633]32
[9388]33if settings.DEBUG:
[9386]34 urlpatterns += staticfiles_urlpatterns()
[9633]35 urlpatterns += patterns('',
36 url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
37 'document_root': settings.MEDIA_ROOT,
38 }))
Note: See TracBrowser for help on using the repository browser.