Skip to content

Instantly share code, notes, and snippets.

@byroncorrales
Created August 18, 2009 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save byroncorrales/169747 to your computer and use it in GitHub Desktop.
Save byroncorrales/169747 to your computer and use it in GitHub Desktop.
from django.conf.urls.defaults import *
from os import path as os_path
from django.conf import settings
from mapa.models import Mapa
from mapa.views import lista_mapa
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('mapa.views',
# Example:
# (r'^mapamagfor/', include('mapamagfor.foo.urls')),
# 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:
# (r'^admin/', include(admin.site.urls)),
(r'^mapa/lista/tipo/(?P<t>[^/]+)', 'lista_mapa'),
(r'^mapa/lista/region/(?P<r>[^/]+)', 'lista_mapa_region'),
(r'^mapa/$', 'index_mapa'),
(r'^admin/(.*)', admin.site.root),
)
if settings.DEBUG:
urlpatterns += patterns('',
#(r'^media/(.*)$', 'django.views.static.serve',
# {'document_root': os_path.join(settings.MEDIA_ROOT + '')}),
# (r'^attachment/(.*)$', 'django.views.static.serve',
# {'document_root': os_path.join(settings.MEDIA_ROOT + '/attachment')}),
(r'^attachment/(.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT + '/attachment'}),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment