Django debug page layout is broken

前端 未结 1 937
醉梦人生
醉梦人生 2021-01-27 11:02

I just launched my Django server, and trying to access it through browser, but the layout is broken, how to fix this issue?

相关标签:
1条回答
  • 2021-01-27 11:40

    Thanks all for your quick response, I just fixed this issue with following method:

    Environment: Apache and WSGI

    1. Add following line to /etc/apache2/sites-enabled/000-default
    Alias /static/ /path/to/mysite.com/static/
    <Directory /path/to/mysite.com/static> 
        Require all granted
    </Directory>
    
    1. Add following line to settings.py
    STATIC_ROOT = BASE_DIR + '/static'
    STATIC_URL = '/static/'
    
    1. Run python manage.py collectstatic and restart Apache
    0 讨论(0)
提交回复
热议问题