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
|
|
|
|
cp licenses.txt webproj/templates/licenses.txt
|
|
|
|
cp licenses.json webproj/templates/licenses.json
|
|
|
|
cp licenses.html webproj/templates/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-08-28 06:52:30 +00:00
|
|
|
serve_uvicorn: virtual_env
|
2020-07-08 01:03:31 +00:00
|
|
|
. virtual_env/bin/activate; (\
|
|
|
|
virtual_env/bin/uvicorn \
|
|
|
|
webproj.asgi:application \
|
|
|
|
--host 0.0.0.0 \
|
|
|
|
--port 34891 \
|
2020-08-28 06:52:30 +00:00
|
|
|
--workers 4 \
|
2020-07-08 01:03:31 +00:00
|
|
|
--lifespan off \
|
|
|
|
)
|
|
|
|
|
2020-08-28 06:52:30 +00:00
|
|
|
serveondev_uvicorn: virtual_env
|
|
|
|
. virtual_env/bin/activate; (\
|
|
|
|
virtual_env/bin/uvicorn \
|
|
|
|
webproj.asgi:application \
|
|
|
|
--host 0.0.0.0 \
|
|
|
|
--port 8000 \
|
|
|
|
--workers 4 \
|
|
|
|
--lifespan off \
|
|
|
|
)
|
|
|
|
|
|
|
|
serve_daphne: virtual_env
|
|
|
|
. virtual_env/bin/activate; (\
|
|
|
|
virtual_env/bin/daphne \
|
|
|
|
webproj.asgi:application \
|
|
|
|
-b 0.0.0.0 \
|
|
|
|
-p 34891 \
|
|
|
|
)
|
|
|
|
|
|
|
|
serveondev_daphne: virtual_env
|
|
|
|
. virtual_env/bin/activate; (\
|
|
|
|
virtual_env/bin/daphne \
|
|
|
|
webproj.asgi:application \
|
|
|
|
-b 0.0.0.0 \
|
|
|
|
-p 8000 \
|
|
|
|
)
|
|
|
|
|
|
|
|
serve_uwsgi: virtual_env
|
|
|
|
. virtual_env/bin/activate; (\
|
|
|
|
virtual_env/bin/uwsgi \
|
|
|
|
--http :34891 \
|
|
|
|
--virtualenv virtual_env \
|
|
|
|
--module webproj.wsgi \
|
|
|
|
--master --enable-threads \
|
2020-09-04 17:20:52 +00:00
|
|
|
--threads 3 \
|
|
|
|
--workers 1 \
|
2020-08-28 06:52:30 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
serveondev_uwsgi: virtual_env
|
|
|
|
. virtual_env/bin/activate; (\
|
|
|
|
virtual_env/bin/uwsgi \
|
|
|
|
--http :8000 \
|
|
|
|
--virtualenv virtual_env \
|
|
|
|
--module webproj.wsgi \
|
|
|
|
--master --enable-threads \
|
2020-09-04 17:20:52 +00:00
|
|
|
--threads 3 \
|
|
|
|
--workers 1 \
|
2020-08-28 06:52:30 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
serve: virtual_env
|
|
|
|
make serve_uwsgi
|
|
|
|
|
|
|
|
serveondev: virtual_env
|
|
|
|
make serveondev_uwsgi
|
|
|
|
|
2020-07-08 01:03:31 +00:00
|
|
|
addlang:
|
|
|
|
. virtual_env/bin/activate; cd webproj; python ../manage.py makemessages -l $(LANG)
|
|
|
|
|
|
|
|
new-superuser:
|
|
|
|
. virtual_env/bin/activate; python manage.py createsuperuser
|
|
|
|
|
2020-07-09 20:39:12 +00:00
|
|
|
bg-tasks: virtual_env
|
|
|
|
. virtual_env/bin/activate; python manage.py process_tasks
|
|
|
|
|
2020-07-10 04:57:06 +00:00
|
|
|
bg-tasks-dev: virtual_env
|
|
|
|
. virtual_env/bin/activate; python manage.py process_tasks --dev
|
|
|
|
|
2020-07-08 01:03:31 +00:00
|
|
|
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
|