Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
heroku django没有收集我的静态文件_Django_Heroku_Django Models_Django Forms_Heroku Postgres - Fatal编程技术网

heroku django没有收集我的静态文件

heroku django没有收集我的静态文件,django,heroku,django-models,django-forms,heroku-postgres,Django,Heroku,Django Models,Django Forms,Heroku Postgres,我的问题是: 当我在heroku服务器上运行collectstatic命令staticfiles时,我的应用程序没有复制我的staticfiles 我的配置: **BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))** STATIC_URL = '/static/' STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR),

我的问题是: 当我在heroku服务器上运行collectstatic命令staticfiles时,我的应用程序没有复制我的staticfiles

我的配置:

**BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))**
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), "static_in_env","static_root")
STATICFILES_DIRS = (
    os.path.join(BASE_DIR, "static_in_pro","our_static"),

Django将安装的应用程序中的
STATICFILES\u DIRS
static
文件夹中的静态文件放入
static\u ROOT

您应该检查文件夹中是否有静态文件:
BASE\u DIR/static\u in\u pro/our\u static

最简单的方法是在应用程序中创建一个
static
文件夹,然后将静态文件放入其中。在这种情况下,您可以忽略
静态文件\u DIRS