Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure django-environ (do this after implementing local_settings from Heroku tutorial) #27

Open
11 tasks
webknjaz opened this issue Jun 12, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@webknjaz
Copy link
Member

webknjaz commented Jun 12, 2020

The math

Read about the usage of environment variables in PaaS and heroku/travis for deployment.

Ref: https://12factor.net/

The task

  • Implement single settings.py using django-environ
    • Remove everything related to local_settings.py
  • Make every option differing at development and production be read from environment variables
    • DEBUG
    • SECRET
    • db config
    • use env.Path for constructing fs pathes
    • etc.
  • Enable reading env vars from dotenv (.env) file
    • .gitignore it
    • add .env.example file listing required env vars with dummy values for the other dev as a quickstart
@webknjaz webknjaz added the enhancement New feature or request label Jun 12, 2020
@slsh1o
Copy link
Contributor

slsh1o commented Jun 17, 2020

@webknjaz I don't understend why do I need local_settings.py file if I can put everything in .env file? Or I missing out something?

Or by Remove everything related to local_settings.py you mean that I should also remove local_settings.py file and switch to django-environ with .env file?

@webknjaz
Copy link
Member Author

Yes, you should remove local_settings.py when migrating to .env. But the previous step is completing the Heroku task that adds it. This gives you a chance to compare the approaches.

@webknjaz
Copy link
Member Author

I should've probably added an issue with https://tutorial-extensions.djangogirls.org/en/heroku/ first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants