Apache not serving django admin static files

前端 未结 4 1179
情歌与酒
情歌与酒 2020-12-02 09:18

Let me thanks you guys at the Stack Overflow community for helping me with various Django and Apache (with mod_wsgi) errors. I\'ve asked about 5 related questions so far and

4条回答
  •  感动是毒
    2020-12-02 09:57

    That's because you haven't setup your STATIC files...

    Add to settings:

    STATIC_URL = '/static/'
    STATIC_ROOT = '/var/www/static/'
    

    Then run "python manage.py collectstatic"

    That will put all the files under STATIC_ROOT which STATIC_URL will serve... You shouldn't point Apache at your Python lib files!!

    If you want your own app-specific static files as well, setup "STATICFILES_DIRS".

提交回复
热议问题