Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devappserver2 not working with local shell since last GAE SDK update #97

Open
jacobg opened this issue Jan 4, 2015 · 4 comments
Open

Comments

@jacobg
Copy link
Contributor

jacobg commented Jan 4, 2015

The old devappserver has been removed, and now local shell does not work properly. It activates the test stubs, and so does not use datastore_path.

@jacobg
Copy link
Contributor Author

jacobg commented Jan 4, 2015

I patched StubManager.activate_stubs as follows to get this working in the easiest way possible:

    def activate_stubs(self, connection):

        try:
            from google.appengine.tools import dev_appserver_main
            self.setup_local_stubs(connection)
        except ImportError:

            command_line_args = sys.argv
            is_local_shell = 'shell' in command_line_args and 'remote' not in command_line_args
            datastore_path = connection.settings_dict.get('datastore_path', None) if is_local_shell else None

            self.activate_test_stubs(connection, datastore_path)

I still don't quite get why the djangoappengine setup workflow is implemented as it is. It seems that test and shell have the exact same stub setup via DatabaseWrapper. Shouldn't they be distinguished in some way? Also, setup_local_stubs needs to be fixed.

@beaumartinez
Copy link

Thanks for this @jacobg. I've ran into the same problem with newer versions of the GAE SDK—will try and use your fix.

@lucasmazz
Copy link

Thank you 👍

@gccpacman
Copy link

it it still an issue.as the traceback point out there is no 'old_dev_appserver' or 'dev_appserver' in module 'google.appengine.tools', I'm using google app engine version 1.9.19 on windows.

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "c:\Users\Yunyan\Github\djangoTest\mysite-app-engine\django\core\management\__init__.py", line 453, in exe
om_command_line
    utility.execute()
  File "c:\Users\Yunyan\Github\djangoTest\mysite-app-engine\django\core\management\__init__.py", line 392, in exe
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "c:\Users\Yunyan\Github\djangoTest\mysite-app-engine\django\core\management\__init__.py", line 263, in fet
and
    app_name = get_commands()[subcommand]
  File "c:\Users\Yunyan\Github\djangoTest\mysite-app-engine\django\core\management\__init__.py", line 109, in get
ds
    apps = settings.INSTALLED_APPS
  File "c:\Users\Yunyan\Github\djangoTest\mysite-app-engine\django\conf\__init__.py", line 53, in __getattr__
    self._setup(name)
  File "c:\Users\Yunyan\Github\djangoTest\mysite-app-engine\django\conf\__init__.py", line 48, in _setup
    self._wrapped = Settings(settings_module)
  File "c:\Users\Yunyan\Github\djangoTest\mysite-app-engine\django\conf\__init__.py", line 132, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "c:\Users\Yunyan\Github\djangoTest\mysite-app-engine\django\utils\importlib.py", line 35, in import_module
    __import__(name)
  File "c:\Users\Yunyan\Github\djangoTest\mysite-app-engine\myapp\settings.py", line 6, in <module>
    from djangoappengine.settings_base import *
  File "c:\Users\Yunyan\Github\djangoTest\mysite-app-engine\djangoappengine\settings_base.py", line 6, in <module
    setup_env()
  File "c:\Users\Yunyan\Github\djangoTest\mysite-app-engine\djangoappengine\boot.py", line 79, in setup_env
    setup_project()
  File "c:\Users\Yunyan\Github\djangoTest\mysite-app-engine\djangoappengine\boot.py", line 140, in setup_project
    from .utils import have_appserver, on_production_server
  File "c:\Users\Yunyan\Github\djangoTest\mysite-app-engine\djangoappengine\utils.py", line 24, in <module>
    "Error was: %s" % e)
Exception: Could not get appid. Is your app.yaml file missing? Error was: cannot import name old_dev_appserver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants