What the files I need add to .gitignore
in Flask application?
https://www.gitignore.io/ - I'm usually here to look at examples.
But now I found no examples.
Why? Is it a feature of Flask?
Django has a clear structure in the application, but Flask not have, am I right?
You can use gitignore.io, which selects the files to ignore based on the technologies you are using in your project. There are a few of them only for flask. Save this answer.
Git allows you to ignore such files by adding them to the . gitignore file.
__pycache__ is among the directories that shouldn't be pushed to remote repositories. Therefore, all you need to do is specify the directory in . gitignore file.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With