X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fema.git;a=blobdiff_plain;f=urls.py;h=89b385611e75d5342622fda8a25fca9b34b902a0;hp=03c46cdde750a21bb01f506293dc65bcf4fb41fd;hb=HEAD;hpb=4db04c533992a1c15f5908d5d09fd69150145683 diff --git a/urls.py b/urls.py index 03c46cd..89b3856 100644 --- a/urls.py +++ b/urls.py @@ -22,17 +22,21 @@ from diario.models import Entry from contents.models import Menu, Index from ema.views import get_entry_by_slug +from django.contrib import admin +admin.autodiscover() + + MEDIA = {'document_root': settings.INSTANCE('media')} # the only difference between info_dict and info_dict_full is that the # full version contains all entries and the other has just entries # without menus. -hasmenuorindex = [x.entry.id for x in Menu.objects.all()] -hasmenuorindex.extend([x.entry.id for x in Index.objects.all()]) +hasmenu = [x.entry.id for x in Menu.objects.all()] +inindex = [x.entry.id for x in Index.objects.all()] info_dict = { - 'queryset': Entry.published_on_site.exclude(id__in=hasmenuorindex), + 'queryset': Entry.published_on_site.exclude(id__in=hasmenu).filter(id__in=inindex), 'template_object_name': 'entry', 'extra_context': {'menus': Menu.objects.all()}, } @@ -44,7 +48,7 @@ info_dict_full = { } urlpatterns = patterns('', - (r'^admin/', include('django.contrib.admin.urls')), + (r'^admin/(.*)', admin.site.root), url(regex='^$', view='django.views.generic.list_detail.object_list', @@ -57,8 +61,8 @@ urlpatterns = patterns('', date_field='pub_date'), name='diario-entry'), - (r'^([-\w]+)/$', get_entry_by_slug), (r'^', include('ema.eventos.urls')), + (r'^([-\w]+)/$', get_entry_by_slug), # static media (r'^(?Pimgs/.*)$', 'django.views.static.serve', MEDIA),