naja so ein bisschen tutorial weiter
This commit is contained in:
parent
54b86cd34a
commit
499eaf5e26
3 changed files with 29 additions and 18 deletions
19
home/migrations/0003_homepage_body.py
Normal file
19
home/migrations/0003_homepage_body.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Generated by Django 5.2.6 on 2025-09-30 21:42
|
||||
|
||||
import wagtail.fields
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('home', '0002_create_homepage'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='homepage',
|
||||
name='body',
|
||||
field=wagtail.fields.RichTextField(blank=True),
|
||||
),
|
||||
]
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
from django.db import models
|
||||
|
||||
from wagtail.models import Page
|
||||
|
||||
from wagtail.fields import RichTextField
|
||||
|
||||
class HomePage(Page):
|
||||
pass
|
||||
body = RichTextField(blank=True)
|
||||
|
||||
content_panels = Page.content_panels + ["body"]
|
||||
|
|
|
|||
|
|
@ -1,21 +1,11 @@
|
|||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
<!-- load wagtailcore_tags by adding this: -->
|
||||
{% load wagtailcore_tags %}
|
||||
|
||||
{% block body_class %}template-homepage{% endblock %}
|
||||
|
||||
{% block extra_css %}
|
||||
|
||||
{% comment %}
|
||||
Delete the line below if you're just getting started and want to remove the welcome screen!
|
||||
{% endcomment %}
|
||||
<link rel="stylesheet" href="{% static 'css/welcome_page.css' %}">
|
||||
{% endblock extra_css %}
|
||||
|
||||
<!-- replace everything below with: -->
|
||||
{% block content %}
|
||||
|
||||
{% comment %}
|
||||
Delete the line below if you're just getting started and want to remove the welcome screen!
|
||||
{% endcomment %}
|
||||
{% include 'home/welcome_page.html' %}
|
||||
|
||||
{% endblock content %}
|
||||
{{ page.body|richtext }}
|
||||
{% endblock %}
|
||||
Loading…
Add table
Reference in a new issue