Last active
December 16, 2015 06:29
-
-
Save guillaumepiot/5392008 to your computer and use it in GitHub Desktop.
DJANGO - CMS Base - Default URLs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The `urlpatterns` list routes URLs to views. For more information please see: | |
https://docs.djangoproject.com/en/1.8/topics/http/urls/ | |
Examples: | |
Function views | |
1. Add an import: from my_app import views | |
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') | |
Class-based views | |
1. Add an import: from other_app.views import Home | |
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') | |
Including another URLconf | |
1. Add an import: from blog import urls as blog_urls | |
2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) | |
""" | |
from django.conf.urls import include, url | |
from django.conf.urls.i18n import i18n_patterns | |
from django.contrib import admin | |
from django.conf import settings | |
# | |
# Non-localised urls | |
# | |
urlpatterns = [ | |
# Password reset features | |
url(r'^admin/password_reset/$', 'django.contrib.auth.views.password_reset', name='admin_password_reset'), | |
url(r'^admin/password_reset/done/$', 'django.contrib.auth.views.password_reset_done', name='password_reset_done'), | |
url(r'^reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm', name="password_reset_confirm"), | |
url(r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete', name="password_reset_complete"), | |
# Admin | |
url(r'^admin/i18n/', include('django.conf.urls.i18n')), | |
url(r'^admin/', include(admin.site.urls)), | |
url(r'^uploads/', include('filemanager.urls')), | |
] | |
# | |
# Locale url supported | |
# | |
urlpatterns += i18n_patterns( | |
# CMS | |
url(r'^', include('cmsbase.urls', namespace='cms')), | |
) | |
if settings.DEBUG: | |
urlpatterns = [ | |
url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), | |
] + urlpatterns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment