Create a super-simple homepage
This commit is contained in:
parent
8bd2faa8a9
commit
55abf1780e
9 changed files with 75 additions and 1 deletions
0
home/__init__.py
Normal file
0
home/__init__.py
Normal file
10
home/templates/home/index.html
Normal file
10
home/templates/home/index.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
{% extends 'lemoncurry/layout.html' %}
|
||||
{% block main %}
|
||||
<aside class="author">
|
||||
<article class="h-card card p-author">
|
||||
<h4 class="card-title p-name">
|
||||
<span class="p-given-name">{{ user.first_name }}</span> <span class="p-family-name">{{ user.last_name }}</span>
|
||||
</h4>
|
||||
</article>
|
||||
</aside>
|
||||
{% endblock %}
|
8
home/urls.py
Normal file
8
home/urls.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
|
||||
app_name = 'home'
|
||||
urlpatterns = [
|
||||
url(r'^$', views.index, name='index'),
|
||||
]
|
7
home/views.py
Normal file
7
home/views.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
from django.shortcuts import get_object_or_404, render
|
||||
from users.models import User
|
||||
|
||||
|
||||
def index(request):
|
||||
user = get_object_or_404(User, pk=1)
|
||||
return render(request, 'home/index.html', {'user': user})
|
Loading…
Add table
Add a link
Reference in a new issue