Skip to content

Instantly share code, notes, and snippets.

@fcurella
Created September 9, 2011 20:01
Show Gist options
  • Select an option

  • Save fcurella/1207173 to your computer and use it in GitHub Desktop.

Select an option

Save fcurella/1207173 to your computer and use it in GitHub Desktop.
django_bootstrap installation script
#!/usr/bin/env python
import os
import urllib
URL = 'https://raw.github.com/gist/1207150'
INSTALL_DIR = '/usr/local/bin/'
COMMAND_NAME = 'django_bootstrap'
command_path = "%s%s" % (INSTALL_DIR, COMMAND_NAME)
fh = urllib.urlopen(URL)
fh2 = open(command_path, 'w')
fh2.write(fh.read())
fh2.close()
fh.close()
os.chmod(command_path, int('755', 8))
@fcurella

fcurella commented Sep 9, 2011

Copy link
Copy Markdown
Author

Use it with python -c "$(curl -fsSL https://raw.github.com/gist/1207173)"

This will install a command called django_bootstrap in /usr/local/bin that can be used to make new Django projects. This command will install virtualenv and pip system-wide (or update them), and will create a virtualenv with Django already installed for your project.

django_bootstrap usage: django_bootstrap <dir_name> <project_name>

---
django_bootstrap code: https://gist.github.com/1207150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment