我有 macOS Sierra 并且我修改了我的旧 Django 项目(项目是在 Linux 系统上创建的,也许这会引起一些错误)
我里面有文件夹static和文件夹landingstatic
当我运行服务器时,会打印出来:
GET /static/landing/img/397x300/03.jpg HTTP/1.1" 404 1691
这是我的settings带有静态变量的文件 -
STATIC_DIR = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
'/Users/milkiweed/Documents/python/django/psy_site/static'
Run Code Online (Sandbox Code Playgroud)
更新。当我尝试使用时,python3 manage.py collectstatic我遇到了下一个问题:
You have requested to collect static files at the destination
location as specified in your settings.
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call …Run Code Online (Sandbox Code Playgroud)