Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Django uploading to Github, any important variables besides secret_key to keep a secret/protect?

I’m new to Django just started learning it today, since I am quite proficient in express/nodejs and mongodb, I know there are some variables that one should not push to github as they can contain passwords and other identifying information. On express/node I create a .env file and add it to my .gitignore, typically containing the password to my mongodb connection.

I am about to push my first Django api project to github and want to know if there are any other information besides the "SECRET_KEY" that I should protect. Also is .env file still the best way to protect it in Django. Furthermore I have my Django project within a ll_env-virtual environment should it make a difference.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Besides SECRET_KEY there are some other variables like:

  • Database credentials (PASSWORD, etc)
  • If hosted on any cloud providers, their secret keys (AWS_SECRET_KEY)
  • If using Email service, there will be your mail specific password and etc.

In short every variables that you think are to be secured should be stored in a .env file.

Also for the ease of development and production you can store Debug variable.

Basically .env file contains the individual user environment variables when collaborative working. This article by djangocentral may help you know more.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading