Forums

Whitelist suggestion for free user accounts: fonts.gstatic.com

Hello respectful admins and moderators of PythonAnywhere. Can you add fonts.gstatic.com to the Whitelist for free user accounts please? Google fonts is one of most useful websites for frontend developers and the Google company have stored their fonts in the fonts.gstatic.com server.

Without this site, Lots of pre-installed Python Modules and libraries also (like wkhtmltopdf) gives this error.

2023-04-11 08:31:12,361: Exception on /download_application [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/home/USERNAME/mysite/main.py", line 353, in pdf
    imgkit.from_file('/home/USERNAME/mysite/form.html', '/home/USERNAME/mysite/form.png', options=options)
  File "/home/USERNAME/.local/lib/python3.10/site-packages/imgkit/api.py", line 72, in from_file
    return rtn.to_img(output_path)
  File "/home/USERNAME/.local/lib/python3.10/site-packages/imgkit/imgkit.py", line 257, in to_img
    raise OSError("wkhtmltoimage reported an error:\n" + stderr)
OSError: wkhtmltoimage reported an error:
Loading page (1/2)
[>                                                           ] 0%#015[==============================>                             ] 50%#015Error: Failed to load https://fonts.gstatic.com/s/robotoflex/v9/NaN4epOXO_NexZs0b5QrzlOHb8wCikXpYqmZsWI-__OGfttPZktqc2VdZ80KvCLZaPcSBZtOx2MifRuWR28sPJtUMbsFEK6cRrleUx9Xgbm3WLHa_F4Ep4Fm0PN19Ik5Dntczx0wZGzhPlL1YNMYKbv9_1IQXOw7AiUJVXpRJ6cXW4O8TNGoXjC79QRyaLshNDUf3e0O-gn5rrZCu20YNYG0EACUTNK-QKavMlxGIQ.ttf, with network status code 99 and http status code 0 - Proxy denied connection
Error: Failed to load https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLCz7V1s.ttf, with network status code 99 and http status code 0 - Proxy denied connection
[================================>                           ] 54%#015Warning: Failed to load https://username.pythonanywhere.com/static/image.jpg (ignore)
[============================================================] 100%#015Rendering (2/2)                                                    
[>                                                           ] 0%#015[===============>                                            ] 25%#015[============================================================] 100%#015Done                                                               
Exit with code 1 due to network error: UnknownNetworkError
**NO MATCH**

Thank you in advance...!

Hi there!

I also support the suggestion to add fonts.gstatic.com to the Whitelist for free user accounts. As a frontend developer and a free user of PythonAnywhere, I have found that not having access to Google Fonts has limited my ability to create visually appealing websites. Adding fonts.gstatic.com to the Whitelist would greatly enhance the capabilities of free users like myself and improve our overall experience on the platform. Thank you for taking the time to consider this request.

That's a great suggestion! Normally we only add sites to the allowlist if they're official public APIs, but that's a security measure to stop hackers from using us to break into other sites by using us as an anonymisation system. Google, I think, will have enough security measures in place to keep them safe :-). I've made an exception to the general rule in this case and added the site to the list. It should be active within the next five minutes.

Oh! Thank you, @giles ♥️

Glad to help you to make it work.