Issue
I'm trying to use Django with virtualenv. I actually got the Django hello world webpage to display with 127.0.0.1:8001. Later I had to do some minor tweaks and now its giving me this error when I try to launch it again (I ctrl-Z from the previous working gunicorn session so I don't think it is because of that).
user myenv # /opt/myenv/bin/gunicorn -c /opt/myenv/gunicorn_config.py myProject.wsgi
2013-11-02 08:26:37 [27880] [INFO] Starting gunicorn 18.0
2013-11-02 08:26:37 [27880] [ERROR] Connection in use: ('127.0.0.1', 8001)
2013-11-02 08:26:37 [27880] [ERROR] Retrying in 1 second.
2013-11-02 08:26:38 [27880] [ERROR] Connection in use: ('127.0.0.1', 8001)
2013-11-02 08:26:38 [27880] [ERROR] Retrying in 1 second.
2013-11-02 08:26:39 [27880] [ERROR] Connection in use: ('127.0.0.1', 8001)
2013-11-02 08:26:39 [27880] [ERROR] Retrying in 1 second.
^C2013-11-02 08:26:40 [27880] [ERROR] Connection in use: ('127.0.0.1', 8001)
2013-11-02 08:26:40 [27880] [ERROR] Retrying in 1 second.
2013-11-02 08:26:41 [27880] [ERROR] Connection in use: ('127.0.0.1', 8001)
2013-11-02 08:26:41 [27880] [ERROR] Retrying in 1 second.
2013-11-02 08:26:42 [27880] [ERROR] Can't connect to ('127.0.0.1', 8001)
user myenv #
Other commands I recently used include:
python manage.py syncdb
python manage.py startapp polls
I did 'killall python' to make sure they were not the cause.
gunicorn_config.py:
command = '/opt/myenv/bin/gunicorn'
pythonpath = '/opt/myenv/myProject
workers = 1
user = 'tim'
myProject.wsgi:
import os
# os.environ["DJANGO_SETTINGS_MODULE"] = "myProject.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myProject.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Solution
ctrl+z
halts the process, but does not close it. In consequence it does not release its ports. You can bring the process back with fg
and then close it properly using ctrl+c
.
Answered By - Ludwik Trammer
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.