【发布时间】:2021-02-01 23:32:36
【问题描述】:
最近我将我的 django 网站托管在 EC2 ubuntu 实例上,并在 AWS 上使用 nginx 服务器。当我打开这个网站的管理页面时,它看起来很丑陋,没有 css,但在本地服务器 127.0.0.0:8000 上它工作正常。
我也在浏览器控制台上检查,它给出了这个错误:
GEThttp://jassem.in/static/admin/css/dashboard.css
[HTTP/1.1 404 Not Found 51ms]
The resource from “http://jassem.in/static/admin/css/nav_sidebar.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
admin
The resource from “http://jassem.in/static/admin/css/base.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
admin
The resource from “http://jassem.in/static/admin/js/nav_sidebar.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
admin
The resource from “http://jassem.in/static/admin/css/responsive.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
admin
The resource from “http://jassem.in/static/admin/css/dashboard.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
admin
我怎样才能找回我以前的 django 管理页面。仅供参考,我是网络技术和 Django 的新手
【问题讨论】:
-
生产环境中需要
collectstatic文件 -
我该怎么做?任何想法
标签: django nginx amazon-ec2