templates
This commit is contained in:
parent
4a88d8a2ff
commit
f71a9ef175
|
@ -56,7 +56,7 @@ ROOT_URLCONF = 'gwift.urls'
|
|||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [],
|
||||
'DIRS': [ 'templates' ],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# gwift/urls.py
|
||||
|
||||
"""gwift URL Configuration
|
||||
|
||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||
|
@ -16,6 +18,9 @@ Including another URLconf
|
|||
from django.conf.urls import include, url
|
||||
from django.contrib import admin
|
||||
|
||||
from wish.views import WishListList
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^admin/', include(admin.site.urls)),
|
||||
url(r'^$', WishListList.as_view(), name='wishlists'),
|
||||
]
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Mes listes de souhaits</p>
|
||||
<ul>
|
||||
{% for wishlist in wishlists %}
|
||||
<li>{{ wishlist.name }}: {{ wishlist.description }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -1,3 +1,10 @@
|
|||
from django.shortcuts import render
|
||||
# wish/views.py
|
||||
|
||||
# Create your views here.
|
||||
from django.views.generic import ListView
|
||||
|
||||
from .models import Wishlist
|
||||
|
||||
class WishListList(ListView):
|
||||
context_object_name = 'wishlists'
|
||||
model = Wishlist
|
||||
template_name = 'wish/list.html'
|
||||
|
|
Loading…
Reference in New Issue