Override settings from another Django app

Tags: django python
By : Doadc
Source: Stackoverflow.com
Question!

How can I in my project settings.py override a setting from an apps settings.py?

I tried importing it like this:

import app.settings
EXTENSIONS = {
    'Folder': [''],
    'Image': ['.jpg', '.jpeg', '.gif', '.png', '.tif', '.tiff', '.svg'],
}

But I get an error:

django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

How can I override settings from another app?

By : Doadc


Answers

Your SECRET_KEY is empty or missing in settings.py file.

Add random generated SECRET_KEY to settings file.

For example:

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '[email protected]+d7(tr%i=3cax!bz+0vyje%$!gj+*dvd4'


I think what you're looking for is:

from app.settings import *

The goal is to import the settings into the module namespace.



You can add (almost) 180 before the modulus, and subtract it later.

Not exactly 180 because then you would get -180 instead of 180.

var val = 0;
for(var i=0; i<8; ++i) {
  console.log(val = (val + 90 + 179) % 360 - 179);
}

By : Oriol


This video can help you solving your question :)
By: admin