Package: aldryn-django
An opinionated Django setup bundled as a Divio Cloud addon.This package will auto configure Django, including admin and some other basic
packages. It also handles sane configuration of the database connection and
static and media files.The goal is to keep the footprint inside the Django website project as small
as possible, so updating things usually just means bumping a version inrequirements.txtand no other changes in the project.This addon still uses the legacy “Aldryn” naming. You can read more about this in oursupport section.ContributingThis is a an open-source project. We’ll be delighted to receive your
feedback in the form of issues and pull requests. Before submitting your
pull request, please review ourcontribution guidelines.We’re grateful to all contributors who have helped create and maintain this package.
Contributors are listed at thecontributorssection.DocumentationSeeREQUIREMENTSin thesetup.pyfile for additional dependencies:InstallationNothing to do.aldryn-djangois part of the Divio Cloud platform.For a manual install:ImportantPlease follow the setup instructions for installingaldryn-addonsfirst!Addaldryn-djangoto your projectsrequirements.txtor pip install it.The version is made up of the Django release with an added digit for the
release version of this package itself.If you followed thealdryn-addonsinstallation instructions, you should
already have aALDRYN_ADDONSsetting. Addaldryn-djangoto it:INSTALLED_ADDONS = [
    'aldryn-django',
]Create theaddons/aldryn-djangodirectory at the same level as yourmanage.py. Then copyaddon.json,aldryn_config.pyfrom
the matching sourcecode into it.Also create asettings.jsonfile in the same directory with the following
content:{
    "languages": "[\"en\", \"de\"]"
}NoteThe need to manually copyaldryn_config.pyandaddon.jsonis
due to legacy compatibility with the Divio Cloud platform and will no
longer be necessary in a later release of aldryn-addons.Configurationaldryn-django comes with entrypoints formanage.pyandwsgi.py. This
makes it possible to just have a small snippet of code in the website project
that should never change inside those files. The details of local project
setup (e.g reading environment variables from a.envfile) are then up to
the currently installed version ofaldryn-django. Also other opinionated
things can be done, like using a production-grade wsgi middleware to serve
static and media files.Put this in manage.py:#!/usr/bin/env python
import os
from aldryn_django import startup


if __name__ == "__main__":
    startup.manage(path=os.path.dirname(os.path.abspath(__file__)))put this in wsgi.py:import os
from aldryn_django import startup


application = startup.wsgi(path=os.path.dirname(__file__))APIsMigrationsTo run migrations, call the commandaldryn-djangomigrate. This will run
a series of commands for the migration stage of a project.aldryn-djangowill runpython manage.py migrate. But any addon
can add stuff to this migration step by appending commands to theMIGRATION_COMMANDSsetting. For examplealdryn-cms(django-cms as an Addon) will runpython manage.py cmsfix-treeat the migration stage.Production ServerCallingaldryn-djangowebwill start an opinionated Django setup for
production (currently uWSGI based).Running TestsYou can run tests by executing:virtualenv env
source env/bin/activate
pip install -r tests/requirements.txt
python setup.py test