Django: serving ADMIN media files

前端 未结 7 1320
无人及你
无人及你 2020-12-08 03:01

I\'ve been successfully serving media files for the normal MEDIA files, but when I tried serving admin media files, I failed. please kindly help me locating the problem, as

7条回答
  •  既然无缘
    2020-12-08 03:36

    Try to Use STATICFILES_DIRS as blow

    # Additional locations of static files
    STATICFILES_DIRS = (
        # 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.
        ("images", os.path.join(STATIC_ROOT,'images').replace('\\','/')),
        ("css",    os.path.join(STATIC_ROOT,'css').replace('\\','/')),
        ("js",     os.path.join(STATIC_ROOT,'js').replace('\\','/')),
    )
    

    Have a goodluck!

提交回复
热议问题