localinit as makefile added
This commit is contained in:
parent
5d8166a64d
commit
5df6bcc390
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
|
@ -45,6 +45,9 @@ PASSWORD_RESET_TIMEOUT = 60 * 60 * 3 # 3 hours
|
||||
# EMAIL_SSL_KEYFILE =
|
||||
# Define an ssl certificate
|
||||
# EMAIL_SSL_CERTFILE =
|
||||
# Define the administrators (for mail delivery)
|
||||
# ADMINS = [("PaTT", EMAIL_FROM), ]
|
||||
|
||||
|
||||
#
|
||||
# Django
|
||||
@ -57,10 +60,6 @@ DEBUG = False
|
||||
# SECURITY WARNING: don't run with a dummy secret in production! And don't let others read this key!
|
||||
SECRET_KEY = None
|
||||
|
||||
# Define the administrators (for mail delivery)
|
||||
ADMINS = [("PaTT", EMAIL_FROM), ]
|
||||
|
||||
|
||||
# This defines the listener hostnames for your django server
|
||||
# SECURITY WARNING: don't run with '0.0.0.0' in in production, unless you know what you are doing!
|
||||
# ALLOWED_HOSTS = ['<YOUR_SERVER_HOSTNAME>', ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user