Answer the question
In order to leave comments, you need to log in
Is there a way to access variables in settings.py from jquery?
Tell me, how can I access the variables described in the settings.py of the project from jquery (javascript)?
Answer the question
In order to leave comments, you need to log in
Certainly. Make a service in views.py that will be called using jquery and return json with the values of the necessary variables from settings.py. Extract variable values using python. You can google how to do this, for example, on request: django get variable from settings
You can pull them out via AJAX or display these values beforehand with python on the page in js variables (as you usually output HTML), and then read their values. But, of course, important configs (passwords and appearances) cannot be given away like that.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question