You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.10 running and the most up-to-date versions of Django 3.2, and django CMS 4.1.0rc1
This version uses Python 3.11 and the most up-to-date versions of Django 3.2, and django CMS 4.1.0rc3
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.
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.
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/
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/
Installation
############
You need to have docker installed on your system to run this project.
You need to have Docker installed on your system to run this project.
- If you have not used docker in the past, please read this `introduction on docker <https://docs.docker.com/get-started/>`_ here.
- If you have not used docker in the past, please read this
`introduction on docker <https://docs.docker.com/get-started/>`_ here.
Try it
######
Expand All
@@ -38,7 +43,22 @@ Try it
Then open http://django-cms-quickstart.127.0.0.1.nip.io:8000 (or just http://127.0.0.1:8000) in your browser.
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.
You can stop the server with ``docker compose stop`` without destroying the containers and restart it with
``docker compose start``.
With ``docker compose down`` the containers are deleted, but the database content is still preserved in the named
volume ``django-cms-quickstart_postgres-data`` and the media files are stored in the file system in ``data/media``.
Then you can update the project e. g. by changing the requirements and settings. Finally you can rebuild the web image
and start the server again:
.. code-block:: bash
docker compose build web
docker compose up -d
Note: Since Compose V2, ``docker-compose`` is now included inside docker. For more information, checkout the
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
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'.
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'.
Options are also available for using Postgres/MySQL, uWSGI/Gunicorn/Guvicorn, etc.
Updating requirements
=====================
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/
The project uses a 2 step approach, freezing all dependencies with pip-tools. Read more about how to handle it here:
This quickstart demo has a cloud-ready static files setup via django-whitenoise.
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.
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.
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.
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.
Contribution
############
Here is the official django CMS repository: `https://github.com/django-cms/django-cms-quickstart/ <https://github.com/django-cms/django-cms-quickstart/>`_.
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.
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.
Env variables
=============
- to deploy this project in testing mode (recommended) set the environment variable ``DEBUG`` to ``True`` in your hosting environment.
- 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``.
- to deploy this project in testing mode (recommended) set the environment variable ``DEBUG`` to ``True`` in your
hosting environment.
- 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``.
- If you want the media hosted on S3 set the ``DEFAULT_FILE_STORAGE`` variable accordingly.
- If you want to access the PostgreSQL database from the host system, set ``DB_PORT`` to the desired port number.
5432 is the standard port number. If you run PosgreSQL on your host system, you may want to set another port number.
If this variable is empty (the default), the PosgreSQL instance in the container is only reachable within docker, but
not from outside.
Deployment Commands
===================
Expand All
@@ -99,7 +131,9 @@ Configure your hosting environment to run the following commands on every deploy
Divio Deployment
================
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.