Forums

Font file not found.

Font file renders on my local machine, but wouldn't when in production.

Using whitenoise to serve static files.

Request = "GET ... /static/css/styles/bahor.ttf <br> Response = HTTP/1.1" 404 1679 <br>Filepath static/css/styles/styleindex.css"

Thanks in advance.

Take a look at https://help.pythonanywhere.com/pages/DebuggingStaticFiles/

Thanks fjl, but unfortunately, it still does not work.

The css file loads correctly. Then, all custom fonts, but one. The problem is with that particular font (Bahor.tff).

Surprisingly though, it styles well on my local machine.

What do you see about that in your browser's dev tools?

Hi Fjl.

I inspected the response headers in my browser to arrive at the following: GET - bahor.ttf; Status - 404 Not Found; Transfer-encoding - Chunked; Cache-control - no cache; File - Bahor.ttf; Content-type - text/html;

The font styles texts when on my local machine.

The font is linked just the samme way as the other custom fonts.

The font is about 800kb, while others are about 100kb.

I'm serving static files with whitenoise.

SOS.

If you're getting a 404 on a static file that you are serving with whitenoise, you will need to check your whitenoise configuration.