Django admin site not showing CSS style

前端 未结 1 1284
一整个雨季
一整个雨季 2021-01-02 04:14

My Django admin website (it\'s completely default, not customized) is not showing the expected CSS.

It looks like this:

相关标签:
1条回答
  • 2021-01-02 04:23

    Your Apache configuration requires that all static content (CSS, JS, images etc) should be in the mysite/static directory. You should collect your static content from apps into the mysite/static directory first:

    cd /home/ubuntu/cs462/mysite
    python manage.py collectstatic
    

    Update: If you did not specify a location for static content, you should add the following lines to your settings.py:

    STATIC_URL = '/static/'
    STATIC_ROOT = os.path.join(BASE_DIR, 'static')
    
    0 讨论(0)
提交回复
热议问题