Django development in Visual Studio

Microsoft have put a lot of effort into ensuring developing Python applications in VS is as simple and headache free as possible. The killer feature for beginning programmers is full IntelliSense for all Python and Django modules. This will accelerate your learning more than any other feature as you don't have to go through documentation looking for module implementations.

The other major aspects of Python/Django programming that VS makes really simple are:

  • Integration of Django management commands
  • Easy installation of Python packages
  • Easy installation of new Django apps

Integration of Django management commands

All of Django's common management commands are available from the Project menu (Figure G.10):

Integration of Django management commands

Figure G.10: Common Django commands on Project menu

From this menu you can run migrations, create superusers, open the Django shell and run the development server.

Easy installation of Python packages

Python packages can be installed directly into any virtual environment from Solution Explorer, just right click on the environment and select Install Python Package... (Figure G.11).

Packages can be installed with either pip or easy_install.

Easy installation of new Django apps

And finally, adding a new Django app to your project is as simple as right clicking on your project and selecting Add > Django app... (Figure G.12). Give your app a name and click OK and VS will add a new app to your project:

Easy installation of new Django apps

Figure G.11: Install Python package

Easy installation of new Django apps

Figure G.12: Add a Django app

This is only a quick overview of the things you can do with Visual Studio; just to get you started. Other things worth exploring are:

  • VS's repository management including full integration with local Git repos and GitHub.
  • Deployment to Azure with a free MSDN developer account (only supports MySQL and SQLite and the time of writing).
  • Inbuilt mixed-mode debugger. For example, debug Django and JavaScript in the same debugger.
  • Inbuilt support for testing.
  • Did I mention full IntelliSense support?
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset