August 2016
Beginner to intermediate
717 pages
15h 24m
English
This recipe will show you how to define settings for your app that can be then overwritten in your project's settings.py or local_settings.py file. This is useful especially for reusable apps.
Either create your Django app manually or using the following command:
(myproject_env)$ django-admin.py startapp myapp1
If you just have one or two settings, you can use the following pattern in your models.py file. If the settings are extensive and you want to have them organized better, create an app_settings.py file in the app and put the settings in the following way:
# models.py or app_settings.py # -*- coding: UTF-8 -*- from __future__ import unicode_literals from django.conf import settings ...Read now
Unlock full access