Skip to content

Commit 67a1afb

Browse files
authored
ci: Move to Django CMS 4.1rc3 (#41)
* Update readme * Update to django CMS 4.1rc3
1 parent 965f2ee commit 67a1afb

File tree

6 files changed

+174
-142
lines changed

6 files changed

+174
-142
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.10
1+
FROM python:3.11
22
WORKDIR /app
33
COPY . /app
44
RUN pip install -r requirements.txt

README.md

-82
This file was deleted.

README.rst

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
|pythonapp|
2+
3+
#####################
4+
django CMS quickstart
5+
#####################
6+
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.
8+
9+
This version uses Python 3.10 running and the most up-to-date versions of Django 3.2, and django CMS 4.1.0rc1
10+
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.
12+
13+
The documentation for version 4.1 is still work in progress and - for the time being - can be found here: https://django-cms-docs.readthedocs.io/en/latest/
14+
15+
Installation
16+
############
17+
18+
You need to have docker installed on your system to run this project.
19+
20+
- `Install Docker <https://docs.docker.com/engine/install/>`_ here.
21+
- If you have not used docker in the past, please read this `introduction on docker <https://docs.docker.com/get-started/>`_ here.
22+
23+
Try it
24+
######
25+
26+
.. inclusion-marker-do-not-remove
27+
28+
.. code-block:: bash
29+
30+
git clone git@github.com:django-cms/django-cms-quickstart.git
31+
cd django-cms-quickstart
32+
git switch -t origin/support/cms-4.1.x
33+
docker compose build web
34+
docker compose up -d database_default
35+
docker compose run web python manage.py migrate
36+
docker compose run web python manage.py createsuperuser
37+
docker compose up -d
38+
39+
Then open http://django-cms-quickstart.127.0.0.1.nip.io:8000 (or just http://127.0.0.1:8000) in your browser.
40+
41+
Note: Since Compose V2, ``docker-compose`` is now included inside docker. For more information, checkout the `Compose V2 <https://docs.docker.com/compose/cli-command/>`_ Documentation.
42+
43+
.. inclusion-end-marker-do-not-remove
44+
45+
Customising the project
46+
#######################
47+
48+
This project is ready-to-go without making any changes at all, but also gives you some options.
49+
50+
As-is, it will include a number of useful django CMS plugins and Bootstrap 4 for the frontend. You don't have to use
51+
these; they're optional. If you don't want to use them, read through the ``settings.py`` and ``requirements.txt`` files to
52+
see sections that can be removed - in each case, the section is noted with a comment containing the word 'optional'.
53+
54+
Options are also available for using Postgres/MySQL, uWSGI/Gunicorn/Guvicorn, etc.
55+
56+
Updating requirements
57+
=====================
58+
59+
The project uses a 2 step approach, freezing all dependencies with pip-tools. Read more about how to handle it here: https://blog.typodrive.com/2020/02/04/always-freeze-requirements-with-pip-compile-to-avoid-unpleasant-surprises/
60+
61+
Features
62+
########
63+
64+
Static Files with Whitenoise
65+
============================
66+
67+
This quickstart demo has a cloud-ready static files setup via django-whitenoise.
68+
69+
In the containerized cloud the application is not served by a web server like nginx but directly through uwsgi. django-whitenoise is the glue that's needed to serve static files in your application directly through uwsgi.
70+
71+
See the django-whitenoise settings in settings.py and the ``quickstart/templates/whitenoise-static-files-demo.html`` demo page template that serves a static file.
72+
73+
Contribution
74+
############
75+
76+
Here is the official django CMS repository: `https://github.com/django-cms/django-cms-quickstart/ <https://github.com/django-cms/django-cms-quickstart/>`_.
77+
78+
79+
Deployment
80+
##########
81+
82+
Note that this is just a demo project to get you started. If you want a full production ready site with all the bells and whistles we recommend you have a look at https://github.com/django-cms/djangocms-template instead.
83+
84+
Env variables
85+
=============
86+
87+
- to deploy this project in testing mode (recommended) set the environment variable ``DEBUG`` to ``True`` in your hosting environment.
88+
- For production environment (if ``DEBUG`` is false) django requires you to whitelist the domain. Set the env var ``DOMAIN`` to the host, i.e. ``www.domain.com`` or ``*.domain.com``.
89+
- If you want the media hosted on S3 set the ``DEFAULT_FILE_STORAGE`` variable accordingly.
90+
91+
Deployment Commands
92+
===================
93+
94+
Configure your hosting environment to run the following commands on every deployment:
95+
96+
- ``./manage.py migrate``
97+
98+
99+
Divio Deployment
100+
================
101+
102+
divio.com is a cloud hosting platform optimized for django web applications. It's the quickest way to deploy this project. Here is a `video tutorial <https://www.youtube.com/watch?v=O2g5Wfoyp7Q>`_ and a `description of the deployment steps <https://github.com/django-cms/djangocms-template/blob/mco-standalone/docs/deployment-divio.md#divio-project-setup>`_ that are mostly applicable for this quickstart project.
103+
104+
105+
.. |pythonapp| image:: https://github.com/django-cms/django-cms-quickstart/workflows/Python%20application/badge.svg?branch=support/cms-4.1.x

backend/settings.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@
6060
# the default CKEditor - optional, but used in most projects
6161
'djangocms_text_ckeditor',
6262

63-
'djangocms_picture',
64-
65-
# optional django CMS Bootstrap 4 modules
63+
# optional django CMS frontend modules
6664
'djangocms_frontend',
6765
'djangocms_frontend.contrib.accordion',
6866
'djangocms_frontend.contrib.alert',
@@ -76,6 +74,7 @@
7674
'djangocms_frontend.contrib.link',
7775
'djangocms_frontend.contrib.listgroup',
7876
'djangocms_frontend.contrib.media',
77+
'djangocms_frontend.contrib.icon',
7978
'djangocms_frontend.contrib.image',
8079
'djangocms_frontend.contrib.tabs',
8180
'djangocms_frontend.contrib.utilities',
@@ -221,3 +220,4 @@
221220
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
222221

223222
CMS_CONFIRM_VERSION4 = True
223+
DJANGOCMS_VERSIONING_ALLOW_DELETING_VERSIONS = True

requirements.in

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ whitenoise
1212
easy-thumbnails
1313

1414
# key requirements for django CMS
15-
django-cms==4.1.0rc1
16-
https://github.com/divio/djangocms-versioning/tarball/master#egg=djangocms-versioning
17-
https://github.com/divio/djangocms-alias/tarball/master#egg=djangocms-alias
18-
djangocms-picture
15+
django-cms>=4.1.0rc3
16+
https://github.com/django-cms/djangocms-versioning/tarball/master#egg=djangocms-versioning
17+
https://github.com/django-cms/djangocms-alias/tarball/master#egg=djangocms-alias
1918

2019
# optional, but used in most projects
2120
djangocms-admin-style>=3.2.2

0 commit comments

Comments
 (0)