Forums

Static files are not shown

After deploying I cannot see static and css

check: dzikuss98.pythonanywhere.com

I am getting this error message during running of page:

2016-12-29 20:08:43,348 :Not Found: /static/personal/img/profile.jpg
2016-12-29 20:08:43,359 :Not Found: /static/personal/css/bootstrap.min.css
2016-12-29 20:08:43,521 :Not Found: /media/images/Capture_lTueoTo.PNG
2016-12-29 20:08:43,532 :Not Found: /media/DEFAULT VALUE
2016-12-29 20:08:43,735 :Not Found: /favicon.ico
2016-12-29 20:08:48,223 :Not Found: /static/personal/css/bootstrap.min.css
2016-12-29 20:08:48,228 :Not Found: /static/personal/img/profile.jpg
2016-12-29 20:08:48,388 :Not Found: /media/DEFAULT VALUE
2016-12-29 20:08:48,391 :Not Found: /media/images/Capture_lTueoTo.PNG

I am also having difficulties when running collect staatistic

File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/dzikuss98/My-stuff/myvenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command
_line
    utility.execute()
  File "/home/dzikuss98/My-stuff/myvenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 316, in execute
    settings.INSTALLED_APPS
  File "/home/dzikuss98/My-stuff/myvenv/lib/python3.5/site-packages/django/conf/__init__.py", line 53, in __getattr__
    self._setup(name)
  File "/home/dzikuss98/My-stuff/myvenv/lib/python3.5/site-packages/django/conf/__init__.py", line 41, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/dzikuss98/My-stuff/myvenv/lib/python3.5/site-packages/django/conf/__init__.py", line 97, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named mysite.settings

I went through that debugging tutorial but nothing found

Any advices?

certainly sounds like you need to get collectstatic running first before you will be able to access your static files. make sure you are running collect static with the correct python version- why does your traceback have both python3.5 and python2.7 stuff?

regarding 2.7 - I am not sure from where that comes from, maybe was there before

I was able successfully run this

19:20 ~/My-stuff/mysite (master)$ python3.5 manage.py collectstatic
You have requested to collect static files at the destination
location as specified in your settings:
    /home/dzikuss98/My-stuff/static
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
0 static files copied to '/home/dzikuss98/My-stuff/static', 121 unmodified.

but still my page looks bad, also CSS seems not working as menu is normally on left side :)

Have you set DEBUG to False? If so you'll need to configure a static files mapping. More info here: http://help.pythonanywhere.com/pages/DjangoStaticFiles

I had to change paths in settings and all is fine now

Great! Glad you worked it out.

Can you explain what things did you change to make this work.

Hey please explain the changes you made in settings, i'm facing the problem as of yours !

We have a help page that covers how to configure static files here: http://help.pythonanywhere.com/pages/DjangoStaticFiles

Using Flask. I have static files stored at /home/boomji/mysite/assets/ /home/boomji/mysite/ujjain and the URL mapping is /static/indore /static/ujjain

none of the images are getting displayed .Can you pls help. It used to work. What am I doing wrong.

Could you check this help page?