The first error I'd expect you to get would be "import_string() failed for
'Main'", because the tuple passed to webapp2.WSGIApplication() should
include a class, not a string. Changing ('/', 'Main') to ('/', Main)
otherwise causes the above code to work fine for me. I'm just using the
following simple app.yaml:
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: main.app
Have you tried deploying to a new project?
On Saturday, October 22, 2016 at 8:10:53 PM UTC-4, Stuart Cameron wrote:
>
> I am having trouble with a very basic example using
> `users.create_login_url` based on the example code in the [How-to guide](
> https://cloud.google.com/appengine/docs/python/users/). The example works
> fine in the local development server but not when deployed to appspot.com.
>
> import webapp2
> import urllib2
> from google.appengine.api import users
>
> class Main(webapp2.RequestHandler):
> def get(self):
> login_url = users.create_login_url('/')
> self.response.write(login_url)
>
> app = webapp2.WSGIApplication([
> ('/', 'Main'),
> ], debug=True)
>
>
> Questions such as [this one on StackOverflow](
> http://stackoverflow.com/questions/19676367/notallowederror-on-front-main-page)
>
> suggest the problem is using Google Apps domain instead of Google Accounts
> API, which I think refers to the setting pictured below. Altering these
> settings has not fixed the problem.
>
> What is likely to be causing this?
>
> <https://i.stack.imgur.com/T3Y0K.png>
>
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-appengine/3f7d34df-af14-4ffd-99aa-037c15876d61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.