Trang web quản trị Django của tôi (hoàn toàn mặc định, không được tùy chỉnh) không hiển thị CSS dự kiến.Trang web quản trị Django không hiển thị kiểu CSS
Nó trông như thế này:
Và tôi có thể đăng nhập:
Nhưng nó là vụ phải giống như thế này:
Làm thế nào để sửa lỗi này?
thông tin khác có thể giúp:
Tôi đang chạy trên một thể hiện Amazon EC2 trên cổng 80 và kết nối với nó sử dụng một URL thực. Tôi thiết lập nó bằng cách sử dụng hướng dẫn này: http://www.nickpolet.com/blog/deploying-django-on-aws/1/
Sau hướng dẫn đó, tôi đặt mã này vào một tệp có tên /etc/apache2/sites-enabled/mysite.conf
. Tôi không hiểu mã này đang làm gì, vì vậy tôi nghĩ nó có thể liên quan đến vấn đề này.
/etc/apache2/sites-enabled/mysite.conf:
WSGIScriptAlias//home/ubuntu/cs462/mysite/mysite/wsgi.py
WSGIPythonPath /home/ubuntu/cs462/mysite
<Directory /home/ubuntu/cs462/mysite/mysite>
<Files wsgi.py>
Order deny,allow
Require all granted
</Files>
</Directory>
Alias /media/ /home/ubuntu/cs462/mysite/media/
Alias /static/ /home/ubuntu/cs462/mysite/static/
<Directory /home/ubuntu/cs462/mysite/static>
Require all granted
</Directory>
<Directory /home/ubuntu/cs462/mysite/media>
Require all granted
</Directory>
Cấu trúc thư mục:
/home/ubuntu/cs462/
mysite/
manage.py
db.sqlite3
mysite/
__init__.py
__init__.pyc
settings.py
settings.pyc
urls.py
wsgi.py
homepage/
admin.py
admin.pyc
__init__.py
__init__.pyc
migrations
models.py
models.pyc
tests.py
views.py
phần cuối của settings.py:
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
STATIC_URL = '/static/'
thể trùng lặp của [tại sao site admin django của tôi không có phong cách css] (http://stackoverflow.com/questions/4420378/why-my-django-admin-site-does-not-have-the-css kiểu) – allcaps