Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Dockerised django CMS project, ready to deploy on Divio or another Docker-based cloud platform, and run locally in Docker on your own machine. A Divio account is not required.

License

NotificationsYou must be signed in to change notification settings

django-cms/django-cms-quickstart

Repository files navigation

pythonapp

django CMS quickstart

  • A dockerised django CMS project intended to be run locally in Docker on your own machine or on a Docker-based cloud, such asDivio
  • This version uses Python 3.11 and the most up-to-date versions of Django 4.2, and django CMS 4.1.0
  • This project is endorsed by thedjango CMS Association. That means that it is officially accepted by the dCA as being in line with our roadmap vision and development/plugin policy. Join us onSlack for more information or questions.
  • The documentation for django CMS can be found here:https://docs.django-cms.org/

Installation

Requirements

You need to have Docker installed on your system to run this project.

Local Setup

git clone git@github.com:django-cms/django-cms-quickstart.gitcd django-cms-quickstartdocker compose build webdocker compose up -d database_defaultdocker compose run --rm web python manage.py migratedocker compose run --rm web python manage.py createsuperuserdocker compose up -d

Then openhttp://django-cms-quickstart.127.0.0.1.nip.io:8000 (or justhttp://127.0.0.1:8000) in your browser.

You can stop the server withdocker compose stop without destroying the containers and restart it withdocker compose start.

Withdocker compose down the containers are deleted, but the database content is still preserved in the namedvolumedjango-cms-quickstart_postgres-data and the media files are stored in the file system indata/media.Then you can update the project e. g. by changing the requirements and settings. Finally you can rebuild the web imageand start the server again:

docker compose build webdocker compose up -d

Note: Since Compose V2,docker-compose is now included inside docker. For more information, checkout theCompose V2 Documentation.

Customising the project

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 usethese; they're optional. If you don't want to use them, read through thesettings.py andrequirements.txt filesto 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 django best practise two step approach, freezing all dependencies with pip-tools. Here is how to update requirements:

  1. Changerequirements.in according to your needs. There is no need to pin the package versions here unless you have a good reason (i.e. known incompatibilities)
  2. Rundocker compose run --rm web pip-compile requirements.in >> requirements.txt
  3. requirements.txt should now have changed
  4. Rebuild the containerdocker compose build web and restartdocker compose up -d

Features

Static Files with Whitenoise

  • 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.
  • See the django-whitenoise settings in settings.py and thequickstart/templates/whitenoise-static-files-demo.html demo page template that serves a static file.

Env variables

  • By default, Docker injects the env vars defined in.env-local into the quickstart project.
  • If you want to access the PostgreSQL database from the host system, setDB_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, butnot from outside.

Contribution

Here is the official django CMS repository:https://github.com/django-cms/django-cms-quickstart/.

Deployment

Note that this is just a demo project to get you started. It is designed to be run locally through docker. If you want a full production ready site with all the bellsand whistles we recommend you have a look athttps://github.com/django-cms/djangocms-template instead.

Some deployment hints:

  • To deploy this project in testing mode (recommended) set the environment variableDEBUG toTrue in your hosting environment.
  • Be aware that ifDEBUG is false, django requires you to whitelist the domain. Set the env varDOMAIN to the host, i.e.www.domain.com or*.domain.com.
  • You can set the env varDEFAULT_STORAGE_DSN to something meaningful (i.e. for s3 file storage)

Deployment Commands

Configure your hosting environment to run the following commands on every deployment:

  • ./manage.py migrate

Divio Deployment

divio.com is a cloud hosting platform optimized for django web applications. It's the quickest way to deploy thisproject. Here is avideo tutorial and adescription of the deployment steps that are mostly applicable for this quickstart project.

About

A Dockerised django CMS project, ready to deploy on Divio or another Docker-based cloud platform, and run locally in Docker on your own machine. A Divio account is not required.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Contributors12


[8]ページ先頭

©2009-2025 Movatter.jp