localinit as makefile added
This commit is contained in:
parent
6f26337f60
commit
8af997e354
18
__make.d__/config.mk
Normal file
18
__make.d__/config.mk
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
.ONESHELL:
|
||||||
|
SHELL = /usr/bin/bash
|
||||||
|
.SILENT:
|
||||||
|
|
||||||
|
localinit:
|
||||||
|
if [[ ! -e config.py ]]; then
|
||||||
|
cp config_example/config.py config.py
|
||||||
|
chmod 600 config.py
|
||||||
|
SECRET_KEY=$$(python -c "import random; print(''.join([random.choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for n in range(50)]))")
|
||||||
|
sed -i "/^SECRET_KEY.*=.*None/c\SECRET_KEY = \"$$SECRET_KEY\"" config.py
|
||||||
|
sed -i "/^DEBUG.*=.*/c\DEBUG = True" config.py
|
||||||
|
fi
|
||||||
|
if [[ ! -e db.sqlite3 ]]; then
|
||||||
|
venv/bin/python manage.py migrate
|
||||||
|
echo "*****************************************************************************************"
|
||||||
|
echo "** YOU might want to create asuperuser with: venv/bin/python manage.py createsuperuser **"
|
||||||
|
echo "*****************************************************************************************"
|
||||||
|
fi
|
6
__make.d__/run.mk
Normal file
6
__make.d__/run.mk
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
.ONESHELL:
|
||||||
|
SHELL = /usr/bin/bash
|
||||||
|
.SILENT:
|
||||||
|
|
||||||
|
run: init
|
||||||
|
venv/bin/python manage.py runserver
|
Loading…
x
Reference in New Issue
Block a user