Django无法加载管理css-fi

2024-06-14 05:22:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用Apache来托管我的主网站,并在其中预留了一个django项目。在

1.Apacheproxypass被配置为监听8001端口,只要proxypassReverse

  1. 在django项目settings.pydjango.contrib.staticfiles被添加到INSTALLED_APPS

  2. STATIC_ROOT设置为os.path.join(BASE_DIR, 'static'),其中BASE_DIR是我项目的绝对路径

  3. STATIC_URL is set to '/static/'

  4. 操作python manage.py collectstatic已经执行,名为“static”的文件在我的项目文件夹中

无法获取css文件的页面是www.whiletrue.cc/paradox/admin

这是我的阿帕奇httpd.conf设置:

ProxyPass /paradox http://localhost:8001/paradox

ProxyPassReverse /paradox  http://localhost:8001/paradox

Alias "/static/" "/home/paradox/JS_django/Entry/static"

Tags: 文件项目django端口pylocalhosthttpbase