Permalink
Browse files

upgrade to django-browserid 0.9, r=willkg

  • Loading branch information...
1 parent 824c1a2 commit b067884a7a5747c614752f0f5ad2bbdf0c5d2d25 @peterbe peterbe committed Sep 23, 2013
@@ -22,7 +22,7 @@
{% block site_js %}
{% compress js %}
- <script src="{{ static('examples/js/libs/jquery-1.4.4.min.js') }}"></script>
+ <script src="{{ static('examples/js/libs/jquery-1.10.2.min.js') }}"></script>
<script src="{{ static('examples/js/libs/jquery.cookie.js') }}"></script>
<script src="{{ static('examples/js/init.js') }}"></script>
{% endcompress %}
Oops, something went wrong.
Oops, something went wrong.
@@ -1,19 +1,17 @@
{% extends "example_base.html" %}
{% block content %}
+{{ browserid_info() }}
+
<h1>
<a href="/">{{ _('Hello world') }}</a>
</h1>
{% if request.user.is_active %}
- <p>{{ _('You are logged in as {username}')|f(username=request.user) }}.
- <a href="{{ url('examples.logout') }}">{{ _('Log out') }}</a></p>
+ <p>{{ _('You are logged in as {username}')|f(username=request.user) }}.</p>
+ {{ browserid_logout(text='Logout') }}
{% else %}
- <p><a id="browserid" href="#">{{ _('Log in with BrowserID') }}</a></p>
- <form method="POST" action="{{ url('browserid_verify') }}">
- {{ csrf() }}
- {{ browserid_form.as_p() }}
- </form>
+ {{ browserid_login(text='Login', color='dark') }}
{% endif %}
{# L10n: This is a localizer comment #}
@@ -40,12 +38,6 @@
</ul>
{% endblock %}
{% block site_js %}
- {% compress js %}
- <script src="{{ static('examples/js/libs/jquery-1.4.4.min.js') }}"></script>
- <script src="{{ static('examples/js/libs/jquery.cookie.js') }}"></script>
- <script src="{{ static('examples/js/init.js') }}"></script>
- {% endcompress %}
- {% if not request.user.is_active %}
- {{ browserid_form.media }}
- {% endif %}
+ {{ super() }}
+ {{ browserid_js() }}
{% endblock %}
@@ -31,25 +31,26 @@
# Because Jinja2 is the default template loader, add any non-Jinja templated
# apps here:
-JINGO_EXCLUDE_APPS = [
+JINGO_EXCLUDE_APPS = (
'admin',
'registration',
-]
+ 'browserid',
+)
# BrowserID configuration
-AUTHENTICATION_BACKENDS = [
- 'django_browserid.auth.BrowserIDBackend',
+AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
-]
+ 'django_browserid.auth.BrowserIDBackend',
+)
-SITE_URL = 'http://127.0.0.1:8000'
+SITE_URL = 'http://localhost:8000'
LOGIN_URL = '/'
-LOGIN_REDIRECT_URL = 'examples.home'
-LOGIN_REDIRECT_URL_FAILURE = 'examples.home'
+LOGIN_REDIRECT_URL = '/'
+LOGIN_REDIRECT_URL_FAILURE = '/'
-TEMPLATE_CONTEXT_PROCESSORS = list(TEMPLATE_CONTEXT_PROCESSORS) + [
- 'django_browserid.context_processors.browserid_form',
-]
+TEMPLATE_CONTEXT_PROCESSORS += (
+ 'django_browserid.context_processors.browserid',
+)
# Should robots.txt deny everything or disallow a calculated list of URLs we
# don't want to be crawled? Default is false, disallow everything.
@@ -83,4 +84,15 @@
# ('media/js/**.js', 'javascript'),
# ]
-LOGGING = dict(loggers=dict(playdoh = {'level': logging.DEBUG}))
+LOGGING = {
+ 'loggers': {
+ 'playdoh': {
+ 'handlers': ['console'],
+ 'level': 'DEBUG',
+ },
+ 'django_browserid': {
+ 'handlers': ['console'],
+ 'level': 'DEBUG',
+ }
+ }
+}
View
@@ -14,9 +14,10 @@
urlpatterns = patterns('',
# Example:
(r'', include(urls)),
-
+ (r'^browserid/', include('django_browserid.urls')),
+
# Generate a robots.txt
- (r'^robots\.txt$',
+ (r'^robots\.txt$',
lambda r: HttpResponse(
"User-agent: *\n%s: /" % 'Allow' if settings.ENGAGE_ROBOTS else 'Disallow' ,
mimetype="text/plain"
Submodule vendor updated 30 files
+4 −2 lib/python/django_browserid/__init__.py
+61 −57 lib/python/django_browserid/auth.py
+150 −92 lib/python/django_browserid/base.py
+18 −8 lib/python/django_browserid/context_processors.py
+26 −6 lib/python/django_browserid/forms.py
+187 −0 lib/python/django_browserid/helpers.py
+11 −10 lib/python/django_browserid/signals.py
+127 −9 lib/python/django_browserid/static/browserid/browserid.js
+228 −0 lib/python/django_browserid/static/browserid/persona-buttons.css
+3 −0 lib/python/django_browserid/templates/browserid/button.html
+12 −0 lib/python/django_browserid/templates/browserid/info.html
+0 −0 lib/python/django_browserid/templatetags/__init__.py
+30 −0 lib/python/django_browserid/templatetags/browserid.py
+47 −8 lib/python/django_browserid/tests/__init__.py
+21 −0 lib/python/django_browserid/tests/models.py
+10 −7 lib/python/django_browserid/tests/settings.py
+124 −42 lib/python/django_browserid/tests/test_auth.py
+144 −0 lib/python/django_browserid/tests/test_base.py
+15 −0 lib/python/django_browserid/tests/test_forms.py
+155 −0 lib/python/django_browserid/tests/test_helpers.py
+28 −0 lib/python/django_browserid/tests/test_urls.py
+71 −0 lib/python/django_browserid/tests/test_util.py
+113 −56 lib/python/django_browserid/tests/test_views.py
+8 −6 lib/python/django_browserid/tests/urls.py
+27 −9 lib/python/django_browserid/urls.py
+66 −0 lib/python/django_browserid/util.py
+118 −37 lib/python/django_browserid/views.py
+116 −0 lib/python/fancy_tag/__init__.py
+577 −0 lib/python/six.py
+1 −1 src/funfactory

0 comments on commit b067884

Please sign in to comment.