5 # Make it a function, so that it works with `source`
8 DJANGO_REQ='Django>=1.5,<1.6'
9 VIRTUALENVWRAPPER_PATHS="
10 /etc/bash_completion.d/virtualenvwrapper
11 /usr/bin/virtualenvwrapper.sh
12 /usr/local/bin/virtualenvwrapper.sh
20 echo "Create new Django project."
21 while [ -z "$PROJECT" ]
23 echo "Name of the project:"
26 echo -e "Project: ${strong}${PROJECT}${normal}"
28 for venv in $VIRTUALENVWRAPPER_PATHS
32 VIRTUALENVWRAPPER="$venv"
36 if [ "$VIRTUALENVWRAPPER" ]
38 echo "virtualenvwrapper found at $VIRTUALENVWRAPPER."
39 source "$VIRTUALENVWRAPPER"
41 echo -e "${error}ERROR: virtualenvwrapper not found. Tried locations:${normal}"
42 echo "$VIRTUALENVWRAPPER_PATHS"
43 echo -e "${error}Install virtualenvwrapper or add the correct path to this script.${normal}"
48 echo -e "${strong}Creating virtualenv: $PROJECT...${normal}"
49 mkvirtualenv "$PROJECT"
50 echo -e "${strong}Installing Django...${normal}"
51 pip install "$DJANGO_REQ"
53 echo -e "${strong}Starting the project...${normal}"
54 django-admin.py startproject \
55 --template http://pypi.nowoczesnapolska.org.pl/bootstrap/project.tar.gz \
60 mv "$PROJECT"/localsettings.py.dev "$PROJECT"/localsettings.py
62 echo -e "${strong}Installing requirements...${normal}"
63 pip install -r requirements.txt
64 echo -e "${strong}Installing developer requirements...${normal}"
65 pip install -r requirements-dev.txt
66 echo -e "${strong}Running syncdb...${normal}"
67 ./manage.py syncdb --noinput
69 echo -e "${strong}Starting new git repository...${normal}"
72 echo -e "${strong}What next?${normal}"
73 echo " * Work on your app, commit to git."
74 echo " * Review fabfile, use fab for deployment."