new structure 'template'

main
Destroyeur6315 1 year ago
parent cc9dc0895e
commit 4a096e0e3b

BIN
.DS_Store vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,9 @@
{% if latest_question_list %}
<ul>
{% for question in latest_question_list %}
<li><a href="/app/34/">34</a></li>
{% endfor %}
</ul>
{% else %}
<p>No polls are available.</p>
{% endif %}

@ -1,10 +1,13 @@
from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
# Create your views here.
def index(request):
return HttpResponse("Hello, world. You're at the app index.")
context = {"latest_question_list": 'qui est elon musk'}
return render(request, "app/index.html", context)
#return HttpResponse("Hello, world. You're at the app index.")
def detail(request, question_id):
return HttpResponse("You're looking at question %s." % question_id)

@ -10,6 +10,7 @@ For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.0/ref/settings/
"""
import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
@ -54,7 +55,7 @@ ROOT_URLCONF = "isv_project.urls"
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"DIRS": [os.path.join(BASE_DIR, './app/templates')],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [

Loading…
Cancel
Save