diff --git a/fig.yml b/fig.yml index 0eadd8e..c675b75 100644 --- a/fig.yml +++ b/fig.yml @@ -12,7 +12,8 @@ web: - PYTHONDONTWRITEBYTECODE=1 - DATABASE_URL=postgres://postgres@db/postgres - DEBUG=True - - ALLOWED_HOSTS=localhost,127.0.0.1, + - ALLOWED_HOSTS=localhost,127.0.0.1 + - BROWSERID_AUDIENCES='http://127.0.0.1:8000' - SECRET_KEY=59114b6a-2858-4caf-8878-482a24ee9542 command: ./bin/run-fig.sh diff --git a/marketpulse/auth/urls.py b/marketpulse/auth/urls.py new file mode 100644 index 0000000..cb5fcbd --- /dev/null +++ b/marketpulse/auth/urls.py @@ -0,0 +1,7 @@ +from django.conf.urls import patterns, include, url + + +urlpatterns = patterns( + '', + url(r'', include('django_browserid.urls')) +) diff --git a/marketpulse/base/templates/base.html b/marketpulse/base/templates/base.html index f7035dd..21e0161 100644 --- a/marketpulse/base/templates/base.html +++ b/marketpulse/base/templates/base.html @@ -15,8 +15,9 @@ - - + + + {{ browserid_css() }} {% block css %} {% endblock %} @@ -33,6 +34,13 @@ + {{ browserid_info() }} + {% if user.is_authenticated() %} +

Current user: {{ user.email }}

+ {{ browserid_logout(text='Logout') }} + {% else %} + {{ browserid_login(text='Login', color='dark') }} + {% endif %}
@@ -74,7 +82,9 @@