[점프 투 장고] 4-10 Gunicorn 접속 시 오류

Gunicorn 을 시작하고
접속을 시도하면 Internal Server Error가 출력됩니다.
ROOT_URLCONF을 설정한 적이 없는데
ROOT_URLCONF에 속성오류는 무슨소리인가요?

(mysite) server@server:~/projects/mysite$ gunicorn --bind 0:8080 config.wsgi:application
[2022-06-04 01:10:30 +0900] [13745] [INFO] Starting gunicorn 20.1.0
[2022-06-04 01:10:30 +0900] [13745] [INFO] Listening at: http://0.0.0.0:8080 (13745)
[2022-06-04 01:10:30 +0900] [13745] [INFO] Using worker: sync
[2022-06-04 01:10:30 +0900] [13746] [INFO] Booting worker with pid: 13746



[2022-06-03 11:10:38 -0500] [13746] [ERROR] Error handling request /는
Traceback (most recent call last):류
  File "/home/server/venvs/mysite/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 136, in handle
    self.handle_request(listener, req, client, addr)
  File "/home/server/venvs/mysite/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 179, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/home/server/venvs/mysite/lib/python3.10/site-packages/django/core/handlers/wsgi.py", line 132, in __call__
    response = self.get_response(request)
  File "/home/server/venvs/mysite/lib/python3.10/site-packages/django/core/handlers/base.py", line 139, in get_response
    set_urlconf(settings.ROOT_URLCONF)
  File "/home/server/venvs/mysite/lib/python3.10/site-packages/django/conf/__init__.py", line 88, in __getattr__
    val = getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF'


iill6022 531

2022년 6월 4일 1:21 오전

목록으로
1개의 답변이 있습니다. 1 / 1 Page

DJANGO_SETTINGS_MODULE 환경변수를 설정하거나 --settings 설정을 하셔야 합니다.

박응용

2022년 6월 4일 10:42 오전

환경변수를 어떻게 설정해야하나요?? - iill6022님, 2022년 6월 4일 1:41 오후 추천 , 대댓글
@iill6022님 해당 챕터에 설명되어 있을겁니다 - 박응용님, 2022년 6월 4일 1:58 오후 추천 , 대댓글
@박응용님 설정하였습니다. 하지만 저는 환경변수 설정하기 이전인 테스트과정에서 작동이 여전히 안되고 있습니다. base.py *** 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'config.urls' TEMPLATES = [ { *** - iill6022님, M 2022년 6월 5일 1:05 오전 추천 , 대댓글