Get settings.py through django.conf

The previous "from webodm import settings"  would get the first settings.py
Using django.conf is a better option 
This is discussed in this Stack Overflow topic: https://stackoverflow.com/questions/19976115/whats-the-difference-between-from-django-conf-import-settings-and-import-set
And in the docs: https://docs.djangoproject.com/en/dev/topics/settings/#using-settings-in-python-code
pull/712/head
Gabriel Gadelha 2019-08-02 09:49:43 -03:00 zatwierdzone przez GitHub
rodzic 66deb3809a
commit 9c61e27082
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -14,7 +14,7 @@ from django.http import HttpResponse
from app.models import Plugin
from app.models import Setting
from webodm import settings
from django.conf import settings
logger = logging.getLogger('app.logger')
@ -306,4 +306,4 @@ def versionToInt(version):
try:
return sum([reduce(lambda mult, ver: mult * ver, i) for i in zip([100000, 100, 1], map(int, version.split(".")))])
except:
return -1
return -1