views:

71

answers:

2

I often do this to prepare for some django debugging:

  • Open up a terminal window in os x (10.6)
  • start the python interpreter
  • run these commands in python:

    from django.core.management import setup_environ
    import settings
    setup_environ(settings)

Is it possible to automate these actions and make a shortcut that I can doubleclick to invoke?

A: 

You can use the PYTHONSTARTUP environment variable to your advantage here if you want to throw that in a script and then have a batch file load up a shell with that environment variable.

Daniel DiPaolo
+2  A: 

If you use django you should consider running the command python manage.py shell to debug django applications.

Even better, try the shell_plus command from the excellent django command extension add-on.

Olivier