Skip to main content

An opinionated Django setup bundled as an Aldryn Addon

Project description

build coverage

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 in requirements.txt and no other changes in the project.

This addon still uses the legacy “Aldryn” naming. You can read more about this in our support section.

Contributing

This 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 our contribution guidelines.

We’re grateful to all contributors who have helped create and maintain this package. Contributors are listed at the contributors section.

Documentation

See REQUIREMENTS in the setup.py file for additional dependencies:

python django

Installation

Nothing to do. aldryn-django is part of the Divio Cloud platform.

For a manual install:

Add aldryn-django to your projects requirements.txt or 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 the aldryn-addons installation instructions, you should already have a ALDRYN_ADDONS setting. Add aldryn-django to it:

INSTALLED_ADDONS = [
    'aldryn-django',
]

Create the addons/aldryn-django directory at the same level as your manage.py. Then copy addon.json, aldryn_config.py from the matching sourcecode into it.

Also create a settings.json file in the same directory with the following content:

{
    "languages": "[\"en\", \"de\"]"
}

Configuration

aldryn-django comes with entrypoints for manage.py and wsgi.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 .env file) are then up to the currently installed version of aldryn-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__))

APIs

Migrations

To run migrations, call the command aldryn-django migrate. This will run a series of commands for the migration stage of a project.

aldryn-django will run python manage.py migrate. But any addon can add stuff to this migration step by appending commands to the MIGRATION_COMMANDS setting. For example aldryn-cms (django-cms as an Addon) will run python manage.py cms fix-tree at the migration stage.

Production Server

Calling aldryn-django web will start an opinionated Django setup for production (currently uWSGI based).

Running Tests

You can run tests by executing:

virtualenv env
source env/bin/activate
pip install -r tests/requirements.txt
python setup.py test

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aldryn-django-3.2.17.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aldryn_django-3.2.17.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file aldryn-django-3.2.17.0.tar.gz.

File metadata

  • Download URL: aldryn-django-3.2.17.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.8.5

File hashes

Hashes for aldryn-django-3.2.17.0.tar.gz
Algorithm Hash digest
SHA256 6c8311866ee2b266901338cb48e8538e18abf0d1b1761dd8eb0dd00ae42cdf0b
MD5 179751f3dead79794dc81e6689cf4e12
BLAKE2b-256 6cef9491c16a3ef2c3ef8d67e77b52dd803a9a173f8892cb8a8323d71bfe3aea

See more details on using hashes here.

File details

Details for the file aldryn_django-3.2.17.0-py3-none-any.whl.

File metadata

  • Download URL: aldryn_django-3.2.17.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.8.5

File hashes

Hashes for aldryn_django-3.2.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01302ed3f624f8e193db099f37d3f4057a870ef7a5bf8415f081978cb00dab21
MD5 1cb3988735f66aca780656d67b543bf3
BLAKE2b-256 26419254be932500567130a6aed2669234e4cabb0c0d6af7dd0981cfc03041a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page