1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-10-31 19:44:16 +00:00

update django files to Django 2

This commit is contained in:
catborise 2020-05-26 22:23:57 +03:00 committed by catborise
parent bf15de507a
commit 62f8ece0ef
3 changed files with 26 additions and 11 deletions

View file

@ -1,10 +1,21 @@
#!/usr/bin/env python3 #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os import os
import sys import sys
if __name__ == "__main__":
os.environ["DJANGO_SETTINGS_MODULE"] = "webvirtcloud.settings"
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webvirtcloud.settings')
try:
from django.core.management import execute_from_command_line from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv) execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()

View file

@ -8,7 +8,9 @@ https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
""" """
import os import os
os.environ["DJANGO_SETTINGS_MODULE"] = "webvirtcloud.settings"
from django.core.wsgi import get_wsgi_application from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webvirtcloud.settings')
application = get_wsgi_application() application = get_wsgi_application()

View file

@ -6,15 +6,17 @@ It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/ https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
""" """
import os, sys import os
import sys
from django.core.wsgi import get_wsgi_application from django.core.wsgi import get_wsgi_application
# execfile('/srv/webvirtcloud/venv/bin/activate_this.py', dict(__file__='/srv/webvvirtcloud/venv/bin/activate_this.py')) # execfile('/srv/webvirtcloud/venv/bin/activate_this.py', dict(__file__='/srv/webvirtcloud/venv/bin/activate_this.py'))
exec(compile(open('/srv/webvirtcloud/venv/bin/activate_this.py', "rb").read(), exec(compile(open('/srv/webvirtcloud/venv/bin/activate', "rb").read(),
'/srv/webvirtcloud/venv/bin/activate_this.py', 'exec')) '/srv/webvirtcloud/venv/bin/activate', 'exec'))
sys.path.append('/srv/webvirtcloud') sys.path.append('/srv/webvirtcloud')
os.environ["DJANGO_SETTINGS_MODULE"] = "webvirtcloud.settings"
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webvirtcloud.settings')
application = get_wsgi_application() application = get_wsgi_application()