I am creating a new python appengine application with 2 modules (2 yamls). The default yaml is app.yaml with sits in my project root directory. The second yaml file module1.yaml which sits in the module1 directory. I have the following configuration in module1.yaml
application: appID
module: module1
version: default
runtime: python27
api_version: 1
threadsafe: true
instance_class: F1
automatic_scaling:
min_idle_instances: automatic
max_idle_instances: automatic
min_pending_latency: 500ms
max_pending_latency: 1000ms
max_concurrent_requests: 50
handlers:
- url: .*
script: module1.app
libraries:
- name: webapp2
version: latest
- name: MySQLdb
version: latest
- name: ssl
version: latest
inbound_services:
- warmup
- xmpp_message
- xmpp_presence
- xmpp_subscribe
- xmpp_error
In the same module1 directory, I have the file module1.app which has the following code
#!/usr/bin/env python
import sys
import webapp2
# Module Imports
import routes
# Define app
module1_app = webapp2.WSGIApplication(debug = True)
# Add to path
if 'libs' not in sys.path:
sys.path[0:0] = ['libs']
# Add defined routes
routes.add_routes(module1_app)
In the same module1 directory I have routes.py which contains by routing configuration.
When I start the dev server using the following command
python dev_appserver.py app.yaml module1/module1.yaml
, I receive the following output:
INFO 2015-03-18 15:56:05,149 api_server.py:172] Starting API server at: http://localhost:38640
INFO 2015-03-18 15:56:05,159 dispatcher.py:185] Starting module "default" running at: http://localhost:8080
INFO 2015-03-18 15:56:05,164 dispatcher.py:185] Starting module "module1" running at: http://localhost:8081
INFO 2015-03-18 15:56:05,167 admin_server.py:118] Starting admin server at: http://localhost:8000
ERROR 2015-03-18 15:56:06,493 wsgi.py:263]
Traceback (most recent call last):
File "/home/user1/servers/gae/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/home/user1/servers/gae/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/home/user1/servers/gae/google/appengine/runtime/wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
ImportError: No module named module1
INFO 2015-03-18 15:56:06,510 module.py:709] comm: "GET /_ah/warmup HTTP/1.1" 500 -
Can anyone explain this error to me ? What can I do to fix this ?