2016-06-07 20:59:13 +00:00
|
|
|
"""ponyconf URL Configuration
|
|
|
|
|
|
|
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
|
|
https://docs.djangoproject.com/en/1.9/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. Import the include() function: from django.conf.urls import url, include
|
|
|
|
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
|
|
|
|
"""
|
2016-06-11 13:47:08 +00:00
|
|
|
from django.conf.urls import include, url
|
2016-06-07 20:59:13 +00:00
|
|
|
from django.contrib import admin
|
2017-07-31 21:20:16 +00:00
|
|
|
from django.contrib.auth.views import LoginView
|
|
|
|
from django.contrib.auth.forms import AuthenticationForm
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
2017-08-02 18:50:25 +00:00
|
|
|
from django.conf import settings
|
2017-07-31 21:20:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
class EmailAuthenticationForm(AuthenticationForm):
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
self.fields['username'].label = _('Email address')
|
|
|
|
|
|
|
|
|
|
|
|
class EmailLoginView(LoginView):
|
|
|
|
authentication_form = EmailAuthenticationForm
|
2017-05-30 19:50:40 +00:00
|
|
|
|
2016-06-07 20:59:13 +00:00
|
|
|
|
|
|
|
urlpatterns = [
|
|
|
|
url(r'^admin/', admin.site.urls),
|
2017-07-31 21:20:16 +00:00
|
|
|
url(r'accounts/login/', EmailLoginView.as_view()),
|
2017-07-30 19:52:14 +00:00
|
|
|
url(r'accounts/', include('django.contrib.auth.urls')),
|
2017-07-30 14:57:38 +00:00
|
|
|
url(r'^', include('cfp.urls')),
|
2017-07-30 19:52:14 +00:00
|
|
|
]
|
2017-08-02 18:50:25 +00:00
|
|
|
|
|
|
|
if settings.DEBUG and 'debug_toolbar' in settings.INSTALLED_APPS:
|
|
|
|
import debug_toolbar
|
|
|
|
urlpatterns += [
|
|
|
|
url(r'^__debug__/', include(debug_toolbar.urls)),
|
|
|
|
]
|