Create gitignore for flask application Create gitignore for flask application flask flask

Create gitignore for flask application


Use Python.gitignore. Flask is a Python project.


Initially, I'd say you will want to include the /__pycache__/ folders in your .gitignore file.

But anything else you may wish to have ignored is incredibly project dependant. It depends on what your Flask app is doing.

You need to ask yourself what exactly your project is doing. Is it storing lists of user details (such as usernames / passwords) somewhere? Then you'll want to keep those details out of git. Are you accessing a database with a user and password and showing how to access confidential information in your database tables? Then you should be making sure none of those end up in a public git repository where just anyone can waltz on in and see how everything you've built has been put together and where they need to go to access all sensitive data stored by your app.

Depending on your goal with your app, maybe you could consider using a private repository?

Without further information on your Flask application, I can't say much more. But this is my response to the matter either way.

Definitely ignore the /__pycache__/ folders generated by Python. After that? It's entirely down to the requirements of your app.