5 # source <(curl -L pypi.nowoczesnapolska.org.pl/django)
11 # Make it a function, so that it works with `source`
14 DJANGO_REQ='Django>=1.5,<1.6'
16 PROJECT_TEMPLATE='http://git.nowoczesnapolska.org.pl/?p=fnpdjango.git;a=snapshot;h=64c636d1e3ff35a7a1d3394fd1d3ff0093f44aa2;sf=tgz'
17 VIRTUALENVWRAPPER_PATHS="
18 /etc/bash_completion.d/virtualenvwrapper
19 /usr/bin/virtualenvwrapper.sh
20 /usr/local/bin/virtualenvwrapper.sh
28 echo "Create new Django project."
29 while [ -z "$PROJECT" ]
31 echo "Name of the project:"
34 echo -e "Project: ${strong}${PROJECT}${normal}"
36 for venv in $VIRTUALENVWRAPPER_PATHS
40 VIRTUALENVWRAPPER="$venv"
44 if [ "$VIRTUALENVWRAPPER" ]
46 echo "virtualenvwrapper found at $VIRTUALENVWRAPPER."
47 source "$VIRTUALENVWRAPPER"
49 echo -e "${error}ERROR: virtualenvwrapper not found. Tried locations:${normal}"
50 echo "$VIRTUALENVWRAPPER_PATHS"
51 echo -e "${error}Install virtualenvwrapper or add the correct path to this script.${normal}"
56 echo -e "${strong}Creating virtualenv: $PROJECT...${normal}"
57 mkvirtualenv "$PROJECT"
58 echo -e "${strong}Installing Django...${normal}"
59 pip install "$DJANGO_REQ"
61 echo -e "${strong}Starting the project...${normal}"
62 django-admin.py startproject \
63 --template "$PROJECT_TEMPLATE" \
69 mv "$WRAPPER/"* "$WRAPPER/".gitignore .
72 chmod +x "$DJANGO_ROOT"/manage.py
73 mv "$DJANGO_ROOT/$PROJECT/localsettings.py.dev" "$DJANGO_ROOT/$PROJECT/localsettings.py"
75 echo -e "${strong}Installing requirements...${normal}"
76 pip install -r requirements.txt
77 echo -e "${strong}Installing developer requirements...${normal}"
78 pip install -r requirements-dev.txt
79 echo -e "${strong}Running syncdb...${normal}"
80 "$DJANGO_ROOT"/manage.py syncdb --noinput
82 echo -e "${strong}Starting new git repository...${normal}"
85 echo -e "${strong}What next?${normal}"
86 echo " * Work on your app, commit to git."
87 echo " * Review fabfile, use fab for deployment."