Skip to content Skip to sidebar Skip to footer

Pythonanywhere, How To Use Static Files? Url?

I am completely new to Pythonanywhere, I cant figure out why static files are not loading... Here is the path where I stored css and images stuff, i.e. static/images/wikiLang.png

Solution 1:

PythonAnywhere dev here: I think the problem is in the paths you're using in your HTML. The mapping

/static/        /home/saadfast/WikiWorld/static

Means that URLs with /static/ at the start will be looked for in the directory /home/saadfast/WikiWorld/static. So that means that where you have

<imgsrc="/home/saadfast/WikiWorld/static/images/wikiLogo.png"width="100px"style="float:middle"/>

You should probably have

<imgsrc="/static/images/wikiLogo.png"width="100px"style="float:middle"/>

Solution 2:

Solution 3:

I've never used PythonAnywhere, but are you sure you've uploaded the files to the proper location on their server? It looks like they've got a custom file handler set up for the users, which you can briefly read up about here

You have a certain amount of storage on our servers in the form of a home folder and a /tmp.

They say they offer certain directories, have you tried pointing to those?

Post a Comment for "Pythonanywhere, How To Use Static Files? Url?"