This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!
Project Description


Manage external dependencies hosted through any version control system.


  1. Download the app add it to your Python path:
hg clone django-dependency
cd django-dependency
python install
  1. Add to your INSTALLED_APPS:
    # ...


Add DEPENDENCIES to your settings file

  • If you’re migrating from using svn:externals, there is a script you can use to automatically generate the list of dependencies. Just run the following command, copy/paste the output into your settings file, and make sure your INSTALLED_APPS is up to date: apps/external_apps libs/external_libs
  • If you’re not migrating from svn:externals you can set your DEPENDENCIES and INSTALLED_APPS manually like this:
import os
import deps
# ...
PROJECT_PATH = os.path.abspath('%s/..' % path.dirname(__file__))
# ...
DEPDENDENCY_ROOT = os.path.join(PROJECT_PATH, 'external')
    # subversion
        #Uncomment to pin to revision 22
    # mercurial
        #Uncomment to pin to revision 8ed91139be12

    # git pinned to a SHA1 id with rev can use HEAD or other tags
# ...
    # ...


  • To dynamically add the dependencies to your python path, add this code to AFTER importing settings but BEFORE importing anything from Django:
import deps
deps.add_all_to_path(projectname.settings, auto_update=sys.argv[1] == 'up')
  • For example, a complete might look like this:
#!/usr/bin/env python

import sys
import os.path
import deps

# remove '.' from the path (you should use the project package to reference
# anything in here)
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.dirname(PROJECT_ROOT))

    import projectname.settings
except ImportError:
    import sys
    sys.stderr.write("Error: Can't find the file '' in the directory containing %r.\ It appears you've customized things.\nYou'll have to run, passing it your settings module.\n(If the file does indeed exist, it's causing an ImportError somehow.)\n" % __file__)

if len(sys.argv) > 1 and sys.argv[1] == 'up':
    deps.add_all_to_path(projectname.settings, auto_update=True)
    deps.add_all_to_path(projectname.settings, auto_update=False)

from import execute_manager
if __name__ == "__main__":
  • Now you can run “./ up” to grab the dependencies!

Development sponsored by Caktus Consulting Group, LLC.

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-dependency-1.1.tar.gz (4.4 kB) Copy SHA256 Checksum SHA256 Source Mar 18, 2010

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting