작성
·
430
·
수정됨
0
58강 에서 어디를 잘못해서 staic 파일이 적용이 안되는지 잘 모르겠네요
git 주소 : https://github.com/Kimhyuntae9665/pragmatic.git
portainer 스크린샷 입니다
문제가 보이면 댓글 부탁 드려요 ㅠㅠ
혹시 aws 로 하고 있는데 aws 라서 문제가 생긴걸까요?
찾아 주시는 분에게는 사례하겠습니다 !!!!!
정말 모르겠네요ㅠㅠㅠㅠㅠㅠ
답변 1
0
안녕하세요, 인프런 AI 인턴이에요. static 파일이 적용되지 않는 문제에 대해 도움을 드리겠습니다.
먼저, 해당 문제를 해결하기 위해선 몇 가지 확인해야 할 사항들이 있어요.
프로젝트 설정 확인하기: settings.py 파일에서 STATIC_URL 및 STATIC_ROOT 변수가 올바르게 설정되어 있는지 확인해주세요. STATIC_URL은 static 파일의 URL을, STATIC_ROOT는 실제 static 파일이 저장될 경로를 의미합니다.
정적 파일 경로 확인하기: Django 프로젝트 내에 static 디렉터리가 생성되어 있는지 확인해주세요. 그리고 static 디렉터리 내에 CSS, JS, 이미지 파일들이 존재하는지도 확인해주세요.
웹 서버 설정 확인하기: 만약 AWS를 사용하고 계신다면, 웹 서버 (예: Nginx, Apache) 설정이 올바르게 되어 있는지 확인해야 합니다. 정적 파일이 제대로 서빙되지 않을 수 있는데, 이 경우 웹서버의 설정을 살펴봐야 합니다.
위의 사항들을 확인해보시고, 문제가 해결되지 않는다면 좀 더 자세한 정보가 필요할 수 있어요. 더 많은 컨텍스트를 제공해주시면 더욱 도움이 될 수 있습니다. 감사합니다!
django_container_gunicorn 로그를 보니 13.125
response = response or self.get_response(request)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 57, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 124, in response_for_exception
security_logger.error(
File "/usr/local/lib/python3.9/logging/__init__.py", line 1463, in error
self._log(ERROR, msg, args, **kwargs)
File "/usr/local/lib/python3.9/logging/__init__.py", line 1577, in _log
self.handle(record)
File "/usr/local/lib/python3.9/logging/__init__.py", line 1587, in handle
self.callHandlers(record)
File "/usr/local/lib/python3.9/logging/__init__.py", line 1649, in callHandlers
hdlr.handle(record)
File "/usr/local/lib/python3.9/logging/__init__.py", line 948, in handle
self.emit(record)
File "/usr/local/lib/python3.9/site-packages/django/utils/log.py", line 125, in emit
reporter.get_traceback_text(),
File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 417, in get_traceback_text
c = Context(self.get_traceback_data(), autoescape=False, use_l10n=False)
File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 379, in get_traceback_data
"settings": self.filter.get_safe_settings(),
File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 154, in get_safe_settings
settings_dict[k] = self.cleanse_setting(k, getattr(settings, k))
File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 111, in getattr
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/usr/local/lib/python3.9/site-packages/django/utils/deprecation.py", line 134, in call
response = response or self.get_response(request)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 57, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 143, in response_for_exception
log_response(
File "/usr/local/lib/python3.9/site-packages/django/utils/log.py", line 241, in log_response
getattr(logger, level)(
File "/usr/local/lib/python3.9/logging/__init__.py", line 1463, in error
self._log(ERROR, msg, args, **kwargs)
File "/usr/local/lib/python3.9/logging/__init__.py", line 1577, in _log
self.handle(record)
File "/usr/local/lib/python3.9/logging/__init__.py", line 1587, in handle
self.callHandlers(record)
File "/usr/local/lib/python3.9/logging/__init__.py", line 1649, in callHandlers
hdlr.handle(record)
File "/usr/local/lib/python3.9/logging/__init__.py", line 948, in handle
self.emit(record)
File "/usr/local/lib/python3.9/site-packages/django/utils/log.py", line 125, in emit
reporter.get_traceback_text(),
File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 417, in get_traceback_text
c = Context(self.get_traceback_data(), autoescape=False, use_l10n=False)
File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 379, in get_traceback_data
"settings": self.filter.get_safe_settings(),
File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 154, in get_safe_settings
settings_dict[k] = self.cleanse_setting(k, getattr(settings, k))
File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 111, in getattr
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/gunicorn/workers/sync.py", line 135, in handle
self.handle_request(listener, req, client, addr)
File "/usr/local/lib/python3.9/site-packages/gunicorn/workers/sync.py", line 178, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/wsgi.py", line 124, in call
response = self.get_response(request)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 140, in get_response
response = self._middleware_chain(request)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 57, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 143, in response_for_exception
log_response(
File "/usr/local/lib/python3.9/site-packages/django/utils/log.py", line 241, in log_response
getattr(logger, level)(
File "/usr/local/lib/python3.9/logging/__init__.py", line 1463, in error
self._log(ERROR, msg, args, **kwargs)
File "/usr/local/lib/python3.9/logging/__init__.py", line 1577, in _log
self.handle(record)
File "/usr/local/lib/python3.9/logging/__init__.py", line 1587, in handle
self.callHandlers(record)
File "/usr/local/lib/python3.9/logging/__init__.py", line 1649, in callHandlers
hdlr.handle(record)
File "/usr/local/lib/python3.9/logging/__init__.py", line 948, in handle
self.emit(record)
File "/usr/local/lib/python3.9/site-packages/django/utils/log.py", line 125, in emit
reporter.get_traceback_text(),
File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 417, in get_traceback_text
c = Context(self.get_traceback_data(), autoescape=False, use_l10n=False)
File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 379, in get_traceback_data
"settings": self.filter.get_safe_settings(),
File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 154, in get_safe_settings
settings_dict[k] = self.cleanse_setting(k, getattr(settings, k))
File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 111, in getattr
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty. 이런 Error 가 뜨네요