diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..10c246f Binary files /dev/null and b/.DS_Store differ diff --git a/isv_project/.DS_Store b/isv_project/.DS_Store new file mode 100644 index 0000000..8490518 Binary files /dev/null and b/isv_project/.DS_Store differ diff --git a/isv_project/app/.DS_Store b/isv_project/app/.DS_Store new file mode 100644 index 0000000..9e2fc3e Binary files /dev/null and b/isv_project/app/.DS_Store differ diff --git a/isv_project/app/templates/.DS_Store b/isv_project/app/templates/.DS_Store new file mode 100644 index 0000000..db41a0f Binary files /dev/null and b/isv_project/app/templates/.DS_Store differ diff --git a/isv_project/app/templates/app/.DS_Store b/isv_project/app/templates/app/.DS_Store new file mode 100644 index 0000000..5cecfb0 Binary files /dev/null and b/isv_project/app/templates/app/.DS_Store differ diff --git a/isv_project/app/templates/app/index.html b/isv_project/app/templates/app/index.html new file mode 100644 index 0000000..3922319 --- /dev/null +++ b/isv_project/app/templates/app/index.html @@ -0,0 +1,9 @@ +{% if latest_question_list %} +
No polls are available.
+{% endif %} \ No newline at end of file diff --git a/isv_project/app/views.py b/isv_project/app/views.py index 3a1a3c5..1097a6c 100644 --- a/isv_project/app/views.py +++ b/isv_project/app/views.py @@ -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) diff --git a/isv_project/isv_project/settings.py b/isv_project/isv_project/settings.py index 7bdeed4..958ff8d 100644 --- a/isv_project/isv_project/settings.py +++ b/isv_project/isv_project/settings.py @@ -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": [