Пример #1
0
 def handle_noargs(self, **options):
     print 'Starting metatags synchronisation with all registered models.'
     extradmin.autodiscover()
     for model, metatags in metatags.site._registry.items():
         print 'Syncing %s.%s model.' % (model._meta.app_label, model.__name__)
         self.sync_metatags(model, metatags)
     print 'All objects with `get_absolute_url` method was synced.',
     print 'Removing orphaned metatags.'
     self.remove_orphaned()
     print 'Done.'
Пример #2
0
from django.conf import settings
from django.conf.urls.defaults import include, patterns, url
from django.conf.urls.static import static

from lemon import extradmin


extradmin.autodiscover()
urlpatterns = patterns('',
    url(r'^admin/', include(extradmin.site.urls)),
    url(r'^tinymce/', include('tinymce.urls')),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Пример #3
0
from django.conf import settings
from django.conf.urls.defaults import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView

from lemon import extradmin
from lemon import metatags
from lemon import sitemaps


extradmin.autodiscover()
metatags.autodiscover()
sitemaps.autodiscover()

urlpatterns = patterns('',
    url(r'^admin/', include(extradmin.site.urls)),
)

if settings.DEBUG:
    urlpatterns += patterns('',
        url(r'^404$', TemplateView.as_view(template_name='404.html')),
        url(r'^500$', TemplateView.as_view(template_name='500.html')),
    )
    urlpatterns += staticfiles_urlpatterns()
    urlpatterns += patterns(
        '',
        url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root': settings.MEDIA_ROOT,
        }),
    )