想用python3做web开发的一些不知(主要是环境部署),求解!

本人python3初学者

现在用mac 在本机安装了python3.6.5
写了几个在控制台下运行的网页采集之类的程序

目标是想通过web写一个后台管理系统,这个系统能管理一些网站的数据编辑,还有就是直接调用我之前写的一些控制台下运行的程序

通过网上的框架介绍,本人想用flask,但是本人系统部署的确差,想知道我的需求如何部署环境,非常感谢!!!

阅读 2.4k
2 个回答
1. 如果想简单点,就直接用viritualenv,flask主函数:
    application.run(host="0.0.0.0", threaded=True)
2. 如果考虑性能,就上uwsgi + nginx + docker 部署到 cloud platform

我在mac下安装viritualenv

$ sudo pip3 install virtualenv
显示如下:
The directory '/Users/tuser/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/bluesxg/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting virtualenv
Downloading https://pypi.tuna.tsinghua.ed... (1.9MB)

100% |████████████████████████████████| 1.9MB 631kB/s 

Installing collected packages: virtualenv
Successfully installed virtualenv-16.1.0
You are using pip version 9.0.3, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

应该是安装成功了吧?

然后我sudo -i 切换到root身份
再执行 virtualenv 创建命令时显示-sh: virtualenv: command not found

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题