summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2012-01-20 22:54:51 +0100
committerJannis Leidel <jannis@leidel.info>2012-01-20 22:54:51 +0100
commite23f1f5f18655c7a62a0d32b6d9091986fb02116 (patch)
tree4085c667ec7e1aeda5f5ff25e10956489a1d08da
parent81311fa08f7a18eb08bc4d67a620fe3af27214a7 (diff)
parent188efa4997cf7ff4f2f9057de9bf2cd65cb89aa3 (diff)
downloaddjango-appconf-e23f1f5f18655c7a62a0d32b6d9091986fb02116.tar.gz
Merge branch 'develop' of github.com:jezdez/django-appconf into develop
-rw-r--r--README.rst25
1 files changed, 25 insertions, 0 deletions
diff --git a/README.rst b/README.rst
index 97de9bb..f01ffe0 100644
--- a/README.rst
+++ b/README.rst
@@ -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)
+