Skip to content

Commit

Permalink
Add Persona support.
Browse files Browse the repository at this point in the history
  • Loading branch information
ubernostrum committed Sep 4, 2013
1 parent 8df289d commit 16eaa1f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
1 change: 1 addition & 0 deletions b_list/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ django-contact-form
django-flashpolicies
-e hg+https://bitbucket.org/ubernostrum/blog#egg=blog
-e git+https://github.com/ubernostrum/typogrify.git#egg=typogrify
-e git+https://github.com/ubernostrum/django-browserid.git#egg=django_browserid
Markdown
Pygments
smartypants
Expand Down
15 changes: 15 additions & 0 deletions b_list/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,25 @@
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.flatpages',
'django_browserid',
'blog',
'contact_form',
'typogrify',
'gunicorn',
)

AUTHENTICATION_BACKENDS = (
'django_browserid.auth.BrowserIDBackend',
)

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.tz",
"django.contrib.messages.context_processors.messages",
'django_browserid.context_processors.browserid',
)

from .local_settings import *
13 changes: 11 additions & 2 deletions b_list/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@

<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="microid" content="d0714f36c065c0c9bd5c0797f690714f050715bc">

<link rel="stylesheet" href="http://media.b-list.org/css/b-list-20130826.css" type="text/css">
<link rel="stylesheet" href="http://media.b-list.org/s/css/b-list-20130903.css" type="text/css">

{% block extrahead %}{% endblock %}

Expand All @@ -30,8 +29,18 @@
{% block content %}{% endblock %}
</div>
<div id="footer">
{% load browserid %}
{% browserid_info %}
<p><a href="/about/copyright/">Copyright &copy;</a> 2006-{% now "Y" %} <a href="/about/">James Bennett</a>. All rights reserved. Opinions expressed here are solely those of the author(s).</p>
<p class="authentication">{% if user.is_authenticated %}Logged in as {{ user }} / {% browserid_logout text='Logout' %}{% else %}{% browserid_login text='Login' color='dark' %}{% endif %}</p>
</div>

{# django-browserid JS includes #}
<script src="http://media.b-list.org/s/js/jquery-1.9.1.min.js"></script>
<script src="https://login.persona.org/include.js"></script>
<script src="http://media.b-list.org/s/js/browserid.js"></script>

{# Stats #}
<script type="text/javascript" src="http://include.reinvigorate.net/re_.js"></script>
<script type="text/javascript">
try {
Expand Down
1 change: 1 addition & 0 deletions b_list/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

urls = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^browserid/', include('django_browserid.urls')),
url(r'^$',
EntryArchiveIndex.as_view(
template_name='home.html',
Expand Down

0 comments on commit 16eaa1f

Please sign in to comment.