urls.py 1.2 KB

123456789101112131415161718192021222324252627282930
  1. from django.conf import settings
  2. from django.conf.urls import patterns, include, url
  3. # Setup Django admin to work with Misago auth
  4. from django.contrib import admin
  5. from misago.users.forms.auth import AdminAuthenticationForm
  6. admin.autodiscover()
  7. admin.site.login_form = AdminAuthenticationForm
  8. urlpatterns = patterns('',
  9. url(r'^', include('misago.urls', namespace='misago')),
  10. # Uncomment next line if you plan to use Django admin for 3rd party apps
  11. #url(r'^django-admin/', include(admin.site.urls)),
  12. )
  13. # Serve static and media files in development
  14. from django.conf.urls.static import static
  15. urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
  16. urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  17. # Error Handlers
  18. # Misago needs those handlers to deal with errors raised by it's middlewares
  19. # If you replace those handlers with custom ones, make sure you decorate them
  20. # functions with shared_403_exception_handler or shared_404_exception_handler
  21. # decorators that are defined in misago.views.errorpages module!
  22. handler403 = 'misago.views.errorpages.permission_denied'
  23. handler404 = 'misago.views.errorpages.page_not_found'