flask之行(Eclipse+Pydev IDE)

来源:互联网 发布:js图片上传entype 编辑:程序博客网 时间:2024/06/05 16:12

Eclipse+Pydev IDE

俗话说,“工欲善其事必先利其器”那么我相信Eclipse+Pydev IDE会是一个不错的选择。

  • 代码补全
  • 语法高亮
  • 代码分析
  • 本地调试
  • 远程调试
  • 交互窗口
  • django框架
  • unit测试
  • virtualenv
  • Google App Engine

安装Eclipse

Eclipse版本,推荐选择{Eclipse Java EE IDE for Web Developers],是免安装的,解压之后启动eclipse.exe就可以了。Eclipse下载

安装Pydev

  1. 启动Eclipse,从菜单[help]->[Install New Software..]打开Install画面。
  2. 在地址栏Work with,填入[Pydev p2 Repository - http://pydev.org/updates]
  3. 稍等一会在name栏出现[PyDev,PyDev Mylyn Intergration(option)]
  4. 选择PyDev,下一步直到安装结束
  5. 从[preferences…]打开配置Pydev的画面,打开画面左栏Pydev->Interpreters->Python Interpreter,在Python Interpret画面,选择Quick Auto-Config

在Eclipse+Pydev IDE中配置Flask

virtualenv可以说是管理python环境的神器,Eclipse+Pydev能与virtualenv很好结合。为每一个工程创建独立的Python环境。
1. 安装Flask,请阅读flask环境安装
2. 创建Pydev工程,在Pydev工程设置画面,填入Project name:first-webapi(名字根据自己项目)
3. 点击链接Please configure an interpreter before proceeding,为每个Project配置解释器。
4. 选择手动配置,进入Python Interpreter配置画面,通过右边new按钮,创建一个新的解释器,在解释器名称(InterpreterName)一栏填写名称(可随意),在解释器程序(Interpreter Executable)一栏填入通过virtualenv建立虚拟Python解释器。(例如:InterpreterName:venv;Interpreter Executable:D:\web_develop\first-webapi\venv\Scripts\python.exe)


0 0