Reputation: 164
This is probably a very dumb question. But I have a little project in Django and I would like to upload it to GitHub to just have it there. I know how GitHub works and I know how to upload the project. But I'm wondering if just uploading the whole folder is the right way to do it. I mean. I have a data base with my project, that has some information. So is the database JUST in my computer right? It won't get uploaded next to the project to github?
So basically I'm asking:
Upvotes: 5
Views: 3577
Reputation: 2380
Don't push your settings.py
into a repository, because it has some important information about your application such as SECRET_KEY
OR DATABASE
.
It’s important to keep your application credentials like API Keys, Amazon S3, email parameters, database parameters safe, specially if it’s an open source repository.
You need to make sure that these kind of information will be stored in a secure place and don't push it into a public repository.
There are more files that you shouldn't push into your repository. check out this link to know more about .gitignore
files in Django projects. also there is a website that you can create your .gitignore
files automatically.
Now if you want to know more about how to store these kind of informations you can use environment variables
and also there is a package called python-decouple that you can use it for storing your important informations.
Upvotes: 4