Questions tagged [webapp2]

webapp2 is a lightweight Python web framework compatible with Google App Engine's webapp.

webapp2 is a lightweight Python web framework compatible with Google App Engine's webapp.

webapp2 extends webapp to offer better URI routing and exception handling, a full featured response object and a more flexible dispatching mechanism. It also includes sessions, internationalization, domain and subdomain routing, secure cookies and support for threaded environments.

webapp2 can also be used outside of Google App Engine, independently of the App Engine SDK.

References:

968 questions
56
votes
2 answers

What do the chars %7D mean in an url query?

If I access my webapp with the url /vi/5907399890173952.html then it works but when I look in the log files then googlebot is trying to access a similar url which generates an exception: /vi/5907399890173952.html%7D%7D what does it mean and how can…
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424
38
votes
5 answers

How to properly output JSON with app engine Python webapp2?

Right now I am currently just doing this: self.response.headers['Content-Type'] = 'application/json' self.response.out.write('{"success": "some var", "payload": "some var"}') Is there a better way to do it using some library?
Ryan
  • 5,883
  • 13
  • 56
  • 93
27
votes
2 answers

Webapp2 for Authentication and Login

I would like to roll my own login system for my python Google App Engine application (rather than using Google's users api). I am using webapp2, and I noticed that there is a webapp2_extras.auth module and an incomplete auth tutorial. Does anyone…
zzz
  • 2,515
  • 4
  • 28
  • 38
25
votes
1 answer

How to add Conditional CSS class based on Python If statement

How do you add a conditional CSS class based on a Python if statement in the following example to show the has-success has-feedback form element?
Robert
  • 431
  • 1
  • 6
  • 10
22
votes
3 answers

Pymongo/bson: Convert python.cursor.Cursor object to serializable/JSON object

New to MongoDb and Python (webapp2). So, I was fetching some data from a mongodb database. But I was unable to use json.dumps on the returned data. Here's my code: exchangedata = db.Stock_Master.find({"Country": "PHILIPPINES"}, {"_id" : 0}) …
Tarun Dugar
  • 8,921
  • 8
  • 42
  • 79
20
votes
1 answer

What is a lazy property?

While looking through the webapp2 documentation online, I found information on the decorator: webapp2.cached_property In the documentation, it says: A decorator that converts a function into a lazy property. My question is: → What is a lazy…
user3306593
19
votes
9 answers

How do I make a trailing slash optional with webapp2?

I'm using the new webapp2 (now the default webapp in 1.6), and I haven't been able to figure out how to make the trailing slash optional in code like this: webapp.Route('/feed', handler = feed) I've tried /feed/?, /feed/*, /feed\/* and /feed\/?,…
Sudhir Jonathan
  • 16,998
  • 13
  • 66
  • 90
19
votes
4 answers

How to make a redirect and keep the query string?

I want to make a redirect and keep what is the query string. Something like self.redirect plus the query parameters that was sent. Is that possible?
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424
18
votes
3 answers

Is there any available solution to provide xsrf/csrf support for Google app engine?

Cross-site request forgery is common on web now a days. I am facing this in my own site deployed on Google App engine. I got to know this by examining access logs. Is there any XSRF/CSRF library or other solution available for App engine that I can…
Gagandeep Singh
  • 5,755
  • 4
  • 41
  • 60
18
votes
2 answers

webapp2 + jinja2: How can i get uri_for() working in jinja2-views

How can i add pass Model-Specific urls to the Template. Let's say, i want to build an edit-link. I would guess, using the uri_for() function would be an easy approach. But the following gives me "UndefinedError: 'webapp2' is undefined" {%…
crushervx
  • 587
  • 1
  • 7
  • 18
17
votes
2 answers

can't use cypress to test app using using firestore local emulator

I have a app built with vue and firebase/firestore. I use the firebase emulator to local development and am trying to integrate my dev workflow with cypress. But i get a error in cypress that do not occur if i access the app from browser. Firebase…
15
votes
2 answers

webapp2 with python3

I use webapp2 with python 2.7 with or without googleAppEngine. I'm now trying to use it with Python 3.3 I've used PIP to install webapp2 Install run with success but when I try to import webapp2 from IDLE gaves me the folowing error: File…
ZEE
  • 2,931
  • 5
  • 35
  • 47
15
votes
3 answers

GAE webapp2 session: the correct process of creating and checking sessions

I tried to implement GAE's webapp2 session, but there seems very little documentation about it. According to http://webapp-improved.appspot.com/api/webapp2_extras/sessions.html, my steps are as follows: 1.Configure and add config to the main…
Randy Tang
  • 4,283
  • 12
  • 54
  • 112
13
votes
3 answers

Understanding global object persistence in Python WSGI apps

Consider the following code in my WebApp2 application in Google App Engine: count = 0 class MyHandler(webapp2.RequestHandler): def get(self): global count count = count + 1 print count With each refresh of the page,…
Yarin
  • 173,523
  • 149
  • 402
  • 512
13
votes
6 answers

Partial matching GAE search API

Using the GAE search API is it possible to search for a partial match? I'm trying to create autocomplete functionality where the term would be a partial word. eg. > b > bui > build would all return "building". How is this possible with GAE?
bradley
  • 776
  • 2
  • 11
  • 29
1
2 3
64 65