Forums

How can I get a url for my image that does not contain my username in it?

Hi.

I use PythonAnywhere as my api endpoint for my web app in Bubble. I'm using Flask here, running some scripts, getting the output, serialize it before returning in view function and use it in Bubble.

I have a question about images. I found out two ways of sending image information to Bubble and none of them is attracting me.

I could create a seperate view for every image and send the url of the view such as:

http://mycustomdomain/image1

You probably see why it's not necessarily the perfect way of showing images. I'd have to create so many views.

I also can send the direct path of my image, such as: https://www.pythonanywhere.com/user/myusername/files/home/myusername/mysite/static/team_logos/image.png But this way when someone checks the source of the image, they see everything. My username, my app name, PythonAnywhere everything =)

What can be another way of dealing with this while avoiding tedious work and sharing personal information? I'm sure there is a basic way, but I'm a newcomer to web developing.

Also, I hear that PythonAnywhere runs on super-powerful servers hosted by Amazon EC2, that's what they said =) Is there any chance I directly acquire the url of my image on Amazon's servers?

Best regards.

That was my ignorance afterall. You can indeed go with the option 1 and use a parameter for your view function.

@app.route('/team/<string:team>')

Glad to hear that you made it work!