Fix urls and change app title

This commit is contained in:
Gabriel Augendre 2016-06-03 20:02:26 +02:00
parent e96c272572
commit e0e968b3d0
No known key found for this signature in database
GPG key ID: D2B6A5B41FC438B1
7 changed files with 24 additions and 14 deletions

View file

@ -9,7 +9,7 @@ urlpatterns = [
),
url(r'^logout/$',
logout,
{'next_page': 'blog_home'},
{'next_page': 'home'},
name='auth_logout'
),
]

View file

@ -48,6 +48,7 @@ X_FRAME_OPTIONS = 'DENY'
# Application definition
INSTALLED_APPS = [
'authentication',
'crispy_forms',
'django.contrib.admin',
'django.contrib.auth',
@ -153,8 +154,8 @@ STATICFILES_DIRS = (
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
# LOGIN_URL = 'auth_login'
# LOGOUT_URL = 'auth_logout'
# LOGIN_REDIRECT_URL = 'blog_home'
LOGIN_URL = 'auth_login'
LOGOUT_URL = 'auth_logout'
LOGIN_REDIRECT_URL = 'home'
CRISPY_TEMPLATE_PACK = 'bootstrap3'

View file

@ -2,8 +2,6 @@
{% block title %}Home{% endblock %}
{% block content %}
<h1>Gab's thoughts</h1>
<p class="lead">Welcome to my blog. I hope you will enjoy your journey here.</p>
<p>This blog is about creating websites with Django, a Python framework designed for web.</p>
<p>Feel free to start by exploring my <a href="{% url 'posts_latest' %}">latest blog entries</a>.</p>
<h1>Refunds</h1>
<p class="lead">Welcome to my website. I hope you will enjoy your journey here.</p>
{% endblock %}

View file

@ -13,9 +13,13 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.conf.urls import url, include
from django.contrib import admin
from refunds.views import home, about
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^auth/', include('authentication.urls')),
url(r'^$', home, name='home'),
url(r'^about/$', about, name='about'),
]

9
refunds/views.py Normal file
View file

@ -0,0 +1,9 @@
from django.shortcuts import render
def home(request):
return render(request, "blog/home.html")
def about(request):
return render(request, "blog/about.html")

View file

@ -2,7 +2,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Gab's thoughts &bull; {% block title %}{% endblock %}</title>
<title>Refunds &bull; {% block title %}{% endblock %}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

View file

@ -9,14 +9,13 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{% url 'blog_home' %}">Gab's thoughts</a>
<a class="navbar-brand" href="{% url 'home' %}">Refunds</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="{% url 'posts_latest' %}">Blog posts</a></li>
<li><a href="{% url 'blog_about' %}">About</a></li>
<li><a href="{% url 'about' %}">About</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
{% if not user.is_authenticated %}
@ -28,7 +27,6 @@
{% firstof user.get_full_name user.username %} <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="{% url 'posts_drafts' %}">Drafts</a></li>
<li><a href="{% url 'admin:index' %}">Admin</a></li>
<li role="separator" class="divider"></li>
<li><a href="{% url 'auth_logout' %}?next={{ request.path }}">Logout</a></li>