没有找到Django管理员静态css与heroku工头本地启动...但推远程是好的

tba*_*rbe 2 heroku django-admin foreman

当我在本地运行foreman start时 - 我没有得到来自静态的admin css加载...

但当它推动远程它的所有工作按预期!卫生署.

我希望我当地的工头模仿我的远程实例......

继承我当前的settings.py静态内容:(有人可以帮忙吗?)

STATIC_ROOT = ''

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static'

# Additional locations of static files
STATICFILES_DIRS = (
    os.path.join(PROJECT_DIR, 'static'),
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
Run Code Online (Sandbox Code Playgroud)

小智 6

尝试修改STATIC_ROOT,让project_path/static /运行

python manage.py collectstatic
Run Code Online (Sandbox Code Playgroud)

Heroku自动运行collectstatic(如果一切设置正确):)

希望它有所帮助!