next view and rendering it
This commit is contained in:
parent
259c68692b
commit
fef67254ee
5 changed files with 13 additions and 8 deletions
|
@ -10,6 +10,7 @@ For the full list of settings and their values, see
|
|||
https://docs.djangoproject.com/en/4.2/ref/settings/
|
||||
"""
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
|
@ -58,7 +59,7 @@ ROOT_URLCONF = "core.urls"
|
|||
TEMPLATES = [
|
||||
{
|
||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||
"DIRS": [],
|
||||
"DIRS": [os.path.join(BASE_DIR, 'templates')],
|
||||
"APP_DIRS": True,
|
||||
"OPTIONS": {
|
||||
"context_processors": [
|
||||
|
@ -123,7 +124,10 @@ USE_TZ = True
|
|||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
||||
|
||||
STATIC_URL = "static/"
|
||||
STATIC_URL = 'static/'
|
||||
STATICFILES_DIRS = [
|
||||
BASE_DIR / "static"
|
||||
]
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
||||
|
|
|
@ -7,10 +7,9 @@ def bird_create(request):
|
|||
|
||||
|
||||
def bird_all(request):
|
||||
birds_all = FallenBird.objects.all()
|
||||
for bird in birds_all:
|
||||
print(bird)
|
||||
return HttpResponse("Show all Birds")
|
||||
birds = FallenBird.objects.all()
|
||||
context = {'birds': birds}
|
||||
return render(request, 'fbf/birds_all.html', context)
|
||||
|
||||
|
||||
def bird_recover_all(request):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{load static}
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
@ -14,7 +14,7 @@
|
|||
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
|
||||
|
||||
{% comment %} possible dynamic header {% endcomment %}
|
||||
<title>{% block head_title %}lv·rb{% endblock %}</title>
|
||||
<title>{% block head_title %}Fallen Birdy{% endblock %}</title>
|
||||
|
||||
{% comment %} custom header {% endcomment %}
|
||||
{% block header %} {% endblock header %}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
footer
|
|
@ -0,0 +1 @@
|
|||
navbar
|
Loading…
Add table
Add a link
Reference in a new issue