Re: [google-appengine] How to tell if I'm enabling edge caching correctly?

2014-01-24 Thread Jamie Niemasik
I believe you can use the Vary header to accomplish that ("Vary: Cookie").

Keep in mind that it won't work if you're setting a cookie on your 
anonymous users for some other reason.

Jamie

On Friday, January 24, 2014 1:14:44 PM UTC-5, Rafael Sanches wrote:
>
> Any chance you guys know if there is any way to do that by filtering 
> cookies? 
>
> For example, I want to cache all of my HTML pages that are for 
> non-loggedin users. 
>
> Similar to what a reverse-proxy like Varnish would do. 
>
> That would make appengine closer to perfect. 
>
> We will be experimenting soon with varnish and the cloud instances.
>
> thanks
> rafa
>
>
> On Fri, Jan 24, 2014 at 9:23 AM, AndyD 
> > wrote:
>
>> Thanks, I've seen that and used that info for my implementation, yet it 
>> doesn't seem to be working for me.  That info is from 2011, maybe things 
>> have changed?  Or maybe it's necessary but not sufficient; i.e. the Edge 
>> Cache won't cache unless you do those things, but it may still use other 
>> criteria to decide whether to cache something.
>>
>> Has anybody implemented edge caching recently, and have any insight as to 
>> whether there are additional factors involved?
>>
>> -Andy
>>
>>
>> On Friday, January 24, 2014 12:06:47 PM UTC-5, Joshua Smith wrote:
>>>
>>> Brandon cracked this nut a long time ago, and documented it here:
>>>
>>> http://www.xyhd.tv/2011/11/industry-news/setting-cache-
>>> control-headers-in-python-to-take-advantage-of-google-
>>> appengines-edgecache/
>>>
>>>  -- 
>> 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 google-appengi...@googlegroups.com .
>> To post to this group, send email to 
>> google-a...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/google-appengine.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
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 google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


[google-appengine] Re: Processing payments using Paypal, python SDK

2014-01-05 Thread Jamie Niemasik
+1. I've been using Stripe in my GAE app for the past year and it's been a 
terrific experience. The API is clean and intuitive, and you can give your 
users a simple flow (either with the nice views that Stripe provides, or 
with your own custom UI). Unless you have to use Paypal, I'd start with 
Stripe.

On Saturday, January 4, 2014 2:51:13 PM UTC-5, Doug Anderson wrote:
>
> My advice would be to use Stripe.com for processing payments.  You'll be 
> amazed at how easy it is to get started AND customers don't have to leave 
> your site!
> (I'm not associated with Stripe in any way... just using it with App 
> Engine and can attest to its ease of use)
>
> I may re-add PayPal at some point (in addition to Stripe) but it's a pita 
> to deal with the user leaving your site, processing the ipn notifications, 
> and then HOPING the user hits the button to return to your site when he's 
> finished on PayPal.  With PayPal there's no guarantee the user will return 
> to your site (although it's fairly likely).  I've also noticed that the 
> initial redirect to PayPal can take a while (for the page to load).  Just 
> my experience... I'm sure there are others that really like it.
>
>
> On Thursday, January 2, 2014 4:52:23 PM UTC-5, Robert Avram wrote:
>>
>> I'm trying to figure out how to process payments using paypal python sdk 
>> and google app engine.
>> the following code seems to work, but I can't figure out, based on the 
>> SDK, how to handle the exceptions (wrong credit card number etc).
>> I would like the customer to be able to see the error. I would appreciate 
>> any input! thanks!!!
>>
>>
>> class Buy(generichandler.MainHandler):
>>
>> def get(self):
>>
>>api = paypalrestsdk.set_config(
>>
>>  mode="sandbox",
>>
>>  client_id="myclientid",
>>
>>  client_secret="secret")
>>
>>api.get_token()
>>
>>paymentDic = {"intent": "sale",
>>
>>  "payer": {
>>
>>"payment_method": "credit_card",
>>
>>"funding_instruments": [{
>>
>> "credit_card": {
>>
>>
>> "type": "visa",
>>
>>
>> "number": "4417119669820331",
>>
>>
>> "expire_month": "11",
>>
>>
>> "expire_year": "2018",
>>
>>
>> "cvv2": "874",
>>
>>
>> "first_name": "Joe",
>>
>>
>> "last_name": "Shopper",
>>
>>
>> "billing_address": {
>>
>>   
>>"line1": "52 N Main ST",
>>
>>   
>>"city": "Johnstown",
>>
>>   
>>"state": "OH",
>>
>>   
>>"postal_code": "43210",
>>
>>   
>>"country_code": "US" }}}]},
>>
>>  "transactions": [{
>>
>>"amount": {
>>
>>  "total": "1.47",
>>
>>  "currency": "USD",
>>
>>  "details":{
>>
>>"subtotal": 
>> "1.41",
>>
>>"tax": "0.03",
>>
>>"shipping": 
>> "0.03"}},
>>
>>"description": "This is the 
>> payment transaction description." }]}
>>
>>payment = paypalrestsdk.Payment(paymentDic)
>>
>>payment.create()
>> Enter code here...
>>
>>
>>

-- 
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 google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [google-appengine] Re: Blobstore filename created in MapReduce job too long to create BlobKey

2013-03-06 Thread Jamie Niemasik
: )  I tried the same thing last night, but wasn't ready to declare victory
because I saw new errors. Happily, it turns out those were from old tasks
(with retry counts nearing 1000) whose states were not compatible with the
new MR code. I've purged the queue and cleaned out the associated blobs and
everything's humming along now.

When I first started using MR, I had to make a lot of modifications to get
it working with py2.7 and NDB, using two different versions of the MR lib
that I found. I was hesitant to touch that code since it had been working
perfectly for so long, until sometime in February when I started
experiencing these errors. I'm still not sure why that happened.

But, happily, all I had to do to the svn version of MR this time around was
change mapreduce/main.py to mapreduce.main.APP in include.yaml. Nice!

On Wed, Mar 6, 2013 at 5:13 AM, bmurr  wrote:

> Well, I think I have it solved.
>
> I was using an older version of the mapreduce library, which uses
> mapreduce.lib.files to interact with the blobstore.
> The newer version of mapreduce uses google.appengine.api.files instead,
> which doesn't cause this problem.
>
> These two libraries seem pretty similar -- so I'm not sure what precisely
> was causing the issue.
>
>
>
> On Saturday, March 2, 2013 4:25:17 AM UTC, Jamie Niemasik wrote:
>
>> I've been receiving intermittent errors from MapReduce jobs. I'm running
>> Python 2.7.
>>
>> The specific error is "BadValueError: name must be under 500 bytes" which
>> is raised when calling datastore.Key.from_path() within
>> blobstore.get_blob_key(); the filename being provided is way too long to
>> make a key from.
>>
>> This all occurs within the code in the mapreduce package… nothing in my
>> code seems to affect it.
>>
>> Some of the filenames are 288 bytes long, while some are 992. The M/R
>> spec name and id in each case is nearly the same and is very short; I don't
>> see where this variance comes from.
>>
>> The sequence of events is this:
>> mapreduce.output_writers.init_**job() creates a reasonable, short
>> filename and passes it to files.blobstore.create()
>> create() calls files.file._create('blobstore'**, …, filename)
>> _create() sets up an rpc with that filename and calls
>> _make_call('Create', ...)
>>
>> And that call sometimes returns a filename that's 288 bytes, sometimes
>> 992. I have no idea why or how to work around this — any help would be
>> appreciated.
>>
>> Thanks,
>> Jamie
>>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google App Engine" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-appengine/I0pXHW1poWU/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, send an email to
> google-appengine+unsubscr...@googlegroups.com.
> To post to this group, send email to google-appengine@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-appengine?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [google-appengine] Re: Blobstore filename created in MapReduce job too long to create BlobKey

2013-03-05 Thread Jamie Niemasik
Thanks Alex. Yes, they are writable; however, I can't find any errors in
the logs, other than the name errors themselves (and those occur right
after "Final result for job … is 'success'). The mapreduce code gets
through files.finalize(filename), but blows up in get_blob_key because the
filename is no shorter than before.

Ben, I wish I could do that, the mapreduce lib is creating
a __BlobFileIndex__
datastore key using this filename as the id, so I don't know what sort of
change I could make there. Unfortunately it's not something I'm storing as
a property on my own model.

Jamie

On Tue, Mar 5, 2013 at 4:48 PM, Alex Burgel  wrote:

> On Friday, March 1, 2013 11:25:17 PM UTC-5, Jamie Niemasik wrote:
>
>> Some of the filenames are 288 bytes long, while some are 992. The M/R
>> spec name and id in each case is nearly the same and is very short; I don't
>> see where this variance comes from.
>>
>
> Have you noticed if the long file names contain the word 'writable' at the
> beginning?
>
> If so, it might similar to an issue that I had (my issue was with google
> storage, not blobstore, but their APIs are similar):
>
>
> https://groups.google.com/forum/?fromgroups=#!topic/app-engine-pipeline-api/vfWakN0NKSw
>
> It seems that when a file is writable, its in a special state with a
> filename that is very long. When the MR job finishes, it finalizes the file
> and gets another filename that is shorter. My issue had to do with the MR
> job not finishing properly. Some of my code was throwing exceptions but it
> wasn't causing the job to finalize properly and therefore not getting the
> shorter filename.
>
> I would take a look at your logs to see if there are any errors. They may
> be causing the MR job to not finish properly and then return unfinalized
> filenames.
>
> --Alex
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google App Engine" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-appengine/I0pXHW1poWU/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, send an email to
> google-appengine+unsubscr...@googlegroups.com.
> To post to this group, send email to google-appengine@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-appengine?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[google-appengine] Blobstore filename created in MapReduce job too long to create BlobKey

2013-03-01 Thread Jamie Niemasik
I've been receiving intermittent errors from MapReduce jobs. I'm running 
Python 2.7.

The specific error is "BadValueError: name must be under 500 bytes" which 
is raised when calling datastore.Key.from_path() within 
blobstore.get_blob_key(); the filename being provided is way too long to 
make a key from.

This all occurs within the code in the mapreduce package… nothing in my 
code seems to affect it.

Some of the filenames are 288 bytes long, while some are 992. The M/R spec 
name and id in each case is nearly the same and is very short; I don't see 
where this variance comes from.

The sequence of events is this:
mapreduce.output_writers.init_job() creates a reasonable, short filename 
and passes it to files.blobstore.create()
create() calls files.file._create('blobstore', …, filename)
_create() sets up an rpc with that filename and calls _make_call('Create', 
...)

And that call sometimes returns a filename that's 288 bytes, sometimes 992. 
I have no idea why or how to work around this — any help would be 
appreciated.

Thanks,
Jamie

-- 
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 google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[google-appengine] --oauth2 not working for download_data?

2012-07-28 Thread Jamie Niemasik
I've been using the --oauth2 switch successfully for "appcfg.py update" for 
some time now, which is a big help because I have two-factor authentication 
turned on.  However, it doesn't seem to work when I run "appcfg.py 
download_data", despite that the documentation makes it seem as if it's 
supported for all operations.  It prompts me for my email and password.  Is 
this a bug in the script, or am I doing something wrong?

Thanks,
Jamie

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/XxsYy57nkb4J.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: Custom Administration Console pages with admin login requirement result in redirect loops

2011-11-13 Thread Jamie Niemasik
I'm also experiencing this problem. Did you find a solution?

Thanks,
Jamie

On Sep 18, 5:20 am, Pol  wrote:
> Hi,
>
> I've added customadminpages but when I try to follow the links added
> to the left pane of the Administration Console, it results inredirect
> loops. Looking at the generated HTML, the iframe with the customadmin
> page points to 
> "https://1755-dot-latest-dot-everpix-alpha.appspot.com/admin/garbage_collect_backings";.
>  Going directly to this page (wether
> already logged in as anadminor not) works fine, it's only from
> within the Administration Console that it doesn't work.
>
> Here's the firstredirect:
>
> Request 
> URL:https://1755-dot-latest-dot-everpix-alpha.appspot.com/admin/garbage_collect_backings
> Request Method:GET
> Status Code:302 Found
> Response Headersview source
> content-length:0
> content-type:text/html
> date:Sun, 18 Sep 2011 13:12:30 GMT
> location:https://www.google.com/a/everpix.net/ServiceLogin?
> service=ah&passive=true&continue=https://appengine.google.com/_ah/
> conflogin%3Fcontinue%3Dhttps://1755-dot-latest-dot-everpix-
> alpha.appspot.com/admin/
> garbage_collect_backings EgJhaCIUs8mSvSwhTsHxTKlcPf-1VgYU-
> f4oATIU8IshzygSsQah4xFNA5qqA98EfBY
> server:Google Frontend
> status:302 Found
> version:HTTP/1.1
>
> And the second one:
>
> Request URL:https://www.google.com/a/everpix.net/ServiceLogin?
> service=ah&passive=true&continue=https://appengine.google.com/_ah/
> conflogin%3Fcontinue%3Dhttps://1755-dot-latest-dot-everpix-
> alpha.appspot.com/admin/
> garbage_collect_backings EgJhaCIUs8mSvSwhTsHxTKlcPf-1VgYU-
> f4oATIU8IshzygSsQah4xFNA5qqA98EfBY
> Request Method:GET
> Status Code:302 Moved Temporarily
> Response Headersview source
> cache-control:private, max-age=0
> content-encoding:gzip
> content-length:422
> content-type:text/html; charset=UTF-8
> date:Sun, 18 Sep 2011 13:12:31 GMT
> expires:Sun, 18 Sep 2011 13:12:31 GMT
> location:https://www.google.com/accounts/ServiceLogin?continue=https%3A
> %2F%2Fappengine.google.com%2F_ah%2Fconflogin%3Fcontinue%3Dhttps%3A%2F
> %2F1755-dot-latest-dot-everpix-alpha.appspot.com%2Fadmin
> %2Fgarbage_collect_backings&shdf=ChkLEgZhaG5hbWUaDUV2ZXJwaXggQWxwaGEMEgJhaC 
> IUs8mSvSwhTsHxTKlcPf-1VgYU-
> f4oATIU8IshzygSsQah4xFNA5qqA98EfBY&service=ah r=0
> server:GSE
> status:302 Moved Temporarily
> version:HTTP/1.1
> x-content-type-options:nosniff
> x-xss-protection:1; mode=block
>
> - app.yaml -
>
> builtins:
> - remote_api: on
> - appstats: on
>
> inbound_services:
> - xmpp_message
> - warmup
>
> admin_console:
>   pages:
>   - name: Flush Memcache
>     url: /admin/flush_memcache
>   - name: Reprocess Backings
>     url: /admin/reprocess_backings
>   - name: Reprocess Photos
>     url: /admin/reprocess_photos
>   - name: GC Backings
>     url: /admin/garbage_collect_backings
>
> handlers:
> - url: /favicon\.ico
>   static_files: static/favicon.ico
>   upload: static/favicon\.ico
> - url: /mapreduce(/.*)?
>   script: mapreduce/main.py
>   login:admin
> - url: /ereporter.*
>   script: $PYTHON_LIB/google/appengine/ext/ereporter/
> report_generator.py
>   login:admin
> - url: /stats.*
>   script: $PYTHON_LIB/google/appengine/ext/appstats/ui.py
> - url: /_ah/xmpp/.*
>   script: xmpp_handlers.py
>   login:admin
>   secure: never
> - url: /cron/.*
>   script: cron_handlers.py
>   login:admin
>   secure: never
> - url: /task/.*
>   script: task_handlers.py
>   login:admin
>   secure: never
> - url: /api/.*
>   script: api_handlers.py
>   secure: always
> - url: /admin/.*
>   script:admin.py
>   login:admin
>   secure: always
> - url: /
>   script: main.py
>   secure: never
> - url: /register
>   script: main.py
>   secure: never
>
> - Pol

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.