Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django: how to extend settings.py?

Tags:

django

Is this code correct?

from django.conf import settings
settings.TEMPLATE_CONTEXT_PROCESSORS += ['portal.context_processors.login_form_processor']

I want to add one more value to the dictionary of project settings, just for one application only =)

like image 495
holms Avatar asked Dec 06 '25 03:12

holms


1 Answers

You should import local settings module

import settings
settings.TEMPLATE_CONTEXT_PROCESSORS += ['portal.context_processors.login_form_processor']
like image 137
H1D Avatar answered Dec 08 '25 18:12

H1D