Starting with 2.1, PTVS supports Flask and Bottle projects. 

About Flask and Bottle

If you are new to Flask or Bottle, please check out the following where you can get more information, tutorials, samples, etc. :

The rest of this tutorial uses Flask as the example, but the steps are identical for both Flask and Bottle.

PTVS Flask Quick Start

You can create one via File/New/Project/Python and selecting “Flask Web Project”:


The default “Hello World” looks like this:


Flask Installation

If you don’t have Flask installed, you can do so from inside PTVS by creating a Virtual Environment and using pip.  Here let’s assume that you’ve already installed CPython 2.7:

1. Right click on Python Environments and select Add Virtual Environment:


2. When prompted with a list, select 2.7:


3. Once the Environment is created, right click on it and select Install Python Package… :


4. Enter Flask, which will install the latest version or specify a particular version via “==” :


You will see some output regarding the installation and finally see Flask, jinja2, etc. in your Environment.  At this point let’s set a breakpoint and hit F5:


As with any other Python project, you can use the various debugging features:


Here once you hit Continue, you should see your browser pop up with “Hello World” at the specified port:


Publishing to Azure

The steps for Publishing to Azure Web Sites and Cloud Service are identical to those of Django.  Please see the tail end of this tutorial for instructions:

Last edited Feb 13 at 12:01 AM by ptools, version 6


No comments yet.