Skip to content

Commit

Permalink
Update to Django 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaylorhq committed May 10, 2017
1 parent 8302841 commit 9b1cc96
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
12 changes: 6 additions & 6 deletions PyRIGS/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ def _checklogin(request, *args, **kwargs):
return view_func(request, *args, **kwargs)
elif not request.user.is_authenticated():
if oembed_view is not None:
extra_context = {}
extra_context['oembed_url'] = "{0}://{1}{2}".format(request.scheme, request.META['HTTP_HOST'], reverse(oembed_view, kwargs=kwargs))
extra_context['login_url'] = "{0}?{1}={2}".format(login_url, REDIRECT_FIELD_NAME, request.get_full_path())
resp = render_to_response('login_redirect.html', extra_context, context_instance=RequestContext(request))
context = RequestContext(request)
context['oembed_url'] = "{0}://{1}{2}".format(request.scheme, request.META['HTTP_HOST'], reverse(oembed_view, kwargs=kwargs))
context['login_url'] = "{0}?{1}={2}".format(login_url, REDIRECT_FIELD_NAME, request.get_full_path())
resp = render_to_response('login_redirect.html', context=context)
return resp
else:
return HttpResponseRedirect('%s?%s=%s' % (login_url, REDIRECT_FIELD_NAME, request.get_full_path()))
else:
resp = render_to_response('403.html', context_instance=RequestContext(request))
resp = render_to_response('403.html', context=RequestContext(request))
resp.status_code = 403
return resp
_checklogin.__doc__ = view_func.__doc__
Expand Down Expand Up @@ -62,7 +62,7 @@ def wrap(request, *args, **kwargs):
userid = kwargs.get('api_pk')
key = kwargs.get('api_key')

error_resp = render_to_response('403.html', context_instance=RequestContext(request))
error_resp = render_to_response('403.html', context=RequestContext(request))
error_resp.status_code = 403

if key is None:
Expand Down
3 changes: 3 additions & 0 deletions PyRIGS/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
if STAGING:
ALLOWED_HOSTS.append('.herokuapp.com')

if DEBUG:
ALLOWED_HOSTS.append('localhost')

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
if not DEBUG:
SECURE_SSL_REDIRECT = True # Redirect all http requests to https
Expand Down
2 changes: 1 addition & 1 deletion PyRIGS/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.conf.urls import patterns, include, url
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf import settings
Expand Down
2 changes: 1 addition & 1 deletion RIGS/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.conf.urls import patterns, include, url
from django.conf.urls import url
from django.contrib.auth.views import password_reset

from django.contrib.auth.decorators import login_required
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
beautifulsoup4==4.4.1
contextlib2==0.5.5
diff-match-patch==20121119
dj-database-url==0.4.0
dj-static==0.0.6
Django==1.9.4
Django==1.10.7
django-debug-toolbar==1.4
django-ical==1.3
django-recaptcha==1.0.5
Expand Down

0 comments on commit 9b1cc96

Please sign in to comment.