Django Development With Eclipse and PyDev

Do you like this?

Summary:
This article shows you how to develop Django apps using Eclipse and PyDev. PyDev is a third-party plug-in for Eclipse which is an Integrated Development Environment (IDE) used for programming in Python supporting code refactoring, and many other cool features. On top of that, it's FREE.


Content:

In this tutorial, I will create a Django project in Eclipse using PyDev. I will go from the very beginning, which files I created first, then how to execute them, how to connect to the database, and get your project deployed. If you see the screenshots in the order I have created, you will see how I did it for my own projects. Following is the list of headings which you can find in this post. The screenshots for detailed information can be found at the end.

0 - Installing PyDev in Eclipse

Python Download Page: http://www.python.org/download/
Eclipse Download Link: http://www.eclipse.org/downloads/
After installing Eclipse, you have to use Software Update feature to install PyDev.

1 - Create A Django Project

This shows you how to create a new Django project in Eclipse. If the Python interpreter hasn't been installed, it will also guide you how to attach your Python 2.7 to Eclipse.

2 - Customise Work Environment

Normally the font size is too small for me so I will show you how to change font size in Eclipse in case you are interested.

3 - Setting Up A Datebase Connection

This shows you how to use PhpMyAdmin to create a new database schema and a new MySQL account which can be used for our Django projects.

4 - Setting up A Django App and Sync

Django works on the concept of applications which actually store your business code and model. I will show you how to create one and how to sync it with database so that the corresponding database tables can be automatically created.

5 - Run Django Project

In this section, you will find how to run a Django project in Eclipse with the integrated server provided by Django. If you want to know how to run your projects with Apache or Xampp, please read How To Create A Django Project Using Eclipse And XAMPP

6 - Changing Python Path

One of the most desired feature of PyDev is auto completion. In order to make it work properly, you have to configure Eclipse to recognise the path to your project code. Otherwise, it will not show you all the options when you are typing your code.

7 - Creating Views

I will give you a very basic template view which will display all the articles in the database.

Download Source: How To Create A Basic Django App With PyDev

 
comments powered by Disqus