Prevent website users to access files in directory of a flask app

Viewed 140

I have just deployed my first flask app, however, I have found out that it is really easy to download all the code I spent so long writing. For example, if my app was app.com, users can simply go to the website /app.py and my app.py would get automatically downloaded. Same for the passenger_wsgi.py and every other folder short of a db.

How can I disable that without compromising the integrity of my flask app?

0 Answers
Related