-i https://py.mdrn.pl:8443/simple
-Django>=1.7,<1.8
+Django>=1.8,<1.9
lxml>=2.2
django-gravatar2
Pillow
--e git+https://github.com/rczajka/django-cas-provider.git@979cc8e80c887caa8a91a86dd2ed2971bfe2bff5#egg=django-cas-provider
+-e git+https://github.com/rczajka/django-cas-provider.git@f3c49c09dc7b2a7ccee36b897b9056a9622e0c02#egg=django-cas-provider
<img src="{% gravatar_url request.user.email 120 %}"
alt="Gravatar"
title="{% trans 'Change at Gravatar.com' %}">
- <p><a href="{% url 'cas_provider.views.logout' %}">{% trans "Logout" %}</a></p>
+ <p><a href="{% url 'cas_logout' %}">{% trans "Logout" %}</a></p>
</aside>
<div id="details">
# -*- coding: utf-8 -*-
-from django.conf.urls import patterns, url
+from django.conf.urls import url
+from . import views
-urlpatterns = patterns('accounts.views',
- url(r'^$', 'account_profile'),
- url(r'^change_profile$', 'account_change_basic_profile'),
- url(r'^change_password$', 'account_change_password'),
-)
+urlpatterns = [
+ url(r'^$', views.account_profile),
+ url(r'^change_profile$', views.account_change_basic_profile),
+ url(r'^change_password$', views.account_change_password),
+]
# Create your views here.
from django import http
from django.contrib.auth.decorators import login_required
+from django.contrib.auth import update_session_auth_hash
from django.contrib import messages
from django.shortcuts import render
from django.utils.translation import ugettext as _
if form.is_valid():
request.user.set_password(form.cleaned_data['new_password'])
request.user.save()
+ update_session_auth_hash(request, request.user)
messages.add_message(request, messages.INFO, _("Password has been changed."))
return http.HttpResponseRedirect('/accounts/')
PROJECT_ROOT = path.realpath(path.dirname(__file__))
DEBUG = True
-TEMPLATE_DEBUG = DEBUG
ADMINS = [
]
ROOT_URLCONF = 'cas.urls'
-TEMPLATE_DIRS = (
- PROJECT_ROOT + '/templates',
-)
+TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'APP_DIRS': True,
+ 'DIRS': [
+ PROJECT_ROOT + '/templates',
+ ],
+ 'OPTIONS': {
+ 'context_processors': [
+ "django.contrib.auth.context_processors.auth",
+ "django.template.context_processors.debug",
+ "django.template.context_processors.i18n",
+ "django.template.context_processors.media",
+ "django.template.context_processors.static",
+ "django.template.context_processors.tz",
+ "django.contrib.messages.context_processors.messages",
+ "django.template.context_processors.request",
+ ],
+ 'debug': DEBUG,
+ },
+ },
+]
LOCALE_PATHS = (
PROJECT_ROOT + '/locale',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
-TEMPLATE_CONTEXT_PROCESSORS = (
- "django.contrib.auth.context_processors.auth",
- "django.core.context_processors.debug",
- "django.core.context_processors.i18n",
- "django.core.context_processors.media",
- "django.core.context_processors.static",
- "django.core.context_processors.tz",
- "django.contrib.messages.context_processors.messages",
- "django.core.context_processors.request",
-)
-
# django-cas-provider settings
LOGIN_URL = '/cas/login/'
LOGOUT_URL = '/cas/logout/'
# -*- coding: utf-8 -*-
-from django.conf.urls import include, patterns, url
+from django.conf.urls import include, url
from django.views.generic import RedirectView
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
-urlpatterns = patterns('',
- url(r'^$', RedirectView.as_view(url='/accounts/')),
+urlpatterns = [
+ url(r'^$', RedirectView.as_view(url='/accounts/', permanent=False)),
# django-cas-provider
url(r'^cas/', include('cas_provider.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('accounts.urls')),
-)
+]
if settings.DEBUG:
- urlpatterns += patterns('',
- url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
+ from django.views.static import serve
+ urlpatterns += [
+ url(r'^media/(?P<path>.*)$', serve, {
'document_root': settings.MEDIA_ROOT,
}),
- )
+ ]