piratar / wasa2il

Direct democracy system
https://x.piratar.is
Other
28 stars 16 forks source link

Single settings file, using ENV vars #225

Closed viktorsmari closed 5 years ago

viktorsmari commented 5 years ago

Working on #212

viktorsmari commented 5 years ago

@helgihg @smari @BjarniRunar @bjornlevi

Should we default to using mysql or postgres for the database? Anyone can override easily with ENV vars, just thinking about what should be default.

helgihg commented 5 years ago

@viktorsmari I don't have a strong opinion on it. I'd choose MySQL just because that's what the only known production setup uses. Also I guess more people are already familiar with MySQL than Postgresql. I readily accept these not being particularly strong arguments, but that's why I don't really have a strong opinion on it. :) I wouldn't protest either way.

viktorsmari commented 5 years ago

This PR is ready, it would be nice if someone would review it :) It needs to be tested running 'normally' (virtualenv) and using Docker

To use Docker, follow the README or do docker-compose up If mysql container has not started in time, resulting in a Django error, do: docker-compose restart wasaweb

Visit http://localhost:8000

viktorsmari commented 5 years ago

For non-docker environments, we can add this package, which also reads a .env file. https://github.com/joke2k/django-environ

That means in non-docker production environment you put your secrets in a .env, which is gitignored, instead of having to write them in the settings file, or exposing them on the host OS env vars

smari commented 5 years ago

Merging this after talking with @viktorsmari; I think this is a step forward. It may require some fiddling with their .env for those who have a nice setup at the moment, but it's time to cross that Rubicon.