简体   繁体   English

使用Django和Pipenv的uwsgi.ini文件的正确设置

[英]Right settings for uwsgi.ini file with Django and pipenv

Usually, I don't use pipen and working with virtualenv, virtualenvwrapper and requirements.txt with my django projects. 通常,我不使用Pipen并在我的django项目中使用virtualenv,virtualenvwrapper和requirements.txt。 In this case my uwsgi.ini file looks like: [uwsgi] 在这种情况下,我的uwsgi.ini文件如下所示:[uwsgi]

project = cv-base
uid = cvc
base = /home/%(uid)
chdir = %(base)/%(project)
home = %(base)**/Env**/%(project) <----!!!!!!!
module = %(project).wsgi:application
master = true
processes = 5
socket = /run/uwsgi/%(project).sock
chown-socket = %(uid):www-data
chmod-socket = 660
vacuum = true

Where values home have links to my virtualenv thrue folder Env. home指向我的virtualenv thrue文件夹Env的链接。 But now I cant have this folder, and cant unrestand what to substitute here. 但是现在我不能拥有此文件夹,也无法理解要替换的内容。

At log file I got an error 在日志文件中出现错误

 !!! Python Home is not a directory: /home/cvc/Env/cv-base !!!
Jun 26 13:48:55 CV-base uwsgi[12482]: Set PythonHome to /home/cvc/Env/cv-base

You can use pipenv --venv for printing the virtual env directory that is pipenv is using. 您可以使用pipenv --venv来打印pipenv正在使用的虚拟环境目录。

$ mkdir test
$ cd test
$ pipenv shell
…
$ pipenv --venv
/home/foobar/.local/share/virtualenvs/a-atLBagCC

So you should use the option virtualenv = /home/foobar/.local/share/virtualenvs/a-atLBagCC in your uwsgi.ini file 因此,您应该在uwsgi.ini文件中使用选项virtualenv = /home/foobar/.local/share/virtualenvs/a-atLBagCC

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM