점프 투 플라스크 Gunicorn 오류
(myproject) ubuntu@ip-172-26-2-207:~$ cd ~/projects/myproject
(myproject) ubuntu@ip-172-26-2-207:~/projects/myproject$ pip install gunicorn
Collecting gunicorn
  Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
     |████████████████████████████████| 79 kB 1.8 MB/s
Requirement already satisfied: setuptools>=3.0 in /home/ubuntu/venvs/myproject/lib/python3.8/site-packages (from gunicorn) (44.0.0)
Installing collected packages: gunicorn
Successfully installed gunicorn-20.1.0
(myproject) ubuntu@ip-172-26-2-207:~/projects/myproject$ gunicorn --bind 0:5000 "pybo:create_app()"
[2021-08-01 20:38:41 +0900] [64359] [INFO] Starting gunicorn 20.1.0
[2021-08-01 20:38:41 +0900] [64359] [INFO] Listening at: http://0.0.0.0:5000 (64359)
[2021-08-01 20:38:41 +0900] [64359] [INFO] Using worker: sync
[2021-08-01 20:38:41 +0900] [64361] [INFO] Booting worker with pid: 64361
[2021-08-01 20:38:42 +0900] [64361] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
    worker.init_process()
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/gunicorn/workers/base.py", line 134, in init_process
    self.load_wsgi()
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/gunicorn/util.py", line 412, in import_app
    app = app(*args, **kwargs)
  File "/home/ubuntu/projects/myproject/pybo/__init__.py", line 20, in create_app
    app.config.from_envvar('APP_CONFIG_FILE')
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/flask/config.py", line 92, in from_envvar
    raise RuntimeError(
RuntimeError: The environment variable 'APP_CONFIG_FILE' is not set and as such configuration could not be loaded. Set this variable and make it point to a configuration file
[2021-08-01 20:38:42 +0900] [64361] [INFO] Worker exiting (pid: 64361)
[2021-08-01 20:38:42 +0900] [64359] [INFO] Shutting down: Master
[2021-08-01 20:38:42 +0900] [64359] [INFO] Reason: Worker failed to boot.
(myproject) ubuntu@ip-172-26-2-207:~/projects/myproject$

310 페이지의 2단계에서 이렇게 오류가 뜹니다ㅠㅠ APP_CONFIG_FILE이 설정되지 않았다는 것 같은데 어떻게 해결하면 될까요? alias를 이용해서 .project파일을 만든 뒤에 MobaXterm에서 myproject를 입력해서 가상환경에 진입하고 시작하였습니다!

seooo03 659

2021년 8월 1일 8:44 오후

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

APP_CONFIG_FILE 환경변수 설정이 제대로 안된 것 같습니다.
작성하신 .profile 의 alias 를 보여주세요.

박응용

2021년 8월 1일 8:53 오후

.project 확인해보았더니 줄바꿈이 되어 오류가 있었네요! 수정 후 해결하였습니다. 감사합니다 :) - seooo03님, 2021년 8월 1일 10:13 오후 추천 , 대댓글