Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing the login and logout views needed by persona
- Loading branch information
Showing
4 changed files
with
52 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from django.conf.urls import patterns, url | ||
from django.views.decorators.csrf import csrf_exempt | ||
from django.views.decorators.csrf import csrf_exempt | ||
from browserid import views | ||
|
||
urlpatterns = patterns('', | ||
url(r'^status/?$', csrf_exempt(views.StatusView.as_view())) | ||
) | ||
url(r'^status/?$', csrf_exempt(views.StatusView.as_view()), name='status'), | ||
url(r'^login/?$', csrf_exempt(views.LoginView.as_view()), name='login'), | ||
url(r'^logout/?$', 'django.contrib.auth.views.logout', name='logout') | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
from django.views.generic.base import TemplateView | ||
|
||
from django.core.urlresolvers import reverse | ||
|
||
class IndexView(TemplateView): | ||
template_name = 'index.html' | ||
template_name = 'index.html' | ||
|
||
def get_context_data(self, **kwargs): | ||
context = super().get_context_data(**kwargs) | ||
context['login_url'] = reverse('login') | ||
context['logout_url'] = reverse('logout') | ||
context['status_url'] = reverse('status') | ||
return context |