Forums

How to make a specific folder accessible to public?

Hello, Python noob here, trying to make it easy for my colleagues to access the csv files in a specific folder and sub-folders on my PythonAnywhere account.

e.g. every day my script will update the csv files in https://www.pythonanywhere.com/user/username/files/home/username/data_folder - how can I make it easy for an outsider to access the csv files in that folder, but not any other folders?

I know there are plenty of ways to do this (e.g. dropbox export, file emails, FTP upload, web app etc.) but wanted to check first if there was a simpler way to share file contents...

Thanks for your help and suggestions

We haven't got anything built-in, but knocking together a simple web app might be the way to go?

You'd need one view that's in charge of doing a listing of available files, and then you could serve the actual files as static files, using hyperlinks, if you set up a static path on your web app tab...

Happy to help if you need!

For directory listing you'd have to build your own web app like Harry says; i.e. dynamically building a web page displaying links to the files . Someone has probably made this already, if you google for it.

Individual files can be made public available if you put them in a "static" directory, or a subfolder thereof. But you'd have to know the file name (link). Such as this: http://jansimple.pythonanywhere.com/static/bomstasjoner.csv If you don't know the link, or can construct a valid link based on file naming conventions -- then your file will be invisible.