kopia lustrzana https://github.com/rtts/django-simplecms
24 wiersze
637 B
Bash
Executable File
24 wiersze
637 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
|
|
example_dir=$(python3 -c 'import os,example;print(os.path.dirname(example.__file__))')
|
|
cp -r $example_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 makemigrations app
|
|
./manage.py migrate
|
|
./manage.py createsuperuser
|
|
./manage.py runserver --nostatic
|