dpaste isn't django 2.0 ready yet.

This commit is contained in:
Martin Mahner 2017-12-12 20:23:43 +01:00
parent d9bce49852
commit 352bb8da9a
3 changed files with 16 additions and 16 deletions

View file

@ -8,14 +8,7 @@ https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
""" """
import os import os
# If a 'settings_local' file is present, use it os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dpaste.settings.local")
try:
from dpaste.settings import local
settings_module = "dpaste.settings.local"
except ImportError:
settings_module = "dpaste.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_module)
from django.core.wsgi import get_wsgi_application from django.core.wsgi import get_wsgi_application
application = get_wsgi_application() application = get_wsgi_application()

View file

@ -3,13 +3,20 @@ import os
import sys import sys
if __name__ == "__main__": if __name__ == "__main__":
# If a 'settings_local' file is present, use it os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dpaste.settings.local")
try: try:
from dpaste.settings import local
settings_module = "dpaste.settings.local"
except ImportError:
settings_module = "dpaste.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_module)
from django.core.management import execute_from_command_line from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django
except ImportError:
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?"
)
raise
execute_from_command_line(sys.argv) execute_from_command_line(sys.argv)

View file

@ -49,7 +49,7 @@ setup(
}, },
include_package_data=True, include_package_data=True,
install_requires=[ install_requires=[
'django>=1.8', 'django>=1.8,<2.0',
'pygments>=1.6', 'pygments>=1.6',
'django-markup>=1.0', 'django-markup>=1.0',
], ],