Use Django 1.3’s Development Server in an IDE with autoloading.

12Aug11

Normally, when you utilize Django’s built-in development server  from the command line by issuing the command manage.py runserver . Whenever you make a change to one of your site’s files, say your views.py, the django runserver automatically detects that change and reloads the file.

However, there is a bug in Django 1.3 that will cause an error if an IDE tries to issue that same command without using the –noreload argument, which, as the parameter name indicates, prevents the Django runserver from autoreloading the files.

The solution is to make the following change to your django installation’s autoreload.py file:

The bug fix. Credit kmtracey. See https://code.djangoproject.com/changeset/15911

Now you can have a fully functioning runserver even if you’re using an IDE like yours truly. I hope this helps someone out there.

EDIT:

My new preferred way is just to issue the command python manage.py runserver from the terminal. I just leave the terminal open on one of my monitors so that I can see all the output from the runserver . This way I don’t have to go through the hassle of editing autoreload.py for every django installation. Yes, I’m that lazy 🙂 .

Advertisements


No Responses Yet to “Use Django 1.3’s Development Server in an IDE with autoloading.”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: