~doctormo/+junk/django-bash-extensions

« back to all changes in this revision

Viewing changes to run_django

  • Committer: Martin Owens
  • Date: 2016-09-03 00:54:31 UTC
  • mfrom: (3.1.1 django-bash-extensions)
  • Revision ID: doctormo@gmail.com-20160903005431-042o1g7w31t8q1sh
Merge in Victor's changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
  echo -ne "\033]0;@$@\007"
9
9
fi
10
10
 
11
 
cd $ORIG/../
 
11
if [ -d "$ORIG" ]; then
 
12
  cd $ORIG/../
 
13
fi
12
14
 
13
15
for filename in manage.py */manage.py ../manage.py; do
14
16
  if [ -f "$filename" ]; then
22
24
  fi
23
25
done
24
26
 
25
 
echo "No django configuration found."
 
27
if [ "$1" == "startproject" ]; then
 
28
  if [ -d $VIRTUAL_ENV_LINK ]; then
 
29
    echo "Using existing virtual environment (make sure django is installed in it)"
 
30
  else
 
31
    echo "Creating new virtual environment"
 
32
    virtualenv pythonenv
 
33
    echo "Installing django into it"
 
34
    export PATH="./pythonenv/bin:$PATH"
 
35
    pip install django
 
36
  fi
 
37
  django-admin $@
 
38
else
 
39
  echo "No django configuration found."
 
40
fi
26
41