找不到Django管理界面的静态文件

时间:2013-07-31 11:10:31

标签: django django-admin django-staticfiles django-1.5

我无法找到一个简单问题的答案。

我使用Django 1.5在Heroku上有一个staticfiles个应用。我的应用程序中定义的静态文件可以很好地找到:

$ heroku run python manage.py findstatic bootstrap.min.css
Running `python manage.py findstatic bootstrap.min.css` attached to terminal... up, run.5557
Found 'bootstrap.min.css' here:
  /app/myapp/static/bootstrap.min.css

但无法找到内置管理界面的静态文件,例如

$ heroku run python manage.py findstatic base.css  
Running `python manage.py findstatic base.css` attached to terminal... up, run.4546
No matching file found for 'base.css'.

我的设置的相关部分是:

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

为清楚起见,管理界面上的其他所有内容都有效,但静态CSS文件却无效。如果我访问管理员登录页面,则服务器日志包含:

No such file or directory: 'staticfiles/admin/css/base.css'
No such file or directory: 'staticfiles/admin/css/login.css'

0 个答案:

没有答案