要求:我期望后端项目1和后端项目2包之间互不干扰,请问应当如何做?
背景:项目2拥有公共解释环境没有的包,项目1可以正常访问,项目2提示没有包。
截图:
1:
项目1,wsgi文件如下
activate_this = r'D:\python_project\test_apache_001\venu\Scripts\activate_this.py'
with open(activate_this) as file_:
exec(file_.read(), dict(__file__=activate_this))
import sys
sys.path.insert(0, r'D:\python_project\test_apache_001')
from app import app as application
项目2wsgi文件如下
activate_this = r'D:\python_project\test_apache_002\venu\Scripts\activate_this.py'
with open(activate_this) as file_:
exec(file_.read(), dict(__file__=activate_this))
import sys
sys.path.insert(0, r'D:\python_project\test_apache_002')
from app import app as application
访问项目2,因为项目2拥有一个特别的包,故报错,请问如何设置每个项目都使用自己的虚拟环境,互不干扰?
https://blog.csdn.net/Elephantpretty/article/details/117298023 解决方案。
在windows部署直接用windows自带的IIS服务器就行了,这个更简单,你部署两个服务,用不同端口开启就行了
您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~
如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~
ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632