diff options
author | Jannis Leidel <jannis@leidel.info> | 2012-01-20 22:54:51 +0100 |
---|---|---|
committer | Jannis Leidel <jannis@leidel.info> | 2012-01-20 22:54:51 +0100 |
commit | e23f1f5f18655c7a62a0d32b6d9091986fb02116 (patch) | |
tree | 4085c667ec7e1aeda5f5ff25e10956489a1d08da | |
parent | 81311fa08f7a18eb08bc4d67a620fe3af27214a7 (diff) | |
parent | 188efa4997cf7ff4f2f9057de9bf2cd65cb89aa3 (diff) | |
download | django-appconf-e23f1f5f18655c7a62a0d32b6d9091986fb02116.tar.gz |
Merge branch 'develop' of github.com:jezdez/django-appconf into develop
-rw-r--r-- | README.rst | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -67,3 +67,28 @@ In case you want to use a different settings object instead of the default class Meta: prefix = 'acme' holder = 'acme.conf.settings' + +If you ship an ``AppConf`` class with your reusable Django app, it's +recommended to put it in a ``conf.py`` file of you app package and +import ``django.conf.settings`` in it, too:: + + from django.conf import settings + from appconf import AppConf + + class MyAppConf(AppConf): + SETTING_1 = "one" + SETTING_2 = ( + "two", + ) + +In the other files of your app you can easily make sure the settings +are correctly loaded if you import Django's settings object from that +module, e.g. in your app's ``views.py``:: + + from django.http import HttpResponse + from myapp.conf import settings + + def index(request): + text = 'Setting 1 is: %s' % settings.MYAPP_SETTING_1 + return HttpResponse(text) + |