tipfy

How do I save web images to App Engine's blobstore?

扶醉桌前 提交于 2020-01-01 19:16:38
问题 I've used this question as a template to solve the same problem, but I'm running into issues when posting. I have these components: HTML form with a textbox for the image URL. This posts to... A handler that takes the posted URL, encodes it, and uses urlfetch to post it again to... A separate file upload handler that does the actual saving. Component #3 works fine by itself if I use a file input. But I don't quite understand how to get urlfetch what it needs from just the image URL. My

Tipfy: How to display blob in template?

我们两清 提交于 2020-01-01 14:35:02
问题 Given is on gae using tipfy (python) the following model: greeting.avatar = db.Blob(avatar) What is the template-tag to display a blob (here image)? 回答1: In this case the blob is an an image, which is great. Just use images.get_serving_url(blob_key) and you're happy. I've used this function, and trust me, it is awesome for serving images. Just append =sxx to the url where xx is the pixel size you want. It automatically resizes the image and serves it. If the blob isn't an image, then you're

Calculating unique elements from huge list in Google App Engine

依然范特西╮ 提交于 2019-12-24 09:49:56
问题 I got a web widget with 15,000,000 hits/months and I log every session. When I want to generate a report I'd like to know how many unique IP there are. In normal SQL that would be easy as I'd just do a: SELECT COUNT(*) FROM (SELECT DISTINCT IP FROM SESSIONS) But as that's not possible with the app engine, I'm now looking into solutions on how to do it. It doesn't need to be fast. A solution I was thinking of was to have an empty Unique-IP table, then have a MapReduce job to go through all

Use a ListProperty or custom tuple property in App Engine?

血红的双手。 提交于 2019-12-24 04:06:28
问题 I'm developing an application with Google App Engine and stumbled across the following scenario, which can perhaps be described as "MVP-lite". When modeling many-to-many relationships, the standard property to use is the ListProperty. Most likely, your list is comprised of the foreign keys of another model. However, in most practical applications, you'll usually want at least one more detail when you get a list of keys - the object's name - so you can construct a nice hyperlink to that object

Tipfy: “NotFound: 404” when accessing multi-auth example locally

我们两清 提交于 2019-12-13 16:15:55
问题 I am using the Tipfy framework ( tipfy.org ) on the Google App Engine. I would like to extend the multi-auth example ( http://tipfy-auth.appspot.com/ ). To try the example, I installed Tipfy. The *hello_world* app is accessible through the browser if I run the local server. Then I added the multi-auth app in a second directory called multi_auth, added it in the config.py *apps_installed* list (removed hello_world) and reloaded the page. I get the following output: Traceback (most recent call

How do I store a fetched entity in memcache for App Engine?

心已入冬 提交于 2019-12-11 21:08:04
问题 Because each new request in App Engine creates a new Handler, the entity I'd like to alter and put (using POST) has to be retrieved again. This seems wasteful, since I've populated the form with the information from GET a moment earlier. How do I store a key, fetched entity, or key/entity pair in memcache for App Engine? 回答1: From here: def get_data(): data = memcache.get("key") if data is not None: return data else: data = self.query_for_data() memcache.add("key", data, 60) return data

tipfy nosetest ImportError: No module named fancy_urllib

核能气质少年 提交于 2019-12-07 11:12:27
问题 I am trying to run nosetest using tipfy and google app engine but I keep getting an import error: From the google_appengine directory I execute the following command (directory contains dev_appserver.py): nosetests /Users/me/Documents/python/project/ --with-gae --without-sandbox but I get the following error: Traceback (most recent call last): File "/usr/local/bin/nosetests", line 8, in <module> load_entry_point('nose==0.11.4', 'console_scripts', 'nosetests')() File "/Library/Python/2.6/site

How do I save web images to App Engine's blobstore?

人走茶凉 提交于 2019-12-04 19:15:28
I've used this question as a template to solve the same problem, but I'm running into issues when posting. I have these components: HTML form with a textbox for the image URL. This posts to... A handler that takes the posted URL, encodes it, and uses urlfetch to post it again to... A separate file upload handler that does the actual saving. Component #3 works fine by itself if I use a file input. But I don't quite understand how to get urlfetch what it needs from just the image URL. My process either times out or gets a 500 response from the final handler. # 1 class URLMainHandler

How to write Big files into Blobstore using experimental API?

余生长醉 提交于 2019-11-30 12:14:32
问题 I have dilemma.. I'm uploading files both in scribd store and blobstore using tipfy as framework. I have webform with action is not created by blobstore.create_upload_url (i'm just using url_for('myhandler')). I did it because if i'm using blobstore handler the POST response parsed and I cannot use normal python-scribd api to upload file into scribd store. Now I have working scribd saver: class UploadScribdHandler(RequestHandler, BlobstoreUploadMixin): def post(self): uploaded_file = self

Authentication using any OpenID with Tipfy

拟墨画扇 提交于 2019-11-30 02:23:49
I am developing the authentication part of my app and I've run into issues with coding authentication using OpenID. I've looked at the Tipfy example code, but it seems written under the assumption that the OpenID provider is hard-coded to google. I would like the user to be able to provide any OpenID they desire (isn't that the point?). Does anyone have any example code that shows a user logging in using a user-supplied OpenID? Does Tipfy allow any OpenID authentication? If you want to authenticate any OpenID Url with Tipfy, you can't do it out of the box. One main reason is because Tipfy does