Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

latest stuff

  • Loading branch information...
commit 4268bf260fd55d5652e8ee4a5898cb4c25252bb9 1 parent f73afe9
@davidwparker authored
Showing with 11 additions and 5 deletions.
  1. +10 −4 templates/base.html
  2. +1 −1  urls.py
View
14 templates/base.html
@@ -18,10 +18,16 @@
</div>
<ul class="navigation">
{% block navigation%}
- <li><a href="/">index</a></li>
- <li><a href="/admin/">admin</a></li>
- <li><a href="/accounts/login/">login</a></li>
- <li><a href="/accounts/logout/">logout</a></li>
+ <li><a href="/">index</a></li>
+ {% if user.is_superuser %}
+ <li><a href="/admin/">admin</a></li>
+ {% endif %}
+ {% if not user.is_authenticated %}
+ <li><a href="/accounts/login/">login</a></li>
+ {% else %}
+ <li><a href="/accounts/profile/">profile</a></li>
+ <li><a href="/accounts/logout/">logout</a></li>
+ {% endif %}
{% endblock %}
</ul>
<h1>{% block h1 %}{% endblock %}</h1>
View
2  urls.py
@@ -13,7 +13,7 @@
(r'^$', direct_to_template, {
'template': 'index.html'
}),
- (r'^admin/(.*)', admin.site.root),
+ (r'^admin/(.*)', include(admin.site.urls)),
(r'^accounts/login/$', login),
(r'^accounts/logout/$', logout),
(r'^accounts/profile/$', direct_to_template, {
Please sign in to comment.
Something went wrong with that request. Please try again.