Browse Source

mazani radku

master
Tomas Harazim 5 years ago
parent
commit
b5589a6110
  1. 2
      blog/settings/dev.py
  2. 19
      home/migrations/0003_homepage_body.py
  3. 8
      home/models.py
  4. 13
      home/templates/home/home_page.html

2
blog/settings/dev.py

@ -4,7 +4,7 @@ from .base import *
DEBUG = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '+&u(o6q&6ozwx93abpj(u=s)75d%@+vhk997iyh6))%(jy_&^&'
SECRET_KEY = '2p*omsz*++h9ck1)shb9^vzi1u#lay&@j-wl^#f=%_4cf6v7ii'
# SECURITY WARNING: define the correct hosts in production!
ALLOWED_HOSTS = ['*']

19
home/migrations/0003_homepage_body.py

@ -0,0 +1,19 @@
# Generated by Django 3.1.2 on 2020-10-16 09:16
from django.db import migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('home', '0002_create_homepage'),
]
operations = [
migrations.AddField(
model_name='homepage',
name='body',
field=wagtail.core.fields.RichTextField(blank=True),
),
]

8
home/models.py

@ -1,7 +1,13 @@
from django.db import models
from wagtail.core.models import Page
from wagtail.core.fields import RichTextField
from wagtail.admin.edit_handlers import FieldPanel
class HomePage(Page):
pass
body = RichTextField(blank=True)
content_panels = Page.content_panels + [
FieldPanel('body', classname="full"),
]

13
home/templates/home/home_page.html

@ -1,21 +1,16 @@
{% extends "base.html" %}
{% load static %}
{% 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 %}
{% 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' %}
{{ page.body|richtext }}
{% endblock content %}

Loading…
Cancel
Save