0

I am creating a portable Django server that will be used by different people on separate servers.

Am I able to create dynamic settings for each user that they can change?

For example Time Zone: instead of having TIME_ZONE = "America/New_York" in settings.py, can I have a settings page that allows them to update the configuration of the Django settings without them actually accessing the server?

I also want to use this with Cors Headers for the CSRF_TRUSTED_ORIGINS = [] setting.

Thank you.

grantjay
  • 100
  • 6
  • The suggestion is to store the settings as a model and then allow the user to update them. This is the approach I was thinking, just wasn't sure if that was the correct approach – grantjay Jan 03 '21 at 21:38
  • 1
    Depends how you mean 'used'. But if you are deploying on separate servers, the easiest way would just be to use environment variables to apply different settings. – tim-mccurrach Jan 03 '21 at 22:46
  • 1
    @grantjay depens whats the goal - deployment, then evn variables as tim said. but if its for example in the sense of a "social community" then it makes sense to go by default of the server settings and the neach user, if they want to have their own overrides you would exactly do that, have a model and each user has either an entry to override the servers default or nothing. This way yo ucan have different settings for each user. you might need to write some wrapper functions which check first the settings for any override - otherwise go of the servers default. What are your thoughts on this? – Tomek Jan 03 '21 at 23:42
  • @Tomek This is the route that I will go - Thank you for your help – grantjay Jan 04 '21 at 00:01

0 Answers0