I've been in situations where I couldn't use subdomains, and the way to handle this with Django is pretty simple actually.
Pretty much everything in your settings file will be just like a regular Django app, with the exception of making sure these settings include your project path:
MEDIA_URL = 'http://192.168.0.1/gallery/media/'
ADMIN_MEDIA_PREFIX = '/gallery/admin_media/'
SESSION_COOKIE_PATH = '/gallery'
LOGIN_REDIRECT_URL = '/gallery/'
LOGIN_URL = '/gallery/accounts/login/'
LOGOUT_URL = '/gallery/accounts/logout/'
The SESSION_COOKIE_PATH is critical to prevent all your apps on the same domain from rewriting each others cookies.
The above instructions should cover the Django side, but there's still more work to do on the web server side. For example, if you use apache+mod_wsgi you'll need to make sure each project has their own wsgi script that is loaded like this:
WSGIScriptAlias /gallery /path/to/gallery/apache/gallery.wsgi
Alias /gallery/media /path/to/gallery/media
Alias /gallery/admin_media /path/to/gallery/venv/lib/python2.6/site-packages/django/contrib/admin/media
etc.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…