kopia lustrzana https://github.com/rtts/django-simplecms
23 wiersze
610 B
Bash
Executable File
23 wiersze
610 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
test -z $1 && echo "Please provide a project name!" && exit 1
|
|
test -d $dev/$1 && echo "That project already exists!" && exit 1
|
|
|
|
mkdir $1 && cd $1
|
|
pip3 freeze > requirements.txt
|
|
examples_dir=$(python3 -c 'import os,examples;print(os.path.dirname(examples.__file__))')
|
|
cp -r $examples_dir/{project,app,manage.py} .
|
|
sed -i s/example/$1/ project/settings.py
|
|
|
|
# Assume the user has sudo access to postgres
|
|
sudo su postgres -c "createuser $1; createdb -O $1 $1" || true
|
|
|
|
cat << EOF > .gitignore
|
|
*.pyc
|
|
__pycache__/
|
|
EOF
|
|
|
|
./manage.py migrate
|
|
./manage.py createsuperuser
|
|
./manage.py runserver --nostatic
|