From 564a137205b2b46593ae3d31816b5efd65feef36 Mon Sep 17 00:00:00 2001 From: "tomas.patolan" Date: Wed, 21 Oct 2020 10:48:47 +0200 Subject: [PATCH] =?UTF-8?q?Zm=C4=9Bna=20=C4=8D=C3=ADslo=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog/settings/base.py | 34 ++++++++++--------- home/templates/home/home_page.html | 2 +- zapisnik/__init__.py | 0 zapisnik/admin.py | 3 ++ zapisnik/apps.py | 5 +++ zapisnik/migrations/0001_initial.py | 28 +++++++++++++++ zapisnik/migrations/__init__.py | 0 zapisnik/models.py | 12 +++++++ .../templates/zapisnik/blog_index_page.html | 0 zapisnik/tests.py | 3 ++ zapisnik/views.py | 3 ++ 11 files changed, 73 insertions(+), 17 deletions(-) create mode 100644 zapisnik/__init__.py create mode 100644 zapisnik/admin.py create mode 100644 zapisnik/apps.py create mode 100644 zapisnik/migrations/0001_initial.py create mode 100644 zapisnik/migrations/__init__.py create mode 100644 zapisnik/models.py create mode 100644 zapisnik/templates/zapisnik/blog_index_page.html create mode 100644 zapisnik/tests.py create mode 100644 zapisnik/views.py diff --git a/blog/settings/base.py b/blog/settings/base.py index 9e71f40..1a9f972 100644 --- a/blog/settings/base.py +++ b/blog/settings/base.py @@ -26,6 +26,7 @@ BASE_DIR = os.path.dirname(PROJECT_DIR) INSTALLED_APPS = [ 'home', 'search', + 'wagtail.contrib.forms', 'wagtail.contrib.redirects', @@ -48,6 +49,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'zapisnik', ] MIDDLEWARE = [ @@ -99,28 +101,28 @@ DATABASES = { # Password validation # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] +# AUTH_PASSWORD_VALIDATORS = [ +# { +# 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', +# }, +# { +# 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', +# }, +# { +# 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', +# }, +# { +# 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', +# }, +# ] # Internationalization # https://docs.djangoproject.com/en/3.0/topics/i18n/ -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = 'cs' -TIME_ZONE = 'UTC' +TIME_ZONE = 'Europe/Prague' USE_I18N = True diff --git a/home/templates/home/home_page.html b/home/templates/home/home_page.html index 363930f..c0a5a4b 100644 --- a/home/templates/home/home_page.html +++ b/home/templates/home/home_page.html @@ -9,7 +9,7 @@ {% endblock extra_css %} {% block content %} - tomáš patolán + tomášadasd {{ page.body|richtext }} {% endblock content %} diff --git a/zapisnik/__init__.py b/zapisnik/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/zapisnik/admin.py b/zapisnik/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/zapisnik/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/zapisnik/apps.py b/zapisnik/apps.py new file mode 100644 index 0000000..63f2dbc --- /dev/null +++ b/zapisnik/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class ZapisnikConfig(AppConfig): + name = 'zapisnik' diff --git a/zapisnik/migrations/0001_initial.py b/zapisnik/migrations/0001_initial.py new file mode 100644 index 0000000..4a91a0a --- /dev/null +++ b/zapisnik/migrations/0001_initial.py @@ -0,0 +1,28 @@ +# Generated by Django 3.0.6 on 2020-10-21 08:42 + +from django.db import migrations, models +import django.db.models.deletion +import wagtail.core.fields + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('wagtailcore', '0052_pagelogentry'), + ] + + operations = [ + migrations.CreateModel( + name='BlogIndexPage', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('intro', wagtail.core.fields.RichTextField(blank=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + ] diff --git a/zapisnik/migrations/__init__.py b/zapisnik/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/zapisnik/models.py b/zapisnik/models.py new file mode 100644 index 0000000..8e83a65 --- /dev/null +++ b/zapisnik/models.py @@ -0,0 +1,12 @@ +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 BlogIndexPage(Page): + intro = RichTextField(blank=True) + + content_panels = Page.content_panels + [ + FieldPanel('intro', classname="full") + ] \ No newline at end of file diff --git a/zapisnik/templates/zapisnik/blog_index_page.html b/zapisnik/templates/zapisnik/blog_index_page.html new file mode 100644 index 0000000..e69de29 diff --git a/zapisnik/tests.py b/zapisnik/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/zapisnik/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/zapisnik/views.py b/zapisnik/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/zapisnik/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here.