diff --git a/README.md b/README.md index 1cbd6a35..9c2ea972 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A Dockerised django CMS project, ready to deploy on [Divio](https://www.divio.com/) or another Docker-based cloud platform, and run locally in Docker on your own machine. -This version uses Python 3.8 running and the most up-to-date versions of Django 3.1 and django CMS 3.8. +This version uses Python 3.9 running and the most up-to-date versions of Django 3.2 and django CMS 3.11. This project is endorsed by the [django CMS Association](https://www.django-cms.org/en/about-us/). That means that it is officially accepted by the dCA as being in line with our roadmap vision and development/plugin policy. Join us on [Slack](https://www.django-cms.org/slack/) for more information or questions. @@ -19,6 +19,7 @@ You need to have docker installed on your system to run this project. ```bash git clone git@github.com:django-cms/django-cms-quickstart.git +git checkout support/cms-3.11.x cd django-cms-quickstart docker compose build web docker compose up -d database_default @@ -35,7 +36,7 @@ Note: Since Compose V2, `docker-compose` is now included inside docker. For more This project is ready-to-go without making any changes at all, but also gives you some options. -As-is, it will include a number of useful django CMS plugins and Bootstrap 4 for the frontend. You don't have to use +As-is, it will include a number of useful django CMS plugins and Bootstrap 5 for the frontend. You don't have to use these; they're optional. If you don't want to use them, read through the `settings.py` and `requirements.txt` files to see sections that can be removed - in each case, the section is noted with a comment containing the word 'optional'. diff --git a/backend/settings.py b/backend/settings.py index eaf6fb24..19b80d8c 100644 --- a/backend/settings.py +++ b/backend/settings.py @@ -56,28 +56,28 @@ # some content plugins - optional, but used in most projects 'djangocms_file', 'djangocms_icon', - 'djangocms_link', 'djangocms_picture', 'djangocms_style', 'djangocms_googlemap', 'djangocms_video', - # optional django CMS Bootstrap 4 modules - 'djangocms_bootstrap4', - 'djangocms_bootstrap4.contrib.bootstrap4_alerts', - 'djangocms_bootstrap4.contrib.bootstrap4_badge', - 'djangocms_bootstrap4.contrib.bootstrap4_card', - 'djangocms_bootstrap4.contrib.bootstrap4_carousel', - 'djangocms_bootstrap4.contrib.bootstrap4_collapse', - 'djangocms_bootstrap4.contrib.bootstrap4_content', - 'djangocms_bootstrap4.contrib.bootstrap4_grid', - 'djangocms_bootstrap4.contrib.bootstrap4_jumbotron', - 'djangocms_bootstrap4.contrib.bootstrap4_link', - 'djangocms_bootstrap4.contrib.bootstrap4_listgroup', - 'djangocms_bootstrap4.contrib.bootstrap4_media', - 'djangocms_bootstrap4.contrib.bootstrap4_picture', - 'djangocms_bootstrap4.contrib.bootstrap4_tabs', - 'djangocms_bootstrap4.contrib.bootstrap4_utilities', + # optional django CMS Frontend modules + 'djangocms_frontend', + 'djangocms_frontend.contrib.accordion', + 'djangocms_frontend.contrib.alert', + 'djangocms_frontend.contrib.badge', + 'djangocms_frontend.contrib.card', + 'djangocms_frontend.contrib.carousel', + 'djangocms_frontend.contrib.collapse', + 'djangocms_frontend.contrib.content', + 'djangocms_frontend.contrib.grid', + 'djangocms_frontend.contrib.jumbotron', + 'djangocms_frontend.contrib.link', + 'djangocms_frontend.contrib.listgroup', + 'djangocms_frontend.contrib.media', + 'djangocms_frontend.contrib.image', + 'djangocms_frontend.contrib.tabs', + 'djangocms_frontend.contrib.utilities', ] MIDDLEWARE = [ @@ -123,14 +123,24 @@ }, ] +THUMBNAIL_PROCESSORS = ( + 'easy_thumbnails.processors.colorspace', + 'easy_thumbnails.processors.autocrop', + #'easy_thumbnails.processors.scale_and_crop', + 'filer.thumbnail_processors.scale_and_crop_with_subject_location', + 'easy_thumbnails.processors.filters', +) + + CMS_TEMPLATES = [ # a minimal template to get started with ('minimal.html', 'Minimal template'), - ('whitenoise-static-files-demo.html', 'Static File Demo'), # optional templates that extend base.html, to be used with Bootstrap 5 - ('page.html', 'Bootstrap 4 Demo'), - ('feature.html', 'Bootstrap 4 Demo with two placeholders') + ('bootstrap5.html', 'Bootstrap 5 Demo'), + + # serving static files with whitenoise demo + ('whitenoise-static-files-demo.html', 'Static File Demo'), ] WSGI_APPLICATION = 'backend.wsgi.application' @@ -144,6 +154,7 @@ DATABASE_URL = os.environ.get('DATABASE_URL', 'sqlite://:memory:') DATABASES = {'default': dj_database_url.parse(DATABASE_URL)} +DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' # Password validation # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators diff --git a/backend/templates/base.html b/backend/templates/base.html index f628a2a4..194eaf3a 100644 --- a/backend/templates/base.html +++ b/backend/templates/base.html @@ -1,37 +1,34 @@ -{% load cms_tags static sekizai_tags menu_tags %} - - - - - {% block title %}This is my new project home page{% endblock title %} - - - - {% render_block "css" %} +{% load cms_tags menu_tags sekizai_tags static i18n %}{% spaceless %} + + + + + + {% block meta %} + + + + + {% endblock meta %} + {% block canonical_url %} + + + {% endblock canonical_url %} + {% block fb_meta %}{% endblock fb_meta %} + {% block title %}{% page_attribute "page_title" %}{% endblock %} + {% block base_css %}{% endblock %} +{% endspaceless %}{% render_block 'css' %}{% spaceless %} + {% block page_head %}{% endblock %} - - {% cms_toolbar %} -
- - {% block content %}{% endblock content %} -
- - - - - - {% render_block "js" %} + +{% endspaceless %}{% cms_toolbar %}{% spaceless %} + {% block navbar %}{% endblock %} + {% block content %} + {% placeholder "Content" %} + {% endblock content %} + {% block base_js %}{% endblock %} +{% endspaceless %}{% render_block 'js' %}{% spaceless %} + {% block end_js %}{% endblock %} + {% block bottom_css %}{% endblock %} - + {% endspaceless %} diff --git a/backend/templates/bootstrap5.html b/backend/templates/bootstrap5.html new file mode 100644 index 00000000..c6341ae3 --- /dev/null +++ b/backend/templates/bootstrap5.html @@ -0,0 +1,21 @@ +{% extends "base.html" %}{% load cms_tags menu_tags %} +{% block base_css %} + +{% endblock %} +{% block base_js %} + +{% endblock %} +{% block navbar %} + +{% endblock %} diff --git a/backend/templates/feature.html b/backend/templates/feature.html deleted file mode 100644 index 73bf355c..00000000 --- a/backend/templates/feature.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "base.html" %} -{% load cms_tags %} - -{% block title %}{% page_attribute "page_title" %}{% endblock title %} - -{% block content %} -
- {% placeholder "feature" %} -
-
- {% placeholder "content" %} -
-{% endblock content %} diff --git a/backend/templates/menu.html b/backend/templates/menu.html deleted file mode 100644 index 34233cc5..00000000 --- a/backend/templates/menu.html +++ /dev/null @@ -1,19 +0,0 @@ -{% load i18n menu_tags cache %} - -{% for child in children %} - - {% if class and forloop.last and not forloop.parentloop %}{% endif %} -{% endfor %} diff --git a/backend/templates/menu/dropdown.html b/backend/templates/menu/dropdown.html new file mode 100644 index 00000000..2108ba0e --- /dev/null +++ b/backend/templates/menu/dropdown.html @@ -0,0 +1,7 @@ +{% load i18n menu_tags cache %} +{% for child in children %} + {% if child.get_menu_title|first == ' ' %} + + {% endif %} + {{ child.get_menu_title }} +{% endfor %} diff --git a/backend/templates/menu/menu.html b/backend/templates/menu/menu.html new file mode 100644 index 00000000..f8560c95 --- /dev/null +++ b/backend/templates/menu/menu.html @@ -0,0 +1,13 @@ +{% load i18n menu_tags cache %}{% spaceless %} + {% for child in children %} + + {% endfor %} +{% endspaceless %} diff --git a/backend/templates/minimal.html b/backend/templates/minimal.html index 02bc1b90..df148364 100644 --- a/backend/templates/minimal.html +++ b/backend/templates/minimal.html @@ -6,7 +6,7 @@ {% cms_toolbar %} - {% placeholder "content" %} + {% placeholder "Content" %} {% render_block "js" %} diff --git a/backend/templates/page.html b/backend/templates/page.html deleted file mode 100644 index b095172d..00000000 --- a/backend/templates/page.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base.html" %} -{% load cms_tags %} - -{% block title %}{% page_attribute "page_title" %}{% endblock title %} - -{% block content %} - {% placeholder "content" %} -{% endblock content %} diff --git a/backend/templates/whitenoise-static-files-demo.html b/backend/templates/whitenoise-static-files-demo.html index bf02b563..39cccfbb 100644 --- a/backend/templates/whitenoise-static-files-demo.html +++ b/backend/templates/whitenoise-static-files-demo.html @@ -9,7 +9,7 @@ - {% placeholder "content" %} + {% placeholder "Content" %} {% render_block "js" %} diff --git a/requirements.in b/requirements.in index a98528dd..dcad571b 100644 --- a/requirements.in +++ b/requirements.in @@ -2,7 +2,7 @@ # pip-compile requirements.in >> requirements.txt -django>=3.1,<3.2 # 3.2 has dark admin theme which looks bad in custom django CMS admin views +django==3.2 dj-database-url==0.5.0 django-storage-url==0.5.0 whitenoise==5.2.0 @@ -16,17 +16,16 @@ uwsgi==2.0.19.1 django-cms<4 django-classy-tags>=2.0 django-sekizai>=2.0 -six pytz # optional, but used in most projects -djangocms-admin-style>=2.0,<3.0 +djangocms-admin-style>=2.0 # the default CKEditor - optional, but used in most projects -djangocms-text-ckeditor>=4.0,<5.0 +djangocms-text-ckeditor>=4.0 # some content plugins - optional, but used in most projects -djangocms-link>=3.0,<4.0 +# djangocms-link>=3.0,<4.0 # Only if not using djangocms-frontend djangocms-icon>=2.0,<3.0 djangocms-style>=3.0,<4.0 djangocms-googlemap>=2.0,<3.0 @@ -34,14 +33,11 @@ djangocms-video>=3.0,<4.0 djangocms-file>=3.0,<4.0 djangocms-picture>=3.0,<4.0 -easy-thumbnails==2.8.0 -# optional django CMS Bootstrap 4 modules -djangocms-bootstrap4>=2.0,<3.0 -# optional django CMS Bootstrap 5 modules (alpha) - requires BS5 frontend setup in the templates -# as of Q4 2021 there are still basic issues with djangocms-bootstrap5 -# https://github.com/gl-agnx/djangocms-bootstrap5/archive/refs/heads/master.zip#egg=djangocms_bootstrap5 +easy-thumbnails +# optional django CMS Frontend modules +djangocms-frontend -# Django Filer - optional, but used in most projects (alpha) -https://github.com/django-cms/django-filer/archive/refs/tags/2.1.1.zip#egg=django-filer +# Django Filer - optional, but used in most projects (alpha) - already implicitly installed through djangocms-file +# https://github.com/django-cms/django-filer/archive/refs/tags/2.1.1.zip#egg=django-filer pip-tools # needed for compilation of this file into requirements.txt, see start of file diff --git a/requirements.txt b/requirements.txt index fc20bc9b..1e608f52 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ # -# This file is autogenerated by pip-compile with python 3.9 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: # -# pip-compile requirements.in +# pip-compile --output-file=requirements.txt requirements.in # -asgiref==3.4.1 +asgiref==3.7.2 # via django boto3==1.14.49 # via -r requirements.in @@ -12,105 +12,113 @@ botocore==1.17.63 # via # boto3 # s3transfer -click==8.0.3 +build==0.10.0 # via pip-tools -cssselect2==0.4.1 +click==8.1.5 + # via pip-tools +cssselect2==0.7.0 # via svglib dj-database-url==0.5.0 # via -r requirements.in -django==3.2.13 +django==3.2 # via # -r requirements.in + # django-appconf # django-classy-tags # django-cms + # django-entangled + # django-filer # django-formtools + # django-polymorphic # django-sekizai + # django-select2 # django-storages # django-treebeard + # djangocms-frontend # easy-thumbnails -django-classy-tags==2.0.0 +django-appconf==1.0.5 + # via django-select2 +django-classy-tags==4.0.0 # via # -r requirements.in # django-cms # django-sekizai -django-cms==3.10.0 +django-cms==3.11.3 # via # -r requirements.in # djangocms-attributes-field - # djangocms-bootstrap4 # djangocms-file + # djangocms-frontend # djangocms-googlemap # djangocms-icon - # djangocms-link # djangocms-picture # djangocms-style # djangocms-text-ckeditor # djangocms-video -django-filer @ https://github.com/django-cms/django-filer/archive/refs/tags/2.1.1.zip +django-entangled==0.5.4 + # via djangocms-frontend +django-filer==3.0.2 # via - # -r requirements.in - # djangocms-bootstrap4 # djangocms-file + # djangocms-frontend # djangocms-googlemap - # djangocms-link # djangocms-picture # djangocms-video -django-formtools==2.3 +django-formtools==2.4.1 # via django-cms -django-sekizai==2.0.0 +django-polymorphic==3.1.0 + # via django-filer +django-sekizai==4.1.0 # via # -r requirements.in # django-cms +django-select2==8.1.2 + # via djangocms-frontend django-storage-url==0.5.0 # via -r requirements.in -django-storages==1.11.1 +django-storages==1.13.2 # via django-storage-url -django-treebeard==4.5.1 - # via django-cms -djangocms-admin-style==3.1.1 +django-treebeard==4.4 + # via + # django-cms + # djangocms-googlemap +djangocms-admin-style==3.2.4 # via # -r requirements.in # django-cms -djangocms-attributes-field==2.0.0 +djangocms-attributes-field==3.0.0 # via - # djangocms-bootstrap4 # djangocms-file + # djangocms-frontend # djangocms-icon - # djangocms-link # djangocms-picture # djangocms-style # djangocms-video -djangocms-bootstrap4==2.0.0 +djangocms-file==3.0.1 # via -r requirements.in -djangocms-file==3.0.0 +djangocms-frontend==1.1.5 # via -r requirements.in -djangocms-googlemap==2.0.0 +djangocms-googlemap==2.1.0 # via -r requirements.in djangocms-icon==2.0.0 - # via - # -r requirements.in - # djangocms-bootstrap4 -djangocms-link==3.0.0 - # via - # -r requirements.in - # djangocms-bootstrap4 + # via -r requirements.in djangocms-picture==3.0.0 - # via - # -r requirements.in - # djangocms-bootstrap4 + # via -r requirements.in djangocms-style==3.0.0 # via -r requirements.in -djangocms-text-ckeditor==4.0.0 +djangocms-text-ckeditor==5.1.3 # via # -r requirements.in - # djangocms-bootstrap4 + # djangocms-frontend djangocms-video==3.0.0 # via -r requirements.in docutils==0.15.2 # via botocore -easy-thumbnails==2.8.0 +easy-thumbnails[svg]==2.8.5 # via # -r requirements.in + # django-filer + # djangocms-frontend # djangocms-picture furl==2.1.3 # via django-storage-url @@ -120,28 +128,33 @@ jmespath==0.10.0 # via # boto3 # botocore -lxml==4.6.3 +lxml==4.9.3 # via svglib orderedmultidict==1.0.1 # via furl -pep517==0.12.0 - # via pip-tools -pillow==8.3.2 +packaging==23.1 + # via + # build + # django-cms + # djangocms-text-ckeditor +pillow==10.0.0 # via # djangocms-text-ckeditor # easy-thumbnails # reportlab -pip-tools==6.4.0 +pip-tools==7.0.0 # via -r requirements.in psycopg2==2.8.5 # via -r requirements.in +pyproject-hooks==1.0.0 + # via build python-dateutil==2.8.2 # via botocore -pytz==2021.1 +pytz==2023.3 # via # -r requirements.in # django -reportlab==3.6.1 +reportlab==4.0.4 # via # easy-thumbnails # svglib @@ -149,21 +162,18 @@ s3transfer==0.3.7 # via boto3 six==1.16.0 # via - # -r requirements.in # furl # html5lib # orderedmultidict # python-dateutil -sqlparse==0.4.2 +sqlparse==0.4.4 # via django -svglib==1.1.0 +svglib==1.5.1 # via easy-thumbnails -tinycss2==1.1.0 +tinycss2==1.2.1 # via # cssselect2 # svglib -tomli==1.2.2 - # via pep517 urllib3==1.25.11 # via botocore uwsgi==2.0.19.1 @@ -173,7 +183,7 @@ webencodings==0.5.1 # cssselect2 # html5lib # tinycss2 -wheel==0.37.0 +wheel==0.40.0 # via pip-tools whitenoise==5.2.0 # via -r requirements.in