[google-appengine] Re: All Read Please: Geographical Request Latency

2009-08-13 Thread Jarek Zgoda

Warsaw, Poland here. Typical ~240ms, ranging from 210ms to 740ms (!).

On 13 Sie, 12:44, Martyn  wrote:
> Hi there,
>
> I am investigating request latency for AppEngine after experiencing
> significantly lower performance then reported in the Java status
> results.
>
> This appears to be due to network topology, but I thought it would be
> useful to get results from several locations worldwide.
>
> To that end I have created a simple version of an app I am working on,
> that provides request timings.  I would really appreciate it if people
> could take a minute, try the link out and report back on the results.
>
> Here is the link:http://performance.latest.pet-software.appspot.com
>
> many thanks in advance
>
> - Martyn
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: UnicodeEncodeError and Django templates

2009-02-03 Thread Jarek Zgoda

If you call unicode() on unicode object such weirdness will happen.

Position 0 suggests it's a very beginning of the text. Open index.html
with hex editor and look for e3 byte value.


On 3 Lut, 22:54, Scott  wrote:
> Hello,
>
> I'm seeing the following message when trying to render a template
> using Unicode characters:
>
> UnicodeDecodeError at /index.html
> 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in
> range(128)
>
> I have both these settings using Unicode:
>
> DEFAULT_CHARSET = 'utf-8'
> FILE_CHARSET = 'utf-8'
>
> As well as the meta in the header:
>
> 
>
> Finally, I have verified that the django.po files are properly encoded
> as UTF-8 (they don't make it through the 'compilemessages' command if
> they are not).
>
> I'm not sure how Django is getting the idea that it should use an
> ASCII codec, any ideas how I could get these templates rendering
> correctly would be greatly appreciated.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Changes to urlfetch seem to have broke my old code

2009-02-14 Thread Jarek Zgoda

If exception is raised in the line "result = urlfetch.fetch(url)",
then the "result" variable will not be set. Trying to access it's
"content" attribute after the exception will raise UnboundLocalError
as the "result" variable simply does not exist. Your code was working
by accident.

warreninaustintexas napisał(a):
> My app has been working since October of last year.  My app scrapes
> stock data from Yahoo! Finance and Google Finance.  I haven't changed
> the way it does urlfetch in many months, but today it is suddenly
> throwing errors that I haven't had before.
>
> Relevant portion of code:
>
> url = "http://finance.google.com/finance?q="; + ticker_symbol
> try:
>   result = urlfetch.fetch(url)
> except (urlfetch.DownloadError):
>   isPageSlow = True
> strbig = result.content
>
> I'm getting a "UnboundLocalError: local variable 'result' referenced
> before assignment" error on the last line of the above code.  Has App
> Engine changed the way it handles slow page fetches?
>
> The app's been running fine for months.  It runs fine on
> dev_appserver, too - I can't duplicate the error locally.
>
> View the app at stockpickmodel dot appspot dot com
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: SDK under Linux Bug ?

2009-02-17 Thread Jarek Zgoda

I see the same behaviour on OS X, but as it has been stated earlier,
this might be normal.

On 15 Lut, 03:32, "sebastian.ov...@gmail.com"
 wrote:
> Hi All,
>
> I was using SDK under windows without any problem. Now I'm using SDK
> 1.1.9 under Ubuntu and for some reason it doesn't update correctly the
> index.yaml. If I delete it, SDK would recreate it but without any
> index in it (even if I run some queries) and therefore I cannot deploy
> anymore !
>
> from the console:
>
> INFO     2009-02-15 02:29:09,985 dev_appserver_index.py] Updating /
> home/sebas/dev/gae/index.yaml
>
> but it still is empty:
>
> indexes:
>
> # AUTOGENERATED
>
> # This index.yaml is automatically updated whenever the dev_appserver
> # detects that a new type of query is run.  If you want to manage the
> # index.yaml file manually, remove the above marker line (the line
> # saying "# AUTOGENERATED").  If you want to manage some indexes
> # manually, move them above the marker line.  The index.yaml file is
> # automatically uploaded to the admin console when you next deploy
> # your application using appcfg.py.
>
> any ideas ?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Google Geocoding not working

2009-02-17 Thread Jarek Zgoda

I use Ajax api variation and it works without problems.

On 17 Lut, 04:14, ehmo  wrote:
> Hey guys,
> i'm trying to use Google Geocoding 
> servicehttp://code.google.com/apis/maps/documentation/geocoding/index.html
> via http.
> I generated API key for actual domain and it's not working {u'Status':
> {u'code': 610, u'request': u'geocode'}, u'name': u'Brno'}.
> 610 mean it's not good key for this domain. I tryied it on another
> hosting with php, it's working. I tryied it on another hosting with
> same python lib and it's working too. I tryied to use urlfetch and
> urllib2, nothing works.
> Any idea?
>
> Maybe it's because of header restrictions, but i really don't know.
> That link, which is called is ok, coz if i'll try it in browser,
> everything works. All data are encoded before posting, there is 100%
> not problem.
>
> Thnx for help
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Profiling application, dev vs. prod

2009-02-20 Thread Jarek Zgoda

Since enabling profiler output is not good for production site (and
profiling takes additional response time), I'd like to profile my app
on dev server, but as I discovered, the results are completely
different. Is there any other possibility to see what makes my
application to run slow without profiling it on live server?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Profiling application, dev vs. prod

2009-02-21 Thread Jarek Zgoda

Thanks, I'll try that.

On 21 Lut, 07:21, cz  wrote:
> I think you could upload a different version (set it app.yaml) with
> profiling enabled and test using that version (on your live
> datastore). The default (non-profiled) version would still be what the
> public normally sees.
>
> On Feb 20, 5:51 am, Jarek Zgoda  wrote:
>
> > Since enabling profiler output is not good for production site (and
> > profiling takes additional response time), I'd like to profile my app
> > on dev server, but as I discovered, the results are completely
> > different. Is there any other possibility to see what makes my
> > application to run slow without profiling it on live server?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: how to server app on my own domain?

2009-02-23 Thread Jarek Zgoda

So in short (and to clear my confusion), you can not host 2 GAE-based
apps in different subdomains of your domain, say host blog on
blog.mydomain.com and services on services.mydomain.com? Sounds
strange.

On 22 Lut, 23:27, Doug  wrote:
> I beleive that the standard edition (non-business) is free.
>
> Here is a link:http://www.google.com/apps/intl/en/group/index.html
>
> I don't believe that a cname would work because every app does not
> have its own IP.  Since just creating a cname would not make any entry
> in google "hosts" file it would just send you to the main site for the
> IP address.
>
> If you already have your own site you could setup a page with a frame
> that loads your GAE site, or a meta redirect to it.  They may give you
> appearance of what I think you wanted.
>
> Doug
>
> On Feb 22, 3:01 pm, John  wrote:
>
> > Is there a solution other than google apps? It appears google apps is
> > a paid service for businesses.
>
> > On Feb 21, 10:47 pm, Alexander Kojevnikov 
> > wrote:
>
> > > On Feb 22, 5:08 pm, John  wrote:
>
> > > > I've created my first app and I would like it to have its own domain
> > > > (iewww.mydomain.com).  I know this is possible since others are doing
> > > > it (iewww.giftag.com). How can I accomplish this? I've already tried
> > > > creating a cname but that didn't work, it just loads the google
> > > > homepage.
>
> > >http://code.google.com/appengine/articles/domains.html
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Significant quota changes. . .

2009-02-25 Thread Jarek Zgoda

Don't compare apples to oranges, EC2 is complete operating system
instance.

On 25 Lut, 16:39, Wooble  wrote:
> On Feb 24, 5:57 pm, Brandon Thomson  wrote:
>
> > Has anyone seen a cost comparison between Google and the other
> > providers based on these new changes?
>
> EC2 free storage: none
> EC2 free CPU: none
>
> you do the math.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Sporadic Unicode error in POST queries

2009-02-25 Thread Jarek Zgoda

If the data comes from any form in your application, you can force
encoding of form data using accept-charset attribute of form element
(see http://www.w3schools.com/tags/att_form_accept_charset.asp).

On 25 Lut, 22:17, Brian  wrote:
> Hi. I have observed a sporadic Unicode related bug that appears to be
> browser specific. It causes a db.put() to fail. I am not doing
> anything unusual with the incoming text except to put it in a
> variable, and then store in a record. I have determined that this
> issue is browser specific, and probably also related to the user's
> configuration for language preferences etc.
>
> I have run out of ideas for tracking this down. My understanding of
> the CGI interface is that it is supposed to force everything to UTF-8
> by default. It would be nice to be able to set some global options to
> manage encodings on incoming queries. I suspect what is going on is
> the texts are being sent in something besides UTF-8 but Python thinks
> they are Unicode.
>
> Unfortunately, Python crashes when in a situation like this. It would
> be far better if the CGI interface would make a best effort to deal
> with the incoming text, inserting garbage characters where necessary.
> That is "less damaging" than a outright failure, as most people can
> live with an occasional [] in place of a tilde, etc.
>
> On this subject, there really needs to be better documentation on
> Unicode, encoding conversions, etc. It is poorly documented in Python
> also, and I am sure a lot of people are making the same mistakes in
> trying to figure out what works and what breaks.
>
> Thanks,
>
> Brian McConnell
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Sporadic Unicode error in POST queries

2009-02-25 Thread Jarek Zgoda

This will not work as expected, for many reasons.

The line "value = unicode(value)" will break with UnicodeEncodeError
(not Decode) if the value is unicode object and value contains
characters from outside ASCII range.

The line "unicode(str(value).encode('string_escape'))" can be
translated to human "encode value twice then decode". str() produce
byte string. Then you call encode to byte string, but byte strings do
not have attribute encode() (unicode objects have). The you call
"naive" unicode (without specifying encoding, so ASCII will be used).

See http://effbot.org/zone/unicode-objects.htm for brief explanation
on what is byte string and what is unicode object.

On 25 Lut, 23:35, lenza  wrote:
> Hey Brian, I am trying to deal with a similar situation in my app.  I
> would love it if someone offered a good general solution for dealing
> with unexpected non-UTF-8 data in a string.  There must be a way
> because my web browsers can display the data without crashing! =)
>
> The admittedly poor solution that I have been using as a workaround is
> creating a "CheckStringProperty" and using it in place of Google's
> db.StringProperty:
>
> class CheckStringProperty(db.StringProperty):
>     def validate(self, value):
>         try:
>             value = unicode(value)
>         except UnicodeDecodeError:
>             # string contains bad values
>             logging.warn("Encoding bad string with escapes: " + str
> ([ch for ch in value]))
>             value = unicode(str(value).encode('string_escape'))
>
>         return super(db.StringProperty, self).validate(value)
>
> Lenza
> blog.lenza.org
>
> On Feb 25, 1:17 pm, Brian  wrote:
>
> > Hi. I have observed a sporadic Unicode related bug that appears to be
> > browser specific. It causes a db.put() to fail. I am not doing
> > anything unusual with the incoming text except to put it in a
> > variable, and then store in a record. I have determined that this
> > issue is browser specific, and probably also related to the user's
> > configuration for language preferences etc.
>
> > I have run out of ideas for tracking this down. My understanding of
> > the CGI interface is that it is supposed to force everything to UTF-8
> > by default. It would be nice to be able to set some global options to
> > manage encodings on incoming queries. I suspect what is going on is
> > the texts are being sent in something besides UTF-8 but Python thinks
> > they are Unicode.
>
> > Unfortunately, Python crashes when in a situation like this. It would
> > be far better if the CGI interface would make a best effort to deal
> > with the incoming text, inserting garbage characters where necessary.
> > That is "less damaging" than a outright failure, as most people can
> > live with an occasional [] in place of a tilde, etc.
>
> > On this subject, there really needs to be better documentation on
> > Unicode, encoding conversions, etc. It is poorly documented in Python
> > also, and I am sure a lot of people are making the same mistakes in
> > trying to figure out what works and what breaks.
>
> > Thanks,
>
> > Brian McConnell
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Should I migrate to App Engine?

2009-02-26 Thread Jarek Zgoda

They say so (in normal CGI you do not have cached imports), but I
found one of my applications performing much worse than in normal WSGI
environment (Apache + mod_wsgi in daemon mode). I suspect the storage,
as my app is rather write-heavy - profiling info did not reveal any
special suspects.

On 26 Lut, 06:38, Wiiboy  wrote:
> Huh.  You sound like my Google-hating dad, saying, 'I drink the Google
> kool-aid'.
> But I'm not using my own servers.  I'm hosting with another company
> (called Lunarpages).  There isn't much code to convert, and, for
> safety, I'd probably try to keep up a standard-python copy, just in
> case.
> One big question:  would App Engine be any faster than standard CGI
> like my other hosting provider provides (I thought I read thats all
> App Engine uses)?  It seems the Python stuff with my other provider is
> a bit slow...?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Should I migrate to App Engine?

2009-02-26 Thread Jarek Zgoda

No, it is not. CGI is generic way of passing environment variables to
web applications. WSGI is standardized communication protocol between
web servers (like these that offer CGI interface) and web applications
written in Python. Basically you just write WSGI-based application and
run it in WSGI environment like mod_wsgi (for Apache) or bridging with
other environment eg. using Flup to connect to FastCGI, SCGI or AJP
gateways.

See http://en.wikipedia.org/wiki/Common_Gateway_Interface and
http://en.wikipedia.org/wiki/Wsgi.

The main advantage over traditional VPS or dedicated hosting is
maintenance - you just deploy your application and that's all. No need
to think about database setup, mail server configuration, load
balancing, etc. Considering shared hosting, you'll get scalability and
generous free limit. You will pay with vendor lock-in, at least to
some extent (writing application in a way it could be ran in other
environment than GAE is really hard and requires careful planning
beforehand).

On 26 Lut, 17:09, Wiiboy  wrote:
> So what are the advantages of moving to App Engine?
>
> By the way, my other hosting provider says that it uses CGI.  Is that
> the same thing as WSGI?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Gettext and GAE/jijas2 integration

2009-03-05 Thread Jarek Zgoda

I tried to put Environment object in memcache, but it's not picklable
so no joy. FileSystemLoader can be pickled and cached, but for some
unknown reason cached object throws IOErrors if template code changes
(eg. because of new deployment) and I did not found a way to remove it
from cache after succesful deployment (and do not have key versioning
yet).

I ended up creating module-level environment object and hoping the
module will be kept in module cache fo long enough to be reused.

On 5 Mar, 01:14, pedepy  wrote:
> just as a side note, loading a jinja2 environment can be quite
> expensive. You'll wanna seperate this code (that you will no doubt
> reuse extensively) into it's own method. A little memcache love also
> wouldnt  hurt.
>
> On Mar 4, 7:45 am, Jose  wrote:
>
> > I'm new in python and app engine. I'm developing a simple project
> > without django, just webapp. Instead use django template system I'm
> > using jijas2.
>
> > To enable jijas2 into my project I downloaded the last version and
> > after unpack it, I copied jijas2 folder into my project. I added this
> > imports:
>
> > from jinja2 import Template
> > from jinja2 import FileSystemLoader, Environment
>
> > An in my request handler I use templates in this way:
>
> >     template_dirs = os.path.join(os.path.dirname(__file__),
> > 'templates')
> >     env = Environment(loader=FileSystemLoader(template_dirs))
> >     template = env.get_template("index.html")
> >     rendered = template.render(template_values)
> >     self.response.out.write(rendered)
>
> > Everything works fine. Now, I'm trying to make use of i18n support in
> > jijas2. But I have a lot of problems and I would apreciate your help.
>
> > First of all I read jijas2 documentation and API, and the way to
> > implement this feature is with this lines:
>
> >     import gettext
>
> > (..and in my request handler)
>
> >     domain = "myproject"
> >     dirname = os.path.dirname(__file__)
> >     locales = "en_US"
>
> >     translations = gettext.find(domain, dirname, locales)
> >     env = Environment(loader=FileSystemLoader
> > (template_dirs),extensions=['jinja2.ext.i18n'])
> >     env.install_gettext_translations(translations)
>
> > Second question:
>
> > I have experiencie with PHP, so it not so hard understand gettext and
> > po/mo files operation, so I think I have to upload my po files into
> > ROOT/locale/LC_MESSAGES/en_US/myproject.po
>
> > Regards
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Gettext and GAE/jijas2 integration

2009-03-05 Thread Jarek Zgoda

Shouldn't the "dirname" from your code contain the path where actual
catalogs are stored, iow. os.path.join(os.path.dirname(__file__),
'locale')?

On 5 Mar, 13:11, Jose Ramon Palanco  wrote:
> So, which one is the best (and easiest) way to build an appengine
> project with i18n support without django? I think I will write a dirty
> implementation if therer are not solution to solve this problem.
>
> On Thu, Mar 5, 2009 at 9:09 AM, Jarek Zgoda  wrote:
>
> > I tried to put Environment object in memcache, but it's not picklable
> > so no joy. FileSystemLoader can be pickled and cached, but for some
> > unknown reason cached object throws IOErrors if template code changes
> > (eg. because of new deployment) and I did not found a way to remove it
> > from cache after succesful deployment (and do not have key versioning
> > yet).
>
> > I ended up creating module-level environment object and hoping the
> > module will be kept in module cache fo long enough to be reused.
>
> > On 5 Mar, 01:14, pedepy  wrote:
> >> just as a side note, loading a jinja2 environment can be quite
> >> expensive. You'll wanna seperate this code (that you will no doubt
> >> reuse extensively) into it's own method. A little memcache love also
> >> wouldnt  hurt.
>
> >> On Mar 4, 7:45 am, Jose  wrote:
>
> >> > I'm new in python and app engine. I'm developing a simple project
> >> > without django, just webapp. Instead use django template system I'm
> >> > using jijas2.
>
> >> > To enable jijas2 into my project I downloaded the last version and
> >> > after unpack it, I copied jijas2 folder into my project. I added this
> >> > imports:
>
> >> > from jinja2 import Template
> >> > from jinja2 import FileSystemLoader, Environment
>
> >> > An in my request handler I use templates in this way:
>
> >> >     template_dirs = os.path.join(os.path.dirname(__file__),
> >> > 'templates')
> >> >     env = Environment(loader=FileSystemLoader(template_dirs))
> >> >     template = env.get_template("index.html")
> >> >     rendered = template.render(template_values)
> >> >     self.response.out.write(rendered)
>
> >> > Everything works fine. Now, I'm trying to make use of i18n support in
> >> > jijas2. But I have a lot of problems and I would apreciate your help.
>
> >> > First of all I read jijas2 documentation and API, and the way to
> >> > implement this feature is with this lines:
>
> >> >     import gettext
>
> >> > (..and in my request handler)
>
> >> >     domain = "myproject"
> >> >     dirname = os.path.dirname(__file__)
> >> >     locales = "en_US"
>
> >> >     translations = gettext.find(domain, dirname, locales)
> >> >     env = Environment(loader=FileSystemLoader
> >> > (template_dirs),extensions=['jinja2.ext.i18n'])
> >> >     env.install_gettext_translations(translations)
>
> >> > Second question:
>
> >> > I have experiencie with PHP, so it not so hard understand gettext and
> >> > po/mo files operation, so I think I have to upload my po files into
> >> > ROOT/locale/LC_MESSAGES/en_US/myproject.po
>
> >> > Regards
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Gettext and GAE/jijas2 integration

2009-03-05 Thread Jarek Zgoda

Also, the gettext docs say it should be "localedir/language/
LC_MESSAGES/domain.mo" (ROOT/locale/en_US/LC_MESSAGES/myproject.po -
following your terminology and layout), not "localedir/LC_MESSAGES/
language/domain.mo".

On 5 Mar, 13:32, Jarek Zgoda  wrote:
> Shouldn't the "dirname" from your code contain the path where actual
> catalogs are stored, iow. os.path.join(os.path.dirname(__file__),
> 'locale')?
>
> On 5 Mar, 13:11, Jose Ramon Palanco  wrote:
>
> > So, which one is the best (and easiest) way to build an appengine
> > project with i18n support without django? I think I will write a dirty
> > implementation if therer are not solution to solve this problem.
>
> > On Thu, Mar 5, 2009 at 9:09 AM, Jarek Zgoda  wrote:
>
> > > I tried to put Environment object in memcache, but it's not picklable
> > > so no joy. FileSystemLoader can be pickled and cached, but for some
> > > unknown reason cached object throws IOErrors if template code changes
> > > (eg. because of new deployment) and I did not found a way to remove it
> > > from cache after succesful deployment (and do not have key versioning
> > > yet).
>
> > > I ended up creating module-level environment object and hoping the
> > > module will be kept in module cache fo long enough to be reused.
>
> > > On 5 Mar, 01:14, pedepy  wrote:
> > >> just as a side note, loading a jinja2 environment can be quite
> > >> expensive. You'll wanna seperate this code (that you will no doubt
> > >> reuse extensively) into it's own method. A little memcache love also
> > >> wouldnt  hurt.
>
> > >> On Mar 4, 7:45 am, Jose  wrote:
>
> > >> > I'm new in python and app engine. I'm developing a simple project
> > >> > without django, just webapp. Instead use django template system I'm
> > >> > using jijas2.
>
> > >> > To enable jijas2 into my project I downloaded the last version and
> > >> > after unpack it, I copied jijas2 folder into my project. I added this
> > >> > imports:
>
> > >> > from jinja2 import Template
> > >> > from jinja2 import FileSystemLoader, Environment
>
> > >> > An in my request handler I use templates in this way:
>
> > >> >     template_dirs = os.path.join(os.path.dirname(__file__),
> > >> > 'templates')
> > >> >     env = Environment(loader=FileSystemLoader(template_dirs))
> > >> >     template = env.get_template("index.html")
> > >> >     rendered = template.render(template_values)
> > >> >     self.response.out.write(rendered)
>
> > >> > Everything works fine. Now, I'm trying to make use of i18n support in
> > >> > jijas2. But I have a lot of problems and I would apreciate your help.
>
> > >> > First of all I read jijas2 documentation and API, and the way to
> > >> > implement this feature is with this lines:
>
> > >> >     import gettext
>
> > >> > (..and in my request handler)
>
> > >> >     domain = "myproject"
> > >> >     dirname = os.path.dirname(__file__)
> > >> >     locales = "en_US"
>
> > >> >     translations = gettext.find(domain, dirname, locales)
> > >> >     env = Environment(loader=FileSystemLoader
> > >> > (template_dirs),extensions=['jinja2.ext.i18n'])
> > >> >     env.install_gettext_translations(translations)
>
> > >> > Second question:
>
> > >> > I have experiencie with PHP, so it not so hard understand gettext and
> > >> > po/mo files operation, so I think I have to upload my po files into
> > >> > ROOT/locale/LC_MESSAGES/en_US/myproject.po
>
> > >> > Regards
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Get deployed app version at runtime?

2009-03-06 Thread Jarek Zgoda

Is there any possibility to get full application version at runtime
(not only major version from app.yaml)? I'm thinking of making
memcache keys versioned by something that changes on every deployment
and the app version seems to be obvious choice...

Cheers
J.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Get deployed app version at runtime?

2009-03-06 Thread Jarek Zgoda

Thank you.

On 6 Mar, 14:45, "Steve Robillard"  wrote:
> J
>
> You can retrieve it using the method on this 
> pagehttp://code.google.com/appengine/docs/python/runtime.html
> Near the bottom is the code needed
>
> HTH
> Steve
>
> -Original Message-
> From: google-appengine@googlegroups.com
>
> [mailto:google-appeng...@googlegroups.com] On Behalf Of Jarek Zgoda
> Sent: Friday, March 06, 2009 8:01 AM
> To: Google App Engine
> Subject: [google-appengine] Get deployed app version at runtime?
>
> Is there any possibility to get full application version at runtime (not
> only major version from app.yaml)? I'm thinking of making memcache keys
> versioned by something that changes on every deployment and the app version
> seems to be obvious choice...
>
> Cheers
> J.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Google App Engine and TZINFO

2009-03-10 Thread Jarek Zgoda

Not so hurry.

As for pytz footprint, it's ~600kB in size and can be lightning fast
if combined with caching in memcache (caching of tzinfo? why not...).
Combine this with Babel and you'll get everything you'd want to do
l10n.

On 10 Mar, 20:21, mawcs  wrote:
> So, I got some help from StackOverflow on this one.
>
> Careful use of the dateutil library seemed to solve my problem.  It is
> fairly robust and a much smaller footprint from PyTZ.
>
> On Mar 10, 11:06 am, mawcs  wrote:
>
> > (I am new to Python and Google App Engine, please forgive me if my
> > questions seem basic).
>
> > I'm having a helluva time trying to manage multiple user timezones in
> > my Google App Engine application.
>
> > Here are my constraints:
>
> >    1. If a user enters the time on an input, it will be local time
> > (including DST, when appropriate).
> >    2. If a user does not enter the time, the system must enter it for
> > them in their local time (including DST, when appropriate).
> >    3. When the date and time are displayed to the user, it must be in
> > their local time (including DST, when appropriate)
>
> > I understand that time will be internally stored as UTC with a tzinfo
> > object and that the App Engine will store the Models with UTC time.
>
> > I previously thought I had this all worked out by asking the user to
> > specify their time zone in their preferences. Then, I would simply
> > load their preferences and add that tzinfo to any datetime objects in
> > reference to that user.
>
> > However, our recent daylight saving time broke it. It turns out that I
> > had not correctly implemented the dst() in my tzinfo objects. As I
> > understand it, I must determine if DST is currently on, and if so,
> > return the correct offset for the tzinfo.
>
> > The problem is, I have no idea how to determine if the timezone's
> > daylight time is current or not. Am I missing something obvious?
>
>
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Application instances seem to be too aggressively recycled

2009-03-11 Thread Jarek Zgoda

I'm seeing the same behaviour but I do not use Django (Werkzeug +
Jinja2). While this combo seems lighter (in terms of CPU usage), my
app becomes "cold" each 2-3 seconds and request takes > 1200ms CPU to
be served, with Jinja2 Environment creation taking most of CPU
resources. I tried to optimize this process by caching what can be
cached but got little to none improvement as not much can be cached
here (only loader and templates).

On 10 Mar, 18:22, Jason C  wrote:
> We have a new application that receives _very_ little load. So little,
> in fact, that each request spins up a new application instance. We are
> using Django trunk and the import overhead is high. All of this yields
> a long request (e.g., 8802ms) using a lot of CPU (e.g., 3247ms-cpu).
>
> With very little load, it makes sense that instances are recycled. On
> that assumption, we've started applying some primer load against a
> couple of uris in an attempt to keep some instances hot. We're
> applying around 1 request/second across 2 uris.
>
> When we hit a hot instance, we get blazing speed (e.g., url_1: 73ms
> 91ms-cpu, url_2: 368ms 615ms-cpu - these values are pulled from the
> App Engine console Logs tool and I'm not completely sure if this
> represents Runtime, or combined Runtime/API - I believe the latter).
>
> Under this 1 request/second load, we are still seeing lots of instance
> startup - even after 40-50 minutes of sustained load. Subjectively,
> the instance startups seem to come in bursts, though we've done no
> formal analysis around this.
>
> Does anyone else see this behavior? It _really_ kills our application
> performance - so much so, that we're considering moving away from
> Django in an effort to minimize the start-up pain.
>
> Any info or war stories would be appreciated.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: jinja2 environment loading on each request to /

2009-03-13 Thread Jarek Zgoda

If you move Environment creation routine to another module it will be
cached by Google, but only for few seconds (2-3?), so if your
application does not get enough traffic you'd gain nothing from this.

In my attempts to speedup things I discovered that only loader can be
cached, but it has to be invalidated upon each new deployment so its
key has to have application version added (this is how I did key
versioning in my caching tools). Unfortunately, the gain from this
caching approaches 0.

And the last thing: Armin Ronacher, the guy behind Jinja, is aware of
the problem and has some ideas on how to improve things on GAE,
hopefully including template bytecode caching (this would be really
super-nice!).

On 13 Mar, 00:38, pedepy  wrote:
> hey so i use jinja2 templates because they are better [no citation
> needed], but from what i understand, loading the jinja2 environment
> can be quite an expensive task. Through logging, I have found out that
> each request to / loads the environment over and over.. I have those
> routines in a seperate python script (not the one that app.yaml
> fowards requests to for /).
>
> anything im missing here ? I think this could be adding also an extra
> 1000 cpu ms on every requests ...
>
> (by the way, i have tried the cookbook's memcache technique and it
> only works locally, it fails on the google servers..)
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: What does your new project template look like?

2009-03-13 Thread Jarek Zgoda

I use another toolset (Werkzeug + Jinja2) so my projects are organized
in different way, but I second your thoughts on default template
usability.

On 13 Mar, 08:16, adelevie  wrote:
> I have found the included "new_project_template" to be woefully
> inadequate for getting a real project started. It's good for learning
> a hello world app, but when it comes to making apps ready for
> production, it's nice to make your own template. I wrote about the
> template that I use on my personal blog (http://www.alandelevie.com/
> 2009/03/13/better-project-template-for-google-app-engine/ [there's a
> download link if you want]). It includes BeautifulSoup, some django
> templates, fixed tabs (why two spaces, Google, why?!), and some very
> basic but useful functions.
>
> I'd be interested to see what other people do about this.
>
> -Alan
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: How to overwrite the default save method

2009-03-13 Thread Jarek Zgoda

Be aware that in current version save() contains code literally copied
from put() so you'd like to have in your model class the code like:

def put(self):
  # do something before save
  key = super(MyModel, self).put()
  # do something after save
  return key

save = put

On 13 Mar, 05:45, yucc  wrote:
> Hi all,
> I want to overwrite the default save method of the
> google.appengine.ext.db.Model so as to perform some special work each
> time the entity save(or update),I know in Django model this should be
> like this:(in the model definition)
> def save(self, force_insert=False, force_update=False):
>         self.level = self.level+1   #I want to let the level property
> auto add
>         super(User, self).save(force_insert, force_update) # Call the
> "real" save() method.
>         #do_something_else()
>
> But, this doesn't work with google.appengine.ext.db.Model,it comes out
> that the Model's put method takes  exactly 1 argument,so I omit
> them,like this:
> super(User, self).save(),
> Is that right?
> I was wondering how to construct a Model,as there's a init method:
> def __init__(self, parent=None, key_name=None, _app=None,
> _from_entity=False, **kwds)
> It seems "super(User, self)" is not right here
> Anyone could help ?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: sending mail with nicely formatted sender

2009-03-15 Thread Jarek Zgoda

Star this issue:

http://code.google.com/p/googleappengine/issues/detail?id=677

On 15 Mar, 20:08, manuelaraoz  wrote:
> Hi there!
>
> I've got my app sending mail from the address supp...@myapp.com
>
> the problem is, when people receive the emails, they see that they
> appear as been sent from "support"
> is there a way to edit this and make them see "MyApp Team" or
> something of the sort?
>
> for example my email is jaws...@gmail.com but when someone receives a
> mail from me,
> they se "Manuel Aráoz"... I want that to happen when I send mails from
> the web app.
>
> Hope I made myself clear
> If anyone could help I'd appreciate it a lot!
>
> Thanks in advance
> Manuel
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Forward request or webapp.RequestHandler chaining (like Actions framework in java)

2009-03-15 Thread Jarek Zgoda

It would be easier if you do not use WebApp but follow Django way of
request handling (easy to achieve even without Django, ie. using
Werkzeug to lay out application in model-view-template style):

def handler_a(request):
  return response('a')

def handler_b(request):
  return handler_a(request)

In handler_b you just called handler_a with a request object from
handler_b. You can modify request object before passing it to another
view function as you please.

On 15 Mar, 12:06, "Serega.Sheypak"  wrote:
> Hello, I would like to know is it possible to forward request?
>
> For example in Java I can forward request from one servlet (like
> webapp.RequestHandler) to another or from servlet to jsp (like Django
> template).
> self.redirect("/someUrl") clears response and doesn't "transfer"
> request object. That is why I need redirect.
>
> The task is:
> I have a view (Django template)
> Person can perform silmpe crud: Create something, delete something,
> update something.
>
> Here is a code:
>
> #prepare view data, show news
> class AdminPage(webapp.RequestHandler):
>         def get(self):
>                 message = self.request.get('message')
>                 if not message:
>                         message = 'You are in admin console.'
>                 logging.debug("Did message came -> " + message);
>                 offset = self.request.get('offset')
>                 limit = self.request.get('limit')
>                 news = get_news(offset, limit, False)
>                 values = {
>                         'page': 'admin',
>                         'news': news,
>                         'count': get_news_count(),
>                         'message': message
>                 }
>                 path = 
> os.path.join(os.path.dirname(__file__),'html/admin.html')
>                 self.response.out.write( template.render(path, values) )
>
> #Hide news from user and send to view preparation
> class HideNews(webapp.RequestHandler):
>         def get(self):
>                 key = self.request.get('key')
>                 logging.debug("hide news with key["+key+"]")
>                 hide_news( key )
>                 values = {
>                         'message':'News was hidden'
>                 }
>                 self.redirect("/admin")
>
> As you can see "HideNews" performs an action and wants to send message
> to the news requestHandler.
> But it can't do it.
>
> Is there any opportunity to forward request processing in GAE?
>
> P.S
> I've tried to do this:
> class HideNews(webapp.RequestHandler):
>         def get(self):
>                 key = self.request.get('key')
>                 logging.debug("hide news with key["+key+"]")
>                 hide_news( key )
>                 message = "Some str with russian chars".decode('utf-8')
>                 url = "/admin?message=".decode('utf-8')+message
>                 self.redirect(url)
>
> And I get:
> self.response.headers['Location'] = str(absolute_url)
> UnicodeEncodeError: 'ascii' codec can't encode characters in position
> 36-42: ordinal not in range(128)
>
> It doesn't accept utf-8 chars?
> What to try next?
>
> Thanks in advance.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: minimal http response headers

2009-03-16 Thread Jarek Zgoda

Nothing forces you to use WebApp framework with its request/response
objects - WebOb is available already (afaik, in WebApp request is
WebOb request, but response is not a subclass of WebOb response),
Werkzeug works too.

On 15 Mar, 06:32, zombie  wrote:
> Does anyone know what is the minimum amount of data that the appengine
> http response can return?
>
> I need  the ***absolute*** minimum, counting both headers and data.
> Actually, I don't even plan to return any data, just 1 bit of
> information through (custom) status response codes like "201" (for OK)
> or "501" (for ERR).
>
> (as to why, short answer: GPRS transfer charged per byte, lots of
> requests)
>
> And since this is my custom app doing requests, I will not even use
> GET request, probably just HEAD, or even PUT (or anything that will
> help return the smallest amount of data). Also, any caching method
> (that could help) is possible for me (IfModified/ETag?).
>
> Doing a normal "GET / HTTP/1.0" request on some appengine app, I get
> this response headers:
>
> HTTP/1.0 200 OK
> Content-Type: text/html; charset=utf-8
> Cache-Control: no-cache
> Date: Sun, 15 Mar 2009 05:00:48 GMT
> Server: Google Frontend
> Content-Length: 2906
> Connection: Close
>
> I can see from appengine documentation that you can't modify Content-
> Length, Date and Server fields, so I suppose they can't be disabled
> either. Is there a way to disable them, possibly using custom HTTP
> commands (HEAD/PUT?)?
>
> Or just a simple redirection maybe? Are all those headers sent back
> when your script does a simple HTTP 302 redirect?
>
> Thanks in advance
> Tomislav Jovanovic
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: memcache won't be flushed after app is redeployed

2009-03-29 Thread Jarek Zgoda

I don't think it's possible.

One way around is to employ some kind of key versioning (using
CURRENT_VERSION_ID, for example). This way you'd be sure your app uses
always appropriate values.

On 29 Mar, 07:43, Coonay  wrote:
> the data strore is cleaned ,then i redeploy my app,next access my app
> via chrome,i found there are stale date in the memcache ,and i make
> sure these data has been deleted using the data viewer,
> My question is :
> won't the  memcache be flushed after app is redeployed?(appcfg.py
> update myapp)
> Ps:how to restart my app completely?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: Fastest Templating on AppEngine?

2009-04-05 Thread Jarek Zgoda

Mako (http://www.makotemplates.org/) is believed to be the fastest
templating engine in wide use (didn't found any reasonable tests to
prove this statement in the GAE environment).

Personally I prefer Jinja2 (http://jinja.pocoo.org/2/) because I like
Django templates syntax - although Jinja2 gives more flexibility at
the cost of slight differing from this syntax. I normal environment
Jinja2 template rendering is faster than Django, but on GAE you can
not use bytecode cache so templates are recompiled on every request -
no speed gain here.

On 3 Kwi, 02:13, Lee Olayvar  wrote:
> I'm curious, has anyone ran across any tests on appengine with various
> templating engines? I know there are speed comparisons all over the place,
> but im specifically concerning appengine since it has many aspects that
> force various templating engines to not use feature X or speed enhancing
> module Y.
>
> Any opinions would also be handy. I'm looking for an obviously sane
> language, but i have no desire/requirement for the ability to run complex
> logic inside templates (nor should anyone, imo.)
>
> Comments and opinions are much appreciated.
>
> Thanks,
> --
> Lee Olayvar
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: index.yaml is not source control friendly

2009-04-07 Thread Jarek Zgoda

I noticed this and I share your pain. I just set a policy to "don't
merge, just update" but this does not make much sense. On the other
way, not having this in repository would make deployment too fragile
process (what if we miss some test and deploy index.yaml without some
index?!).

On 7 Kwi, 19:04, Mahmoud  wrote:
> So it seems that dev_appserver.py keeps updating the comments in
> app.yaml mostly with usage counters. I keep having to diff and revert
> it before making commits, unless the changes were legit additions of
> new autogenerated indices.
>
> I can probably take a look at dev_appserver.py and disable this
> behavior. Any one else noticed this? Do you have any suggestions?
>
> -Mahmoud
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: PyCrypto Access

2009-05-07 Thread Jarek Zgoda

This seems to be problem with shell.appspot.com (it tries to persist
the DES object in session).

On 5 Maj, 23:53, Devel63  wrote:
> Doesn't seem to work onhttp://shell.appspot.com
>
> I can import a module (e.g., from Crypto.Cipher import DES), but when
> I try to use it I get all sorts of errors about not being able to
> pickle it (e.g., obj=DES.new('abcdefgh', DES.MODE_ECB).  I picked
> those 2 lines (and others) because they are straight out of the
> pycrypto examples.
>
> On May 5, 1:24 pm, Devel63  wrote:
>
> > OK, I hear what you all are saying: I need to install the libraries on
> > my dev server, but not upload them to my workspace because they will
> > already be accessible there.
>
> > However, I don't know why people on this thread keep saying that this
> > is the way it works with all the other 3rd party libraries.  To the
> > contrary, antlr3, django v0.96, webob, and yaml ... everything else
> > mentioned 
> > onhttp://code.google.com/appengine/docs/python/tools/libraries.html
> > ... gets installed with the SDK under the lib directory.
>
> > I guess I can give it a go and see what happens, but it seems weird to
> > me that Google would make a custom version, tell us it is not based on
> > the latest release of the public version, and then not distribute it
> > with the SDK as they have with every other incorporated library
> > (unless there's some security reason not to do so).  So I guess we
> > have to get it working locally, then upload and hope that it works
> > with their modified and reduced functionality module, which we have no
> > way of examining beforehand.
>
> > On May 5, 12:57 pm, Wooble  wrote:
>
> > > The libraries are installed on the App Engine production servers.
> > > They are not part of the SDK, so they're not on your machine unless
> > > you installed them, the same as the other third party libraries usable
> > > with App Engine.
>
> > > On May 5, 1:38 pm, Devel63  wrote:
>
> > > > What??  How does this reconcile with the 1.2.1 announcement:
>
> > > >     App Engine includes a custom version of the Python Cryptography
> > > > Toolkit, also known as PyCrypto.
> > > >     The version included with App Engine is based on pycrypto 2.0.1.
> > > > This is not the latest version, but
> > > >     should be largely compatible with more recent versions.
>
> > > >    http://code.google.com/appengine/docs/python/tools/libraries.html
>
> > > > On May 5, 7:54 am, "Nick Johnson (Google)" 
> > > > wrote:
>
> > > > > PyCrypto is a third-party library. If it is installed, it will be in
> > > > > your Python install's site-packages directory, not under the App
> > > > > Engine SDK.
>
> > > > > -Nick Johnson

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Re: LANGUAGE_CODE problem

2009-06-05 Thread Jarek Zgoda

http://docs.djangoproject.com/en/dev/topics/settings/#altering-settings-at-runtime

"You should not alter settings at runtime".

>From my experience - altering settings sometimes works and sometimes
not.

On 4 Cze, 17:36, wilmersarmiento  wrote:
> Hi,
>
> I'm working with the form validation framework included on Django. To
> show error messages in Spanish I set the LANGUAGE_CODE to 'es'.
> Everything works fine, however if I add an import to work with
> djangoforms the error messages are displayed ALWAYS in English, the
> app ignore my language code. Any ideas about this behavior?
>
> Thanks!
>
> Here is the code:
> ...
> from django.conf import settings
> from google.appengine.ext import webapp
> from google.appengine.ext import db
> from google.appengine.ext.webapp import template
> from django import newforms as forms
> from google.appengine.ext.db import djangoforms
> from google.appengine.api import mail
>
> # Set to Spanish the default language
> settings.LANGUAGE_CODE = 'es'
> ...
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---