3

I understand that the topic was not raised once, I reread and tried all the options, but for some reason the error does not go away and the styles do not connectenter image description here

connect static

path directory

error in load site

path in templates

Capricorn
  • 33
  • 6

2 Answers2

4

On your own local system static files will be served by the django dev server. In a production setting like PythonAnywhere, you need to set the STATIC_ROOT in your settings.py, eg: /home/yourusername/myproject/static

and then run python manage.py collectstatic which will collect static files from your app folders and put them in there

Reema Parakh
  • 1,347
  • 3
  • 19
  • 46
rahul.m
  • 5,572
  • 3
  • 23
  • 50
  • I did it, but still a mistake - "Failed to load resource: the server responded with a status of 404 (Not Found)" and path very strange http://yresteria.pythonanywhere.com//static/%09/css/style.css" what is this '%09' ? – Capricorn Feb 21 '19 at 06:35
  • EEeee!!!! it's work thank you ...i forgot "python manage.py collectstatic" – Capricorn Feb 21 '19 at 06:47
0

In your template code remove the space from:

 (% static    '  css/style.css' %)
               |
               |
               |
               |
             #this one
ans2human
  • 2,300
  • 1
  • 14
  • 29