packages/lang/python/django1/files/django-admin
Jeffery To 07251a0543 django1: Add python3-django1 package
This adds a Python 3 version of the django1 package.

This also adds a python-django1-common package that contains a
django-admin script based on the one in Debian[1]. This allows
python-django1 and python3-django1 to be installed at the same time.

python3-django conflicts with python-django1 (via python-django1-common)
and python3-django1.

This also updates older Python 3 Django plugin packages to depend on
python3-django1, and newer plugin packages to depend on "django", which
both python3-django and python3-django1 provide.

Because of this dependency on either version of Django, the MDEPENDS for
Python 3 Django plugin packages no longer functions correctly and has
been removed.

[1]: https://salsa.debian.org/python-team/modules/python-django/blob/debian/buster/debian/django-admin

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-02-13 15:29:59 +08:00

23 lines
661 B
Bash

#!/bin/sh
shell_code=''' '
# shell code
if command -v python3.8 > /dev/null && test -e /usr/lib/python3.8/site-packages/django/bin/django-admin.pyc
then
exec python3.8 "$0" "$@"
elif command -v python2.7 > /dev/null && test -e /usr/lib/python2.7/site-packages/django/bin/django-admin.pyc
then
exec python2.7 "$0" "$@"
else
echo "Cannot find installed version of python-django1 or python3-django1." >&2
exit 1
fi
python_code='''
# python code
# ONLY use DOUBLE quotes <"> after this line
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
# End of Python code. Do not modify this line. #'