{ "info": { "author": "Thomas Power", "author_email": "thomaspwr@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "===========\ndjango-envi\n===========\n\n.. contents:: Table of contents\n\n\nIntroduction\n============\n\nLightweight set of middleware classes that inject visual indicators for\neach type of environment that a project is deployed to. Inspired by\n`this article`_.\n\n.. _this article: https://goo.gl/7cLsOH\n\n.. image:: https://i.imgur.com/flSPk7w.png\n\n\nQuickstart\n==========\n\n1. Install the package: ``pip install django-envi``.\n2. Add the ``'envi'`` app to your ``INSTALLED_APPS``.\n3. Install the desired middleware class to ``MIDDLEWARE_CLASSES``:\n\n * ``envi.middleware.EnviFooterMiddleware`` injects a sticky footer to\n all pages that displays the current environment.\n\n4. In each environment's settings file, add the ``ENVIRONMENT_KEY`` setting,\n with the corresponding environment key string. See below.\n\n\nBuilt-in environments\n=====================\n\nThere are a number of built-in environment definitions:\n\n* ``'local'``: A striped grey banner. Appears site-wide (default).\n\n* ``'dev'``: A striped blue banner. Appears site-wide.\n\n* ``'staging'``: A striped yellow banner. Appears site-wide.\n\n* ``'production'``: A striped red banner. Only appears in ``/admin``.\n\n\nConfiguration\n=============\n\nThe following settings are supported in your ``settings.py``:\n\n* ``ENVI_ENVIRONMENT_KEY``: A string representing the key to use to search\n the ``ENVI_ENVIRONMENTS`` settings dictionary. Defaults to ``'local'``.\n\n* ``ENVI_ENVIRONMENTS``: A dictionary containing key-value pairs consisting\n of environment keys (as strings) mapped to dictionaries representing an\n environment definition. By default, there are 4 `built-in environments`_\n available for selection.\n\n* ``ENVI_ENVIRONMENT``: The current environment. This can either be defined\n explicitly (see `Creating environments`_), otherwise it will be set to the\n corresponding dictionary by looking up the ``ENVI_ENVIRONMENT_KEY`` within\n the ``ENVI_ENVIRONMENTS`` dictionary.\n\nCreating environments\n=====================\n\nEnvironments can be created using the following dictionary structure:\n\n.. code-block:: python\n\n CUSTOM_ENV = {\n # Required for all subclasses of EnviBaseMiddleware.\n \"SHOW_IN_ADMIN\": True,\n \"SHOW_IN_SITE\": True,\n\n # Only required for subclasses of EnviBaseTemplateMiddleware.\n \"CONTEXT\": {\n # The contents of this dictionary will be passed to the template\n # being rendered. You can add anything you want here.\n \"CONTENT\": \"ENVIRONMENT: STAGING\",\n \"COLOR_A\": \"#ffba1e\",\n \"COLOR_B\": \"#dba11a\",\n },\n }\n\nThen, this environment definition can be either:\n\n* Added to the ``ENVI_ENVIRONMENTS`` dictionary, and activated by setting\n the ``ENVI_ENVIRONMENT_KEY`` to the respective key.\n\n .. code-block:: python\n\n ENVI_ENVIRONMENTS = {\n \"custom_key_1\": CUSTOM_ENV,\n \"custom_key_2\": OTHER_CUSTOM_ENV,\n }\n\n ENVI_ENVIRONMENT_KEY = \"custom_key_1\"\n\n* Used to set the ``ENVI_ENVIRONMENT`` value directly.\n\n .. code-block:: python\n\n ENVI_ENVIRONMENT = CUSTOM_ENV\n\n\nAdvanced usage\n==============\n\nThe implementation of ``django-envi`` makes it easy to customize.\n\n\nExtending via templates\n-----------------------\n\nTODO: How to.\n\n\nExtending via subclassing\n-------------------------\n\nTODO: How to.\n\n\nCompatability\n=============\n\nThe latest build of ``django-envi`` has been tested on the following\nversions of Django:\n\n* ``2.0.1``\n\n* ``1.11.9 (LTS)``\n\n* ``1.8.18 (LTS)``\n\n\nChangelog\n=========\n\n+----------------+-----------------------------------------------------------+\n| Version | Description |\n+================+===========================================================+\n| 0.2.1 | Bugfix to prevent adding the banner to AJAX requests. |\n| | Thanks to @marksweb for the PR. Also adds backwards |\n| | compatability for Django versions < 1.10. |\n+----------------+-----------------------------------------------------------+\n| 0.2 | Repackaged without unnecessary docs/images directory. All |\n| | documentation can be found in README.rst. |\n+----------------+-----------------------------------------------------------+\n| 0.1.2 | Fixes reference to nonexistent template. Manifest issue. |\n+----------------+-----------------------------------------------------------+\n| 0.1.1 | Renamed to django-envi. |\n+----------------+-----------------------------------------------------------+\n| 0.1 | Initial version. |\n+----------------+-----------------------------------------------------------+\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/teapow/django-envi", "keywords": "", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "django-envi", "package_url": "https://pypi.org/project/django-envi/", "platform": "", "project_url": "https://pypi.org/project/django-envi/", "project_urls": { "Homepage": "https://github.com/teapow/django-envi" }, "release_url": "https://pypi.org/project/django-envi/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "Lightweight set of middleware classes that inject visual indicators for each type of environment that a project is deployed to.", "version": "0.2.1" }, "last_serial": 3482464, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "ab994191335e0b1096fd5e4d393003d3", "sha256": "e8f5fcbf0c50f75a5e104fa69a2e201ce2e00a12ac590fce5ea9055038ba2b12" }, "downloads": -1, "filename": "django-envi-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ab994191335e0b1096fd5e4d393003d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 102348, "upload_time": "2017-08-16T17:46:08", "url": "https://files.pythonhosted.org/packages/24/be/e4f9f409f17012fdec16b15baaff1c0d6dadff19d2d187af46a02e85b76d/django-envi-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "068a15753016ae9539c21cfcaf24b4e7", "sha256": "b19151478351d01688dc0f221215220cb3a144e9571816c0264d748c312c9ab2" }, "downloads": -1, "filename": "django-envi-0.1.2.tar.gz", "has_sig": false, "md5_digest": "068a15753016ae9539c21cfcaf24b4e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 102846, "upload_time": "2017-08-16T17:49:01", "url": "https://files.pythonhosted.org/packages/a2/49/b10be0db29f624023e4b49c3fdf0c8b682b92c8ebbd29c40079185208ff8/django-envi-0.1.2.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "ea3eec3105629afd8cdf08c4803db10b", "sha256": "50d62de6739bd833b49a0c658c9dd5e03be6ca8c689dd9bd9d1a5494895c8390" }, "downloads": -1, "filename": "django-envi-0.2.tar.gz", "has_sig": false, "md5_digest": "ea3eec3105629afd8cdf08c4803db10b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4422, "upload_time": "2017-08-16T21:07:35", "url": "https://files.pythonhosted.org/packages/d1/52/c45d99a6293609e3a32bb6d07e9c34f24aa604e24a4fa4f25c16597f5844/django-envi-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "cf073ca9b36b98a6f5d8d3423fe2628c", "sha256": "21ad64840d15960927449e531869322a75d52d2f00a551d2f88773b53278d2e0" }, "downloads": -1, "filename": "django-envi-0.2.1.tar.gz", "has_sig": false, "md5_digest": "cf073ca9b36b98a6f5d8d3423fe2628c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6055, "upload_time": "2018-01-11T23:49:05", "url": "https://files.pythonhosted.org/packages/e7/1b/4c2b9bdbd42fe636c9623bf08ae2a3af4d37be97ddc3bf374490e6804384/django-envi-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cf073ca9b36b98a6f5d8d3423fe2628c", "sha256": "21ad64840d15960927449e531869322a75d52d2f00a551d2f88773b53278d2e0" }, "downloads": -1, "filename": "django-envi-0.2.1.tar.gz", "has_sig": false, "md5_digest": "cf073ca9b36b98a6f5d8d3423fe2628c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6055, "upload_time": "2018-01-11T23:49:05", "url": "https://files.pythonhosted.org/packages/e7/1b/4c2b9bdbd42fe636c9623bf08ae2a3af4d37be97ddc3bf374490e6804384/django-envi-0.2.1.tar.gz" } ] }