How can I import an outside Django project?
Configuring an outside Django project to run on scripts can be a bit tricky if you’ve only before had experience with “./manage.py runserver”. Here’s one way to get a Django project running on scripts.mit.edu:
- Start with the regular scripts Django autoinstaller
- Move the created /mit/lockername/Scripts/django/projname aside to /mit/lockername/Scripts/django/projname.auto
- Copy in your application’s code to /mit/lockername/Scripts/django/projname
- Update the paths in /mit/lockername/web_scripts/progname/index.fcgi
- Make sure that the sys.path.insert line points to the directory containing projname (likely /mit/lockername/Scripts/django/)
- Possibly add a sys.path.insert line that points to /mit/lockername/Scripts/django/projname, if your includes are appname.models, not projname.appname.models (or similar)
- Make sure the chdir line is right —- it should point to the directory containing your project code
- Add a symbolic link from /mit/lockername/web_scripts/projname/media/ to /mit/lockername/Scripts/django/projname/media/
- Merge the autoinstalled settings.py (that is, /mit/lockername/Scripts/django/projname.auto/settings.py) into your settings.py
- Copy the database information
- Copy the SECRET_KEY, or make your own new one
- Copy the ADMIN_MEDIA_PREFIX —- for scripts.mit.edu, this should be “/__scripts/django/static/admin/”
- Make sure the value of MEDIA_URL is reasonable (generally “/projname/media/”)
- Make sure to install any necessary dependencies (see How can I install Python modules in my locker? for instructions how to do so with
easy_install
) - Set up your database appropriately, either by running “./manage.py syncdb” or by installing a database dump from a running copy of your project
- Once you’ve confirmed that your Django project works, delete /mit/lockername/Scripts/django/projname.auto/

Previous: | How can I restrict my Trac instance to only certain users? |
Next: | How do I do certificate authentication with Django? |
These pages may be reused under either the GFDL 1.2 or CC-BY-SA 3.0.
Questions? Contact scripts@mit.edu.
You are currently connected to busy-beaver.mit.edu.