Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing GAE Webapp2 with classes in more than one file
    primarykey
    data
    text
    <p>I'm having problems with Webapp2. When I put handlers for URLs that point to different python files in the app.yaml I get the following error:</p> <pre><code>ERROR 2012-10-06 16:44:57,759 wsgi.py:203] Traceback (most recent call last): File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 195, in Handle handler = _config_handle.add_wsgi_middleware(self._LoadHandler()) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 250, in _LoadHandler __import__(cumulative_path) ImportError: No module named application </code></pre> <p>My app.yaml:</p> <pre><code>application: [[app's name]] version: 1 runtime: python27 api_version: 1 threadsafe: yes inbound_services: - mail handlers: - url: /send script: email.application - url: /_ah/mail/update@sitdown-standup.appspotmail.com.* script: email.application - url: /.* script: SDSUmodels.application libraries: - name: webapp2 version: "2.5.1" </code></pre> <p>SDSUmodels.py ends with:</p> <pre><code>application = webapp2.WSGIApplication([('/info', MakeBasicInfo)], debug=True)` </code></pre> <p>and email.py ends with:</p> <pre><code>application = webapp2.WSGIApplication([('/request', Request_update), ('/send', Send_report), (Receive_email.mapping())], debug=True)` </code></pre> <p>When I remove these lines</p> <pre><code>- url: /send script: email.application </code></pre> <p>from app.yaml, the error stops, but this leaves me without a way to point a URL towards a particular file.</p> <p>I can see some alternative ways of handling this in <a href="https://stackoverflow.com/questions/11181957/how-to-organise-files-with-python27-app-engine-webapp2-framework">this question</a> but I was wondering why this approach isn't working. I've done this previously with the old webapp version in a different project and it's worked – details below.</p> <p>app.yaml:</p> <pre><code>application: [[other app's name]] version: 1 runtime: python api_version: 1 handlers: - url: /stylesheets static_dir: stylesheets - url: /twitter script: twitter.py - url: /_ah/mail/kindle@shelvdtracker.appspotmail.com.* script: kindle.py - url: /.* script: web.py inbound_services: - mail </code></pre> <p>twitter.py ends with:</p> <pre><code>application = webapp.WSGIApplication( [('/twitter', Process_new_DM)], debug=True) def main(): run_wsgi_app(application) if __name__ == "__main__": main() </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload