from __future__ import unicode_literals
-from django.conf.urls import patterns, url
+from django.conf.urls import url
+from cas_provider import views
-urlpatterns = patterns('cas_provider.views',
- url(r'^login/merge/', 'login', {'merge': True, 'template_name': 'cas/merge.html'}),
- url(r'^login/?$', 'login', name='cas_login'),
- url(r'^socialauth-login/$', 'login', name='cas_socialauth_login'),
- url(r'^validate/?$', 'validate', name='cas_validate'),
- url(r'^proxy/?$', 'proxy', name='proxy'),
- url(r'^serviceValidate/?$', 'service_validate', name='cas_service_validate'),
- url(r'^proxyValidate/?$', 'proxy_validate', name='cas_proxy_validate'),
- url(r'^logout/?$', 'logout', name='cas_logout'),
-)
+urlpatterns = [
+ url(r'^login/merge/', views.login, {'merge': True, 'template_name': 'cas/merge.html'}),
+ url(r'^login/?$', views.login, name='cas_login'),
+ url(r'^socialauth-login/$', views.login, name='cas_socialauth_login'),
+ url(r'^validate/?$', views.validate, name='cas_validate'),
+ url(r'^proxy/?$', views.proxy, name='proxy'),
+ url(r'^serviceValidate/?$', views.service_validate, name='cas_service_validate'),
+ url(r'^proxyValidate/?$', views.proxy_validate, name='cas_proxy_validate'),
+ url(r'^logout/?$', views.logout, name='cas_logout'),
+]
from django.conf import settings
from django.contrib.auth import login as auth_login, logout as auth_logout
from django.core.urlresolvers import get_callable
-from django.shortcuts import render_to_response
+from django.shortcuts import render
from django.utils.translation import ugettext as _
from django.template import RequestContext
from django.contrib.auth import authenticate
return HttpResponseRedirect(success_redirect)
else:
if request.GET.get('warn', False):
- return render_to_response(warn_template_name, {
+ return render(request, warn_template_name, {
'service': service,
'warn': False
- }, context_instance=RequestContext(request))
+ })
# Create a service ticket and redirect to the service.
ticket = ServiceTicket.objects.create(service=service, user=user)
return HttpResponseRedirect(url)
logging.debug('Rendering response on %s, merge is %s', template_name, merge)
- return render_to_response(template_name, {'form': form, 'errors': errors}, context_instance=RequestContext(request))
+ return render(request, template_name, {'form': form, 'errors': errors})
@never_cache
auth_logout(request)
if url and auto_redirect:
return HttpResponseRedirect(url)
- return render_to_response(template_name, {'url': url},
- context_instance=RequestContext(request))
+ return render(request, template_name, {'url': url})
@never_cache
from __future__ import unicode_literals
-from django.conf.urls import patterns, include, url
+from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
-urlpatterns = patterns('',
+urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
- url(r'^', include('cas_provider.urls')),
- url(r'^accounts/profile', TemplateView.as_view(template_name='login-success-redirect-target.html')),
-
- )
+ url(r'^', include('cas_provider.urls')),
+ url(r'^accounts/profile', TemplateView.as_view(template_name='login-success-redirect-target.html')),
+]
[tox]
envlist=clear,
d1{5,6}-py{26,27,32,33},
- d{17,d}-py{27,32,33,34},
+ d{17,18,d}-py{27,32,33,34},
stats
[testenv]
d15: Django>=1.5,<1.6
d16: Django>=1.6,<1.7
d17: Django>=1.7,<1.8
+ d18: https://www.djangoproject.com/download/1.8b2/tarball/
dd: https://github.com/django/django/zipball/master
d15,d16: https://bitbucket.org/andrewgodwin/south/get/e2c9102ee033.zip
coverage