Using pyramid_appengine my project works fine but, when i deploy to GAE i have this error:
Traceback (most recent call last):
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 187, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 225, in _LoadHandler
handler = __import__(path[0])
File "/base/data/home/apps/s~muncompy/v3.359898035587494190/muncompy/__init__.py", line 36, in <module>
application = make_app()
File "/base/data/home/apps/s~muncompy/v3.359898035587494190/muncompy/__init__.py", line 32, in make_app
config.scan()
File "/base/data/home/apps/s~muncompy/v3.359898035587494190/pyramid/config/__init__.py", line 912, in scan
ignore=ignore)
File "/base/data/home/apps/s~muncompy/v3.359898035587494190/venusian/__init__.py", line 189, in scan
__import__(modname)
File "/base/data/home/apps/s~muncompy/v3.359898035587494190/muncompy/conftest.py", line 6, in <module>
from google.appengine.tools import dev_appserver_index
ImportError: No module named tools
Any ideas for why module tools from google.appengine is missing?
Related
I run the python code from the root. Shows an error when I just imported the module:
ERROR : Traceback (most recent call last):
File "/home/amir/photo.py", line 4, in <module>
import pyautogui as gui
File "/usr/local/lib/python3.9/dist-packages/pyautogui/__init__.py", line 249, in <module>
import mouseinfo
File "/usr/local/lib/python3.9/dist-packages/mouseinfo/__init__.py", line 223, in <module>
_display = Display(os.environ['DISPLAY'])
File "/usr/local/lib/python3.9/dist-packages/Xlib/display.py", line 80, in __init__
self.display = _BaseDisplay(display)
File "/usr/local/lib/python3.9/dist-packages/Xlib/display.py", line 62, in __init__
display.Display.__init__(*(self, ) + args, **keys)
File "/usr/local/lib/python3.9/dist-packages/Xlib/protocol/display.py", line 129, in __init__
raise error.DisplayConnectionError(self.display_name, r.reason)
Xlib.error.DisplayConnectionError: Can't connect to display ":1": b'No protocol specified\n'
I'm currently trying to setting up django-nose in my project.
I also used Djangae (https://djangae.readthedocs.org/en/latest/) for app engine compatibility.
I add 'django_nose' in my INSTALLED_APPS
I set TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
Launching "python manage.py test" is not raising any exceptions.
But when I want to launch the server with "python manage.py runserver", the server is running but when I try to call "localhost:8000" I get :
ERROR 2016-03-23 15:59:49,299 wsgi.py:263]
Traceback (most recent call last):
File "/Users/briva/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/Users/briva/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/Users/briva/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 96, in LoadObject
__import__(cumulative_path)
File "/Users/briva/Desktop/dangoptest/dangoptest/wsgi.py", line 18, in <module>
application = DjangaeApplication(get_wsgi_application())
File "/Users/briva/Desktop/dangoptest/lib/django/core/wsgi.py", line 13, in get_wsgi_application
django.setup()
File "/Users/briva/Desktop/dangoptest/lib/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/briva/Desktop/dangoptest/lib/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/Users/briva/Desktop/dangoptest/lib/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "lib/django_nose/__init__.py", line 5, in <module>
from django_nose.runner import BasicNoseRunner, NoseTestSuiteRunner
File "lib/django_nose/runner.py", line 61, in <module>
from django.test.simple import DjangoTestSuiteRunner as DiscoverRunner
ImportError: No module named simple
Thanks for answers.
When I run manage.py test everything is working normally, but if run test with PyCharm Django Tests it gives me following error:
Error
Traceback (most recent call last):
File "/usr/lib/python3.4/unittest/case.py", line 58, in testPartExecutor
yield
File "/usr/lib/python3.4/unittest/case.py", line 577, in run
testMethod()
File "/usr/lib/python3.4/unittest/loader.py", line 32, in testFailure
raise exception
ImportError: Failed to import test module: order_form.tests
Traceback (most recent call last):
File "/usr/lib/python3.4/unittest/loader.py", line 312, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python3.4/unittest/loader.py", line 290, in _get_module_from_name
__import__(name)
File "/home/vagrant/project/order_form/tests.py", line 2, in <module>
from .models import Order
File "/home/vagrant/project/order_form/models.py", line 3, in <module>
from cms.models.pluginmodel import CMSPlugin
File "/home/vagrant/.virtualenvs/env/lib/python3.4/site-packages/cms/models/__init__.py", line 3, in <module>
from .pagemodel import * # nopyflakes
File "/home/vagrant/.virtualenvs/env/lib/python3.4/site-packages/cms/models/pagemodel.py", line 6, in <module>
from django.contrib.sites.models import Site
File "/home/vagrant/.virtualenvs/env/lib/python3.4/site-packages/django/contrib/sites/models.py", line 83, in <module>
class Site(models.Model):
File "/home/vagrant/.virtualenvs/env/lib/python3.4/site-packages/django/db/models/base.py", line 102, in __new__
"INSTALLED_APPS." % (module, name)
RuntimeError: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
Yes, I've enabled 'django.contrib.sites' in INSTALLED_APPS and SITE_ID is set.
Any ideas?
I created local virtualenv and install same requirements — tests work fine with it.
Thanks, everybody for comments.
After enabling the harvester module for CKAN, I'm getting the following error in ckan_default.error.log (and the web application returns status 500 until I disable the harvest and ckan_harvester plugins from config file):
mod_wsgi (pid=1605): Target WSGI script '/etc/ckan/default/apache.wsgi' cannot be loaded as Python module.
mod_wsgi (pid=1605): Exception occurred processing WSGI script '/etc/ckan/default/apache.wsgi'.
Traceback (most recent call last):
File "/etc/ckan/default/apache.wsgi", line 9, in <module>
application = loadapp('config:%s' % config_filepath)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/util.py", line 56, in fix_call
val = callable(*args, **kw)
File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware.py", line 58, in make_app
load_environment(conf, app_conf)
File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 232, in load_environment
p.load_all(config)
File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 134, in load_all
load(*plugins)
File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 148, in load
service = _get_service(plugin)
File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 254, in _get_service
return plugin.load()(name=plugin_name)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/pkg_resources/__init__.py", line 2355, in load
return self.resolve()
File "/usr/lib/ckan/default/lib/python2.6/site-packages/pkg_resources/__init__.py", line 2361, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/ckan/default/src/ckanext-harvest/ckanext/harvest/plugin.py", line 31, in <module>
class Harvest(p.SingletonPlugin, DefaultDatasetForm, DefaultTranslation):
File "/usr/lib/ckan/default/src/ckanext-harvest/ckanext/harvest/plugin.py", line 43, in Harvest
p.implements(p.ITranslation, inherit=True)
AttributeError: 'module' object has no attribute 'ITranslation'
I found some similar errors but not for CKAN and 'ITranslation', any help appreciated.
Thanks
Fixed it! Just upgraded current 2.5.0a installation to latest DEV version (2.6.0a) and it worked without problems...
Thanks!
I am trying to deploy django that now runs locally on ec2 ubuntu server. I got this while trying to run python mange.py runserver
i searched nothing seems to solve this
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 459, in execute_manager
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 69, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/runserver.py", line 4, in <module>
from django.core.management.commands.runserver import BaseRunserverCommand
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 8, in <module>
from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException, get_internal_wsgi_application
File "/usr/local/lib/python2.7/dist-packages/django/core/servers/basehttp.py", line 28, in <module>
from django.contrib.staticfiles import handlers
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/handlers.py", line 8, in <module>
from django.contrib.staticfiles.views import serve
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/views.py", line 15, in <module>
from django.contrib.staticfiles import finders
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/finders.py", line 11, in <module>
from django.contrib.staticfiles.storage import AppStaticStorage
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/storage.py", line 10, in <module>
from django.core.cache import (get_cache, InvalidCacheBackendError,
File "/usr/local/lib/python2.7/dist-packages/django/core/cache/__init__.py", line 187, in <module>
cache = get_cache(DEFAULT_CACHE_ALIAS)
File "/usr/local/lib/python2.7/dist-packages/django/core/cache/__init__.py", line 172, in get_cache
backend, location, params = parse_backend_conf(backend, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/core/cache/__init__.py", line 125, in parse_backend_conf
backend = args.pop('BACKEND')
KeyError: 'BACKEND'
Set the backend in your Settings.py