pastescript template for a complete django project with pip+virtualenv, fabric, a gevent-based wsgi server and various helpers scripts. Ready to deploy on your production server in minutes.
Python Shell Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


indygo is a pastescript template and wrapper for a complete django development environment.

To get started, create a clone of this repo and run

	$ sudo python develop

in the top directory. After this you can start creating projects with

	$ indygo <yourprojectname>

File Structure:

	Your project should now have the following directory tree.

	+---/apps ----------------------- project-specific applications
	+---/bootstrap ------------------ scripts and files to setup a dev environment
	| ------------ main bootstrapping script
	|   +---dependencies.txt -------- a list of python packages that this project depends on (pip)
	+---/compass -------------------- compass' root directory with *.scss files under src.
	|   +---/src
	|   |   +---ie.scss
	|   |   +---print.scss
	|   |   +---screen.scss
	|   +---config.rb
	+---/db ------------------------- db-specific folder. By default settings.development stores a sqlite db here
	+---/dev ------------------------ scripts to aid during development and running servers
	| ------- script to shutdown the running supervisor daemon started with
	| ------------ run django's development server
	| -------- run a supervisord daemon which automatically starts wsgi servers (
	| -------------- run a gevent-based wsgi server customized for django
	| --------------- wrapper to syncdb. with "--noinput" and loading of fixtures
	|   +---work -------------------- helper script to run compass in the background and supervisord in development mode
	+---/etc ------------------------- configuration files for various 3rd party services in production
	|   +---/nginx ------------------- nginx specific configuration files
	|   |   +---development.conf ----- root folder points to this project folder by default
	|   |   +---production.conf ------ deployment server-specific configuration. don't forget to change the root folder
	|   +---/supervisor -------------- supervisord-specific config files
	|   |   +---development.conf
	|   |   +---production.conf
	+---/fabfile --------------------- scripts and files for the deployment process
	| -------------- Fabric configuration file. set USER and HOST here. (REPO_DIR, SITE_DIR optional)
	+---/fixtures -------------------- fixtures
	|   +---/development
	|   +---/production
	+---/lib ------------------------- non-django-specific, python-general package to store 3rd party libraries (or your own)
	| ----------------- processes that run in a microthread under gevent (eg changemonitor)
	| ------------------- various functions to launch command-line tools, used by the other scripts (dev)
	+---/media ----------------------- django's media folder
	|   +---/site
	|   |   +---/css
	|   |   |   +---ie.css
	|   |   |   +---print.css
	|   |   |   +---screen.css
	|   |   +---/img
	|   |   |   +---grid.png
	|   |   +---/js
	|   |   |   +---jquery-1.4.2.min.js
	| ----------------- common and shared settings
	| ------------ development specific settings
	| ------------- production specific settings
	|   +---/site
	|   |   +---base.html ------------- base layout to extend
	|   |   +---index.html
	+---/tmp -------------------------- directory to store various runtime files (supervisord's pid, logs etc)


During development you'll need the following packages:

	- compass, to change the source (*.scss) files and to compile those to css. -
	- git - 
	- pip & virtualenv -  & 
	- libevent (sudo apt-get install libevent-dev) - 
	- nginx (sudo apt-get install nginx) 
For deployment you can ignore compass.

Quick Start

Go into your new project and run

	$ ./bootstrap/

this will setup a virtualenv under virtualenv and install all the dependencies under bootstrap/dependencies.txt

	$ source virtualenv/bin/activate

to activate virtualenv, and finally

	$ ./dev/work

To start working

Quick Deployment

	-- do an initial commit of your project with git. There is a .gitignore supplied. You can just add all the files in interactive mode.
	-- adjust etc/nginx/production.conf to suit your needs (namely port, root to the project directory)
	-- adjust settings/ (namley DATABASE)
	-- setup ssh key authentication on your deployment server (if not already done)
	-- change the variables in fabfile/ (HOST, USER)

	$ fab bootstrap
	$ fab deploy

fab bootstrap will create a bare git repo, add this repo to your local git, create the site structure, call bootstrap/ remotely, and enable nginx pointing to this project.

fab deploy pushes your local git state to the remote repo, run supervisord if it's not already running and restart all associated wsgi servers

Don't forget to activate the virtualenv as all the important scripts are stored under virtualenv (fab, pip) and won't work without activation.

Your site should be ready now. Enjoy!

Open the README file under your project directory for more information.