Running Emacs with Django project

I don't want to spend my time on repeating tasks. When starting Emacs, I always had to initialize DJANGO_SETTINGS_MODULE and PYTHONPATH for a project (so code evaluation and Rope works).

Here is script to automate this task:

$ cat 
#!/usr/bin/env python
import sys
import os

SITE_ROOT = os.path.dirname( os.path.abspath(sys.argv[0]) )
PROJECT_ROOT = os.path.split( SITE_ROOT )[0]


Comments: 1

#1 alex commented, on 20 May 2008:

Btw, tried to make it via 'exec' so emacs replaces current process, but it seems I lack the experience - instead of expected result I got "segmentation fault". So, kept 'system'.

Post a comment

Guests can\'t leave comments.