aldryn-django


Namealdryn-django JSON
Version 4.2.9.0 PyPI version JSON
download
home_pagehttps://github.com/divio/aldryn-django
SummaryAn opinionated Django setup bundled as an Aldryn Addon
upload_time2024-01-02 13:29:04
maintainer
docs_urlNone
authorDivio AG
requires_python
licenseBSD-3-Clause
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            =============
Aldryn Django
=============

|pypi| |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 <https://support.divio.com/general/faq/essential-knowledge-what-is-aldryn>`_.


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
<http://docs.django-cms.org/en/latest/contributing/index.html>`_.

We're grateful to all contributors who have helped create and maintain this package.
Contributors are listed at the `contributors <https://github.com/divio/aldryn-django/graphs/contributors>`_
section.


Documentation
=============

See ``REQUIREMENTS`` in the `setup.py <https://github.com/divio/aldryn-django/blob/master/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:

.. important::

    Please follow the setup instructions for installing
    ``aldryn-addons`` first!


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\"]"
    }

.. Note:: The need to manually copy ``aldryn_config.py`` and ``addon.json`` is
          due to legacy compatibility with the Divio Cloud platform and will no
          longer be necessary in a later release of aldryn-addons.


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


.. |pypi| image:: https://badge.fury.io/py/aldryn-django.svg
    :target: http://badge.fury.io/py/aldryn-django
.. |build| image:: https://github.com/divio/aldryn-django/actions/workflows/default.yml/badge.svg?branch=support/4.2.x
    :target: https://github.com/divio/aldryn-django/actions
.. |coverage| image:: https://codecov.io/gh/divio/aldryn-django/branch/support/4.2.x/graph/badge.svg
    :target: https://codecov.io/gh/divio/aldryn-django

.. |python| image:: https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%C2%A03.10-blue.svg
    :target: https://pypi.org/project/aldryn-django/
.. |django| image:: https://img.shields.io/badge/django-4.2-blue.svg
    :target: https://www.djangoproject.com/



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/divio/aldryn-django",
    "name": "aldryn-django",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Divio AG",
    "author_email": "info@divio.ch",
    "download_url": "https://files.pythonhosted.org/packages/4b/79/0a9392e0a43791e2d332bdf4ae6c78f94c049a461e2e94a63f3647e80d51/aldryn-django-4.2.9.0.tar.gz",
    "platform": null,
    "description": "=============\nAldryn Django\n=============\n\n|pypi| |build| |coverage|\n\nAn opinionated Django setup bundled as a Divio Cloud addon.\n\nThis package will auto configure Django, including admin and some other basic\npackages. It also handles sane configuration of the database connection and\nstatic and media files.\n\nThe goal is to keep the footprint inside the Django website project as small\nas possible, so updating things usually just means bumping a version in\n``requirements.txt`` and no other changes in the project.\n\nThis addon still uses the legacy \"Aldryn\" naming. You can read more about this in our\n`support section <https://support.divio.com/general/faq/essential-knowledge-what-is-aldryn>`_.\n\n\nContributing\n============\n\nThis is a an open-source project. We'll be delighted to receive your\nfeedback in the form of issues and pull requests. Before submitting your\npull request, please review our `contribution guidelines\n<http://docs.django-cms.org/en/latest/contributing/index.html>`_.\n\nWe're grateful to all contributors who have helped create and maintain this package.\nContributors are listed at the `contributors <https://github.com/divio/aldryn-django/graphs/contributors>`_\nsection.\n\n\nDocumentation\n=============\n\nSee ``REQUIREMENTS`` in the `setup.py <https://github.com/divio/aldryn-django/blob/master/setup.py>`_\nfile for additional dependencies:\n\n|python| |django|\n\n\nInstallation\n------------\n\nNothing to do. ``aldryn-django`` is part of the Divio Cloud platform.\n\nFor a manual install:\n\n.. important::\n\n    Please follow the setup instructions for installing\n    ``aldryn-addons`` first!\n\n\nAdd ``aldryn-django`` to your projects ``requirements.txt`` or pip install it.\n\nThe version is made up of the Django release with an added digit for the\nrelease version of this package itself.\n\nIf you followed the ``aldryn-addons`` installation instructions, you should\nalready have a ``ALDRYN_ADDONS`` setting. Add ``aldryn-django`` to it::\n\n    INSTALLED_ADDONS = [\n        'aldryn-django',\n    ]\n\nCreate the ``addons/aldryn-django`` directory at the same level as your\n``manage.py``. Then copy ``addon.json``, ``aldryn_config.py`` from\nthe matching sourcecode into it.\n\nAlso create a ``settings.json`` file in the same directory with the following\ncontent::\n\n    {\n        \"languages\": \"[\\\"en\\\", \\\"de\\\"]\"\n    }\n\n.. Note:: The need to manually copy ``aldryn_config.py`` and ``addon.json`` is\n          due to legacy compatibility with the Divio Cloud platform and will no\n          longer be necessary in a later release of aldryn-addons.\n\n\nConfiguration\n-------------\n\naldryn-django comes with entrypoints for ``manage.py`` and ``wsgi.py``. This\nmakes it possible to just have a small snippet of code in the website project\nthat should never change inside those files. The details of local project\nsetup (e.g reading environment variables from a ``.env`` file) are then up to\nthe currently installed version of ``aldryn-django``. Also other opinionated\nthings can be done, like using a production-grade wsgi middleware to serve\nstatic and media files.\n\n\nPut this in manage.py::\n\n    #!/usr/bin/env python\n    import os\n    from aldryn_django import startup\n\n\n    if __name__ == \"__main__\":\n        startup.manage(path=os.path.dirname(os.path.abspath(__file__)))\n\n\nput this in wsgi.py::\n\n    import os\n    from aldryn_django import startup\n\n\n    application = startup.wsgi(path=os.path.dirname(__file__))\n\n\nAPIs\n----\n\nMigrations\n**********\n\nTo run migrations, call the command ``aldryn-django migrate``. This will run\na series of commands for the migration stage of a project.\n\n``aldryn-django`` will run ``python manage.py migrate``. But any addon\ncan add stuff to this migration step by appending commands to the ``MIGRATION_COMMANDS``\nsetting. For example ``aldryn-cms`` (django-cms as an Addon) will run\n``python manage.py cms fix-tree`` at the migration stage.\n\n\nProduction Server\n*****************\n\nCalling ``aldryn-django web`` will start an opinionated Django setup for\nproduction (currently uWSGI based).\n\n\nRunning Tests\n-------------\n\nYou can run tests by executing::\n\n    virtualenv env\n    source env/bin/activate\n    pip install -r tests/requirements.txt\n    python setup.py test\n\n\n.. |pypi| image:: https://badge.fury.io/py/aldryn-django.svg\n    :target: http://badge.fury.io/py/aldryn-django\n.. |build| image:: https://github.com/divio/aldryn-django/actions/workflows/default.yml/badge.svg?branch=support/4.2.x\n    :target: https://github.com/divio/aldryn-django/actions\n.. |coverage| image:: https://codecov.io/gh/divio/aldryn-django/branch/support/4.2.x/graph/badge.svg\n    :target: https://codecov.io/gh/divio/aldryn-django\n\n.. |python| image:: https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%C2%A03.10-blue.svg\n    :target: https://pypi.org/project/aldryn-django/\n.. |django| image:: https://img.shields.io/badge/django-4.2-blue.svg\n    :target: https://www.djangoproject.com/\n\n\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "An opinionated Django setup bundled as an Aldryn Addon",
    "version": "4.2.9.0",
    "project_urls": {
        "Homepage": "https://github.com/divio/aldryn-django"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "73fd5b590026273205c422d41b5f4b7655727ffc9b1d834cef1cb85e0a4b9056",
                "md5": "f9207136a9feb7590013e31cfc0335c9",
                "sha256": "f4e7f609d220d63e911122ed03d21631f093990419c34545ae843c71379ecd45"
            },
            "downloads": -1,
            "filename": "aldryn_django-4.2.9.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f9207136a9feb7590013e31cfc0335c9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 17632,
            "upload_time": "2024-01-02T13:29:00",
            "upload_time_iso_8601": "2024-01-02T13:29:00.909703Z",
            "url": "https://files.pythonhosted.org/packages/73/fd/5b590026273205c422d41b5f4b7655727ffc9b1d834cef1cb85e0a4b9056/aldryn_django-4.2.9.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4b790a9392e0a43791e2d332bdf4ae6c78f94c049a461e2e94a63f3647e80d51",
                "md5": "a574ac04af92758082a394219bd6da00",
                "sha256": "7f9046eaf67a6ff3d4c95da474d76b3ff1f538b959f3a8f7c08a27c116f4379f"
            },
            "downloads": -1,
            "filename": "aldryn-django-4.2.9.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a574ac04af92758082a394219bd6da00",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 16020,
            "upload_time": "2024-01-02T13:29:04",
            "upload_time_iso_8601": "2024-01-02T13:29:04.653057Z",
            "url": "https://files.pythonhosted.org/packages/4b/79/0a9392e0a43791e2d332bdf4ae6c78f94c049a461e2e94a63f3647e80d51/aldryn-django-4.2.9.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-02 13:29:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "divio",
    "github_project": "aldryn-django",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "aldryn-django"
}
        
Elapsed time: 0.28145s