Coverage for lino/core/urls.py : 82%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# Copyright 2009-2015 Luc Saffre # License: BSD (see file COPYING for details)
As an application developer you don't need to worry about this.
This is found by Django because :mod:`lino.projects.std.settings` :setting:`ROOT_URLCONF` is set to :mod:`lino.core.urls`.
"""
# from lino.core.signals import database_ready
# we must explicitly call django.setup() because when running under # mod_wsgi this is not done automatically as with runserver (or at # least it seems so)
# database_ready.send(site)
else: prefix = ''
else:
from django.contrib import admin admin.autodiscover() urlpatterns.append(url( rx + site.django_admin_prefix[1:] + "/", include(admin.site.urls)))
#~ logger.info("20130409 is_devserver() returns %s.",is_devserver()) # from django.contrib.staticfiles.views import serve # opts = {'document_root': settings.MEDIA_ROOT, # 'show_indexes': False} # pat = r'^%s(?P<path>.*)$' % prefix urlpatterns += static( settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # 'django.views.static', (pat, 'serve', opts))
# why do i need the following? i thought that this is done # automatically: # urlpatterns += static( # settings.STATIC_URL, document_root=settings.STATIC_ROOT) # logger.info("20150426 serve static %s -> %s", # settings.STATIC_URL, settings.STATIC_ROOT)
# pat = r'^{0}(?P<path>.*)$'.format(settings.STATIC_URL[1:]) # urlpatterns.append(url(pat, serve)) |