detect logged in users on the home page (mostly debugging social auth)
This commit is contained in:
parent
28c6241553
commit
603c29c8b4
2 changed files with 5 additions and 1 deletions
|
@ -15,8 +15,12 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="span8 offset2">
|
<div class="span8 offset2">
|
||||||
<div class="hero-unit">
|
<div class="hero-unit">
|
||||||
|
{% if request.user.is_authenticated %}
|
||||||
|
<p>Welcome back, {{ request.user.username }}</p>
|
||||||
|
{% else %}
|
||||||
<a class="btn btn-large btn-primary" href="{% url login %}">Login with
|
<a class="btn btn-large btn-primary" href="{% url login %}">Login with
|
||||||
GitHub</a>
|
GitHub</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
2
views.py
2
views.py
|
@ -12,7 +12,7 @@ def index(request):
|
||||||
# Set a test cookie. When the user clicks the 'Login' button, test and make
|
# Set a test cookie. When the user clicks the 'Login' button, test and make
|
||||||
# sure this cookie was set properly.
|
# sure this cookie was set properly.
|
||||||
request.session.set_test_cookie()
|
request.session.set_test_cookie()
|
||||||
return render_to_response('login.html')
|
return render_to_response('login.html', RequestContext(request))
|
||||||
|
|
||||||
|
|
||||||
def login(request):
|
def login(request):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue