Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > HTTP (WWW)

    django-extraconfig 0.1.1

    Download button

    No screenshots available
    Downloads: 98  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Sever Banesiu | More programs
    BSD License / FREE
    September 28th, 2011, 09:22 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    django-extraconfig description

    An entry-point based solution to extend the Django configuration

    django-extraconfig is a Django app that allows to easily extend a Django project settings.py file. The only function provided by this module is load_extraconfig(entry_point_name, module_name).

    extraconfig.load(entry_point_name, module_name)
     Loads all uppercase values from the entry point modules into the module with the name module_name overriding any existing values.

    Usage

    At the bottom of your settings.py file add:

    try:
     import extraconfig
    except ImportError:
     pass
    else:
     extraconfig.load(< entry_point_name >, __name__)


    entry_point_name can be any string value but it's a good practice to include the projectname in order to avoid name collisions. For example to load the extra configuration showed below, entry_point_name should be set to "my_project.extraconfig".

    Creating an extra configuration

    It's easy to create an extra configuration module. The minimal project layout is composed of two files: setup.py and the module file. The module will be installed using the setup.py file just like any other regular Python module. In order for django-extraconfig to know that this module should be used to override your Django configuration in setup.py you must add it in the entry point config.

    A minimal setup.py file can look like this:

    from setuptools import setup

    setup(
     name='my_extra_config',
     version='0.1',
     py_modules=['my_extra_config'],
     entry_points = {
     'my_project.extraconfig': 'main = my_extra_config'
     }
    )


    Now you can add a my_extra_config.py file with the settings you want to override:

    DEBUG = True

    Installing the extra configuration

    Once the extra configuration project is ready you can run:

    python setup.py develop

    This will install the extra configuration module in development mode, meaning you can edit the extra settings and all the changes will be visible without reinstalling it.


    Product's homepage

    Requirements:

    · Python
    · Django

      


    TAGS:

    Django configuration | extended configuration | Django settings | Django | configuration | extend

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM