2020-07-08 01:03:31 +00:00
|
|
|
depends: virtual_env
|
|
|
|
. virtual_env/bin/activate; pip install -U -r requirements.frozen.txt
|
|
|
|
|
|
|
|
depends-latest: virtual_env
|
|
|
|
. virtual_env/bin/activate; pip install -U -r requirements.txt
|
2020-07-09 07:25:20 +00:00
|
|
|
make licenses
|
|
|
|
-rm webproj/templates/licenses.txt
|
|
|
|
-rm webproj/templates/licenses.json
|
|
|
|
-rm webproj/templates/licenses.html
|
|
|
|
-rm webproj/static_source/licenses.html
|
|
|
|
cp licenses.txt webproj/templates/licenses.txt
|
|
|
|
cp licenses.json webproj/templates/licenses.json
|
|
|
|
cp licenses.html webproj/templates/licenses.html
|
|
|
|
cp licenses.html webproj/static_source/licenses.html
|
|
|
|
make freeze
|
|
|
|
. virtual_env/bin/activate; pip install -U -r requirements-dev.txt
|
2020-07-08 01:03:31 +00:00
|
|
|
|
|
|
|
depends-latest-lean:
|
|
|
|
rm -rf virtual_env
|
|
|
|
-make virtual_env_lean
|
|
|
|
make depends-latest
|
|
|
|
|
|
|
|
virtual_env:
|
|
|
|
-make virtual_env_lean
|
|
|
|
make depends
|
|
|
|
|
|
|
|
virtual_env_lean:
|
|
|
|
python3 -m virtualenv virtual_env
|
|
|
|
|
|
|
|
removepycache:
|
|
|
|
find webproj -name \*.pyc -delete
|
|
|
|
find webproj -name __pycache__ -delete
|
|
|
|
du -sh webproj
|
|
|
|
|
|
|
|
init: virtual_env
|
|
|
|
. virtual_env/bin/activate; python manage.py migrate
|
|
|
|
. virtual_env/bin/activate; python manage.py createcachetable
|
|
|
|
- rm -rf static
|
|
|
|
mkdir -p static
|
|
|
|
. virtual_env/bin/activate; yes yes | python manage.py collectstatic
|
|
|
|
|
|
|
|
all: depends init virtual_env
|
|
|
|
@echo ""
|
|
|
|
@echo "Done"
|
|
|
|
@echo ""
|
|
|
|
|
|
|
|
test: virtual_env
|
|
|
|
-rm __init__.py
|
|
|
|
. virtual_env/bin/activate; python manage.py test --noinput
|
|
|
|
touch __init__.py
|
|
|
|
|
|
|
|
freeze:
|
|
|
|
. virtual_env/bin/activate; python -m pip freeze > requirements.frozen.txt
|
|
|
|
|
|
|
|
gzip_static_media:
|
|
|
|
-find ./static -name "*.gz" | xargs rm
|
|
|
|
-find ./media -name "*.gz" | xargs rm
|
|
|
|
-gzip -frk9 ./static
|
|
|
|
-gzip -frk9 ./media
|
|
|
|
|
2020-07-09 07:25:20 +00:00
|
|
|
licenses: virtual_env
|
|
|
|
. virtual_env/bin/activate; pip-licenses | tee licenses.txt
|
|
|
|
. virtual_env/bin/activate; pip-licenses -audf html > licenses.html
|
|
|
|
. virtual_env/bin/activate; pip-licenses -audf json > licenses.json
|
|
|
|
|
2020-07-08 01:03:31 +00:00
|
|
|
serve: virtual_env
|
|
|
|
. virtual_env/bin/activate; (\
|
|
|
|
virtual_env/bin/uvicorn \
|
|
|
|
webproj.asgi:application \
|
|
|
|
--host 0.0.0.0 \
|
|
|
|
--port 34891 \
|
|
|
|
--workers 8 \
|
|
|
|
--lifespan off \
|
|
|
|
)
|
|
|
|
|
|
|
|
addlang:
|
|
|
|
. virtual_env/bin/activate; cd webproj; python ../manage.py makemessages -l $(LANG)
|
|
|
|
|
|
|
|
new-superuser:
|
|
|
|
. virtual_env/bin/activate; python manage.py createsuperuser
|
|
|
|
|
|
|
|
devserver: virtual_env
|
|
|
|
-@mkdir -p static
|
|
|
|
. virtual_env/bin/activate; python manage.py makemigrations
|
|
|
|
. virtual_env/bin/activate; python manage.py migrate
|
|
|
|
. virtual_env/bin/activate; python manage.py createcachetable
|
|
|
|
. virtual_env/bin/activate; yes yes | python manage.py collectstatic
|
|
|
|
. virtual_env/bin/activate; python manage.py runserver 0.0.0.0:8000
|
|
|
|
|
|
|
|
devserverprod: virtual_env
|
|
|
|
. virtual_env/bin/activate; python manage.py runserver 0.0.0.0:34891
|
|
|
|
|
|
|
|
sync_act:
|
|
|
|
. virtual_env/bin/activate; python manage.py syncremote
|
|
|
|
|
|
|
|
check_sanity:
|
|
|
|
. virtual_env/bin/activate; ./check_sanity.sh
|