Archiwa dla August 2009

Django command-line on Windows Vista

14 Aug 2009; Maksymus007

Working with Django means using command line tools. Having type full script path each time may be time consuming and prone to errors. So lets copy django-admin.py file to some directory and add it to PATH system variable. Lets use PATHEXT variable and append .py. Last thing is to associate .py files with Python interpreter.This probably was done by Python Installer and than typing django-admin help should print entire poem.
What if not?

There are two possibilities:

  1. Windows will scream that it has no idea what to do with such a file
  2. Whatever we type, ‘Type `djang-admin.py help` for usage’ will be shown.

In both cases we navigate to http://www.creativelement.com/powertools/#download and download Power Tool. This is free, 45 day evaluation copy but we should end in a minute. Install, run Power Tool.

 

  1. Scroll until you find Edit file type associations and click Start File Type Doctor now…
  2. Type .py to scroll list. If you see .py extensions - click it.
    If not use New button below the list fill typename extension box with .py, click Accept and then find .py on the list and click it.
  3. Right list contains Open? If yes, select it and Edit, if not Add. Set accoring to screenshot below, remeber about python.exe path - may be different.

    py_open

  4. Accept
  5. Enjoy yout django-admin or any other command!