diff --git a/esdocs/__init__.py b/esdocs/__init__.py index a079103..b7e941f 100644 --- a/esdocs/__init__.py +++ b/esdocs/__init__.py @@ -26,7 +26,7 @@ import logging __appname__ = __package__ -__version__ = "0.1" +__version__ = "0.1.1" app_version = "{}/{}".format(__appname__, __version__) diff --git a/esdocs/contrib/esdjango/run.py b/esdocs/contrib/esdjango/run.py index b9a4b99..2357849 100644 --- a/esdocs/contrib/esdjango/run.py +++ b/esdocs/contrib/esdjango/run.py @@ -1,9 +1,13 @@ +import logging + import django from django.db import connections from ...controller import Controller from ...utils import run as base_run +logger = logging.getLogger(__name__) + class DjangoController(Controller): def parallel_prep(self): @@ -25,9 +29,13 @@ def run(): # command will be run from the same dir a Django project's manage.py). sys.path.append(os.getcwd()) - # Note: the serializers and compatibility hooks are already initialized - # in esdocs.contrib.esdjango.apps - django.setup() + try: + # Note: the serializers and compatibility hooks are already initialized + # in esdocs.contrib.esdjango.apps + django.setup() + except ImportError: + print("esdocs-django must be run from the root of your Django project (where manage.py lives).") + return base_run(DjangoController) diff --git a/setup.py b/setup.py index a682c99..f377370 100644 --- a/setup.py +++ b/setup.py @@ -33,6 +33,7 @@ 'Programming Language :: Python', 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', @@ -44,11 +45,11 @@ packages=find_packages(), py_modules=['esdocs'], - python_requires='>=3.5', + python_requires='>=3.4', install_requires=[ 'elasticsearch-dsl>6.2.1' ], - extras_requires={ + extras_require={ 'gevent': ['gevent', 'gipc'] },