0
정적 파일을 찾을은`t 내가 내 오랜 장고 프로젝트를 수정 한내가 맥 OS 시에라가 장고
내가 폴더 static
및 폴더가 (프로젝트가 리눅스 시스템에서 만든, 어쩌면이 몇 가지 버그를 호출) 내가 서버를 실행할 때 static
내부 landing
그리고,이 출력됩니다 :이 변수 정적 내 settings
파일 GET /static/landing/img/397x300/03.jpg HTTP/1.1" 404 1691
입니다 -
은STATIC_DIR = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
'/Users/milkiweed/Documents/python/django/psy_site/static'
UPD. 내가 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 last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/Users/milkiweed/Documents/vn/psychology/lib/python3.6/site- packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/Users/milkiweed/Documents/vn/psychology/lib/python3.6/site- packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/milkiweed/Documents/vn/psychology/lib/python3.6/site- packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/milkiweed/Documents/vn/psychology/lib/python3.6/site- packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/Users/milkiweed/Documents/vn/psychology/lib/python3.6/site- packages/django/contrib/staticfiles/management/commands/collectstatic.py" , line 199,in handle
collected = self.collect()
File "/Users/milkiweed/Documents/vn/psychology/lib/python3.6/site- packages/django/contrib/staticfiles/management/commands/collectstatic.py" , line 124,in collect
handler(path, prefixed_path, storage)
File "/Users/milkiweed/Documents/vn/psychology/lib/python3.6/site- packages/django/contrib/staticfiles/management/commands/collectstatic.py" , line 354,in copy_file
if not self.delete_file(path, prefixed_path, source_storage):
File "/Users/milkiweed/Documents/vn/psychology/lib/python3.6/site- packages/django/contrib/staticfiles/management/commands/collectstatic.py" , line 260,in delete_file
if self.storage.exists(prefixed_path):
File "/Users/milkiweed/Documents/vn/psychology/lib/python3.6/site- packages/django/core/files/storage.py", line 392, in exists
return os.path.exists(self.path(name))
File "/Users/milkiweed/Documents/vn/psychology/lib/python3.6/site- packages/django/contrib/staticfiles/storage.py", line 50, in path
raise ImproperlyConfigured("You're using the staticfiles app "
django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.
장고 버전? collectstatic 실행 했습니까? (https://docs.djangoproject.com/en/1.11/howto/static-files/ 참조) – Davy
@Davy 버전 (1, 11, 6, 'final', 0)을 사용합니다. 이제 collectstatic을 사용하려고합니다 –
STATIC_ROOT가 설정되어 있습니까? – Davy