diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8346735 --- /dev/null +++ b/.gitignore @@ -0,0 +1,132 @@ +# ---> Python +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +media/ \ No newline at end of file diff --git a/db.sqlite3 b/db.sqlite3 index 91c6c83..5d9ce8d 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/home/__pycache__/__init__.cpython-38.pyc b/home/__pycache__/__init__.cpython-38.pyc index 4d117b6..6d42d1d 100644 Binary files a/home/__pycache__/__init__.cpython-38.pyc and b/home/__pycache__/__init__.cpython-38.pyc differ diff --git a/home/__pycache__/models.cpython-38.pyc b/home/__pycache__/models.cpython-38.pyc index 26cc265..77eb6d5 100644 Binary files a/home/__pycache__/models.cpython-38.pyc and b/home/__pycache__/models.cpython-38.pyc differ diff --git a/home/migrations/__pycache__/0001_initial.cpython-38.pyc b/home/migrations/__pycache__/0001_initial.cpython-38.pyc index d9e6562..48853cf 100644 Binary files a/home/migrations/__pycache__/0001_initial.cpython-38.pyc and b/home/migrations/__pycache__/0001_initial.cpython-38.pyc differ diff --git a/home/migrations/__pycache__/0002_create_homepage.cpython-38.pyc b/home/migrations/__pycache__/0002_create_homepage.cpython-38.pyc index a54567f..dd525a6 100644 Binary files a/home/migrations/__pycache__/0002_create_homepage.cpython-38.pyc and b/home/migrations/__pycache__/0002_create_homepage.cpython-38.pyc differ diff --git a/home/migrations/__pycache__/0003_homepage_body.cpython-38.pyc b/home/migrations/__pycache__/0003_homepage_body.cpython-38.pyc index 9612e99..ac39b4f 100644 Binary files a/home/migrations/__pycache__/0003_homepage_body.cpython-38.pyc and b/home/migrations/__pycache__/0003_homepage_body.cpython-38.pyc differ diff --git a/home/migrations/__pycache__/__init__.cpython-38.pyc b/home/migrations/__pycache__/__init__.cpython-38.pyc index 4367be5..ca982ae 100644 Binary files a/home/migrations/__pycache__/__init__.cpython-38.pyc and b/home/migrations/__pycache__/__init__.cpython-38.pyc differ diff --git a/search/__pycache__/__init__.cpython-38.pyc b/search/__pycache__/__init__.cpython-38.pyc index 55d2e5b..5d6ff89 100644 Binary files a/search/__pycache__/__init__.cpython-38.pyc and b/search/__pycache__/__init__.cpython-38.pyc differ diff --git a/search/__pycache__/views.cpython-38.pyc b/search/__pycache__/views.cpython-38.pyc index b5731b5..dca06a8 100644 Binary files a/search/__pycache__/views.cpython-38.pyc and b/search/__pycache__/views.cpython-38.pyc differ diff --git a/stranky/__init__.py b/stranky/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/stranky/admin.py b/stranky/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/stranky/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/stranky/apps.py b/stranky/apps.py new file mode 100644 index 0000000..0220a40 --- /dev/null +++ b/stranky/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class StrankyConfig(AppConfig): + name = 'stranky' diff --git a/stranky/migrations/0001_initial.py b/stranky/migrations/0001_initial.py new file mode 100644 index 0000000..62cba68 --- /dev/null +++ b/stranky/migrations/0001_initial.py @@ -0,0 +1,44 @@ +# Generated by Django 3.1.3 on 2020-11-23 13:41 + +from django.db import migrations, models +import django.db.models.deletion +import modelcluster.fields +import wagtail.core.fields + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('wagtailimages', '0022_uploadedimage'), + ('wagtailcore', '0059_apply_collection_ordering'), + ] + + operations = [ + migrations.CreateModel( + name='StrankyPage', + 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')), + ('body', wagtail.core.fields.RichTextField(blank=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='StrankyPageGalleryImage', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sort_order', models.IntegerField(blank=True, editable=False, null=True)), + ('caption', models.CharField(blank=True, max_length=250)), + ('image', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailimages.image')), + ('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='gallery_images', to='stranky.strankypage')), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + ), + ] diff --git a/stranky/migrations/__init__.py b/stranky/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/stranka/models.py b/stranky/models.py similarity index 87% rename from stranka/models.py rename to stranky/models.py index c70364c..e9e43db 100644 --- a/stranka/models.py +++ b/stranky/models.py @@ -9,7 +9,7 @@ from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.search import index -class StrankaPage(Page): +class StrankyPage(Page): body = RichTextField(blank=True) search_fields = Page.search_fields + [ @@ -22,8 +22,8 @@ class StrankaPage(Page): ] -class StrankaPageGalleryImage(Orderable): - page = ParentalKey(StrankaPage, on_delete=models.CASCADE, related_name='gallery_images') +class StrankyPageGalleryImage(Orderable): + page = ParentalKey(StrankyPage, on_delete=models.CASCADE, related_name='gallery_images') image = models.ForeignKey( 'wagtailimages.Image', on_delete=models.CASCADE, related_name='+' ) diff --git a/stranky/tests.py b/stranky/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/stranky/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/stranky/views.py b/stranky/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/stranky/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/ubytovani/__pycache__/__init__.cpython-38.pyc b/ubytovani/__pycache__/__init__.cpython-38.pyc index 93d0511..991d947 100644 Binary files a/ubytovani/__pycache__/__init__.cpython-38.pyc and b/ubytovani/__pycache__/__init__.cpython-38.pyc differ diff --git a/ubytovani/__pycache__/urls.cpython-38.pyc b/ubytovani/__pycache__/urls.cpython-38.pyc index 0af88ad..04cbe6a 100644 Binary files a/ubytovani/__pycache__/urls.cpython-38.pyc and b/ubytovani/__pycache__/urls.cpython-38.pyc differ diff --git a/ubytovani/__pycache__/wsgi.cpython-38.pyc b/ubytovani/__pycache__/wsgi.cpython-38.pyc index 0678a3d..102470a 100644 Binary files a/ubytovani/__pycache__/wsgi.cpython-38.pyc and b/ubytovani/__pycache__/wsgi.cpython-38.pyc differ diff --git a/ubytovani/settings/__pycache__/__init__.cpython-38.pyc b/ubytovani/settings/__pycache__/__init__.cpython-38.pyc index 76b0854..4f31071 100644 Binary files a/ubytovani/settings/__pycache__/__init__.cpython-38.pyc and b/ubytovani/settings/__pycache__/__init__.cpython-38.pyc differ diff --git a/ubytovani/settings/__pycache__/base.cpython-38.pyc b/ubytovani/settings/__pycache__/base.cpython-38.pyc index caac97d..83b0b56 100644 Binary files a/ubytovani/settings/__pycache__/base.cpython-38.pyc and b/ubytovani/settings/__pycache__/base.cpython-38.pyc differ diff --git a/ubytovani/settings/__pycache__/dev.cpython-38.pyc b/ubytovani/settings/__pycache__/dev.cpython-38.pyc index 593380a..db4f82d 100644 Binary files a/ubytovani/settings/__pycache__/dev.cpython-38.pyc and b/ubytovani/settings/__pycache__/dev.cpython-38.pyc differ diff --git a/ubytovani/settings/base.py b/ubytovani/settings/base.py index efd7122..0917e80 100644 --- a/ubytovani/settings/base.py +++ b/ubytovani/settings/base.py @@ -48,6 +48,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'stranky', ] MIDDLEWARE = [ @@ -99,26 +100,26 @@ DATABASES = { # Password validation # https://docs.djangoproject.com/en/3.1/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.1/topics/i18n/ -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = 'cs' TIME_ZONE = 'UTC'