kopia lustrzana https://github.com/rtts/django-simplecms
28 wiersze
569 B
Bash
Executable File
28 wiersze
569 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
test -z $1 && echo "Please provide a project name!" && 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" "$1"
|
|
cp "$example_dir"/../manage.py .
|
|
sed -i "s/example/$1/" manage.py
|
|
sed -i "s/example/$1/" "$1"/wsgi.py
|
|
cat << EOF > .gitignore
|
|
*.pyc
|
|
__pycache__/
|
|
EOF
|
|
|
|
cat <<EOF
|
|
|
|
Successfully created project "$1"!
|
|
|
|
Things to do next:
|
|
- create a database
|
|
- ./manage.py migrate
|
|
- ./manage.py createsuperuser
|
|
- ./manage.py runserver --nostatic
|
|
|
|
EOF
|