symposion_app/pinaxcon/urls.py
James Polley 37fb435e18 Add devmode_settings.py for local dev
* Adds an env variable to .env to turn on dev mode
* Uses the inbuilt django auth rather than saml when in dev mode
* For laziness, re-uses the admin login form for the non-admin login

make_dev_container now comes up ready to be logged into by any
user. No non-admin users are preconfigured; but you can add one at
http://localhost:28000/admin/auth/user/add/, log out, and then hit
http://localhost:28000/ to log in as the new user.
2017-08-28 17:12:05 +10:00

41 lines
1.4 KiB
Python

from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.views.generic import RedirectView
from django.views.generic import TemplateView
from django.contrib import admin
import symposion.views
urlpatterns = [
url(r'^saml2/', include('djangosaml2.urls')),
url(r"^admin/", include(admin.site.urls)),
url(r"^speaker/", include("symposion.speakers.urls")),
url(r"^proposals/", include("symposion.proposals.urls")),
url(r"^reviews/", include("symposion.reviews.urls")),
url(r"^schedule/", include("symposion.schedule.urls")),
url(r"^teams/", include("symposion.teams.urls")),
# Required by registrasion
url(r'^tickets/payments/', include('registripe.urls')),
url(r'^tickets/', include('registrasion.urls')),
url(r'^nested_admin/', include('nested_admin.urls')),
url(r'^dashboard/', RedirectView.as_view(url='/')),
url(r'^$', symposion.views.dashboard, name="dashboard"),
]
if settings.DEBUG:
import debug_toolbar
urlpatterns.insert(0, url(r'^__debug__/', include(debug_toolbar.urls)))
if settings.DEV_MODE:
from django.contrib.auth.views import login, logout
urlpatterns.insert(0, url(r'^accounts/logout', logout, {'template_name': 'admin/logout.html'}))
urlpatterns.insert(0, url(r'^accounts/login', login, {'template_name': 'admin/login.html'}))
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)