-
Notifications
You must be signed in to change notification settings - Fork 81
/
Makefile
44 lines (33 loc) · 1.36 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
setup:
make clean
mkdir -p testing
make prep-env envname=py3.9-dj2.2
make prep-env envname=py3.9-dj3.1
make prep-env envname=py3.9-dj3.2
start-22:
make runserver envname=py3.9-dj2.2
start-31:
make runserver envname=py3.9-dj3.1
start-32:
make runserver envname=py3.9-dj3.2
prep-env:
mkdir testing/$(envname)
.tox/$(envname)/bin/django-admin startproject testproject testing/$(envname)
.tox/$(envname)/bin/pip install -e .
ln -s ../../examples/contact_form testing/$(envname)/
ln -s ../../examples/simple testing/$(envname)/
gsed -i "40 i 'simple', 'contact_form'," testing/$(envname)/testproject/settings.py
.tox/$(envname)/bin/python testing/$(envname)/manage.py migrate
cp examples/testproject/urls.py testing/$(envname)/testproject/
# not supported in django 2.x
# DJANGO_SUPERUSER_USERNAME=admin DJANGO_SUPERUSER_PASSWORD=admin [email protected] .tox/$(envname)/bin/python testing/$(envname)/manage.py createsuperuser --noinput
echo "from django.contrib import auth; auth.get_user_model().objects.create_superuser('admin', '[email protected]', 'admin')" | .tox/$(envname)/bin/python testing/$(envname)/manage.py shell
runserver:
.tox/$(envname)/bin/python testing/$(envname)/manage.py runserver localhost:8000
clean:
rm -rf testing
release:
rm -rf dist
python setup.py sdist
python setup.py bdist_wheel
twine upload dist/*