[google-appengine] Re: App Engine Flexible Environment - Dockerfile installing outdated version of GDAL

2020-04-24 Thread j o
This is apparently happening as my app isn't running on port 8080 and App 
Engine is then crashing. How do I make sure that it is running on 8080? 

This is my app.yaml: 

EDIT:

My app.yaml:

# [START django_app] runtime: custom env: flex entrypoint: gunicorn -b :$PORT 
MyApplication.wsgi runtime_config: python_version: 3 # [END runtime] handlers: 
# This configures Google App Engine to serve the files in the app's static # 
directory. #- url: /static # static_dir: static/ #- url: /MyApplication/static 
# static_dir: MyApplication/static/ # This handler routes all requests not 
caught above to your main app. It is # required when static routes are defined, 
but can be omitted (along with # the entire handlers section) when there are no 
static files defined. - url: /.* script: auto # [END django_app] resources: 
cpu: 1 memory_gb: 2 disk_size_gb: 10


On Thursday, 23 April 2020 16:34:29 UTC+1, j o wrote:
>
>  am trying to use a Docker image on Google App Engine Flexible Environment.
>
> FROM ubuntu:bionic
>
>
> ENV PYTHONUNBUFFERED 1
> ENV DEBIAN_FRONTEND noninteractive
> ENV LANG C.UTF-8
>
> RUN apt-get update -qq && apt-get install -y -qq \
> # std libs
> git less nano curl \
> ca-certificates \
> wget build-essential\
> # python basic libs
> python3.8 python3.8-dev python3.8-venv gettext \
> # geodjango
> gdal-bin binutils libproj-dev libgdal-dev \
> # postgresql
> libpq-dev postgresql-client && \
> apt-get clean all && rm -rf /var/apt/lists/* && rm -rf /var/cache/apt/*
>
> # install pip
> RUN wget https://bootstrap.pypa.io/get-pip.py && python3.8 get-pip.py && rm 
> get-pip.py
> RUN pip3 install --no-cache-dir setuptools wheel -U
>
> CMD ["/bin/bash"]
>
>
>
>
> The docker image appears to build correctly but when the service deploys 
> the application crashes and i get this error message:
>
>  File 
> "/Users/NAME/Documents/gcp/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/operations_util.py",
>  line 183, in IsDone encoding.MessageToPyValue(operation.error))) 
> OperationError: Error Response: [9] 
>
> Application startup error! Code: APP_CONTAINER_CRASHED ERROR: 
> (gcloud.app.deploy) Error Response: [9] Application startup error! Code: 
> APP_CONTAINER_CRASHED
>
> This is failing as the Dockerfile is installing a significantly outdated 
> version of the GDAL package which conflicts with the more current python 
> installation.
>
> How do I ensure that the dockerfile has the correct package repository and 
> is installing the right, up to date, versions? Is there some line that I 
> can insert to update the repository, or at least print the repository, 
> before it starts installing?
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/8c5b0d27-17fd-438d-bc1c-7769a7c79898%40googlegroups.com.


[google-appengine] App Engine Flexible Environment - Dockerfile installing outdated version of GDAL

2020-04-23 Thread j o


 am trying to use a Docker image on Google App Engine Flexible Environment.

FROM ubuntu:bionic


ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8

RUN apt-get update -qq && apt-get install -y -qq \
# std libs
git less nano curl \
ca-certificates \
wget build-essential\
# python basic libs
python3.8 python3.8-dev python3.8-venv gettext \
# geodjango
gdal-bin binutils libproj-dev libgdal-dev \
# postgresql
libpq-dev postgresql-client && \
apt-get clean all && rm -rf /var/apt/lists/* && rm -rf /var/cache/apt/*

# install pip
RUN wget https://bootstrap.pypa.io/get-pip.py && python3.8 get-pip.py && rm 
get-pip.py
RUN pip3 install --no-cache-dir setuptools wheel -U

CMD ["/bin/bash"]




The docker image appears to build correctly but when the service deploys 
the application crashes and i get this error message:

 File 
"/Users/NAME/Documents/gcp/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/operations_util.py",
 line 183, in IsDone encoding.MessageToPyValue(operation.error))) 
OperationError: Error Response: [9] 

Application startup error! Code: APP_CONTAINER_CRASHED ERROR: 
(gcloud.app.deploy) Error Response: [9] Application startup error! Code: 
APP_CONTAINER_CRASHED

This is failing as the Dockerfile is installing a significantly outdated 
version of the GDAL package which conflicts with the more current python 
installation.

How do I ensure that the dockerfile has the correct package repository and 
is installing the right, up to date, versions? Is there some line that I 
can insert to update the repository, or at least print the repository, 
before it starts installing?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/202a0ca3-7c09-4332-a728-edd54d4a2f77%40googlegroups.com.


Re: [google-appengine] Re: Configure app.yaml for standard env

2019-02-07 Thread Artur O
Hey, thnx a lot for your explanation it makes sense. So does it mean that
each health check activates instance? And im being billed for that? For
front end  and ram hours?

вт, 22 янв. 2019 г., 21:46 'George (Cloud Platform Support)' via Google App
Engine google-appengine@googlegroups.com:

> Hello Artur,
>
> You may consider switching to other instance class, such as F2, all
> depending on your application's needs, and your design decisions. You can
> not readily refer to practice, all depending on your application. You set
> instance class in app.yaml. Details are available on the "App Engine
> Standard Environment" page
> .
>
> You may check how come your app has become popular by reading its relevant
> logs. One has access to logs through Developers' Console.
>
> A possible explanation for your app's activity might come from side of
> health checking. The environment verifies periodically that your app is up
> and running by sending specific requests. You can configure health checking
> in the app.yaml configuration file
> .
> The entry looks similar to:
>
> health_check:
>   enable_health_check: True
>   check_interval_sec: 5
>   timeout_sec: 4
>   unhealthy_threshold: 2
>   healthy_threshold: 2
>
> Related to your point 2: you may consider changing mentioned parameters in
> accordance with your needs. You can establish your app's needs by checking
> relevant information items from Developers' Console, and set up Stackdriver
> Monitoring  to get even more
> detail. You can use this information to determine that your app needs more
> memory or disc size, if usage is proven high for these resources.
>
> --
> 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 https://groups.google.com/group/google-appengine.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-appengine/f07a5099-d3a2-40b8-82bd-f0025c722b52%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CAEMnJqHUNEpowGpCR_KHe%2Bh4%3D55PgOaZ0UjMfHHG0O-CTPOGfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] OAuth consent screen now showing scope options

2018-09-27 Thread o. topalov
I have two seemingly identical projects created in two different accounts. 
Both projects use the same set of Google APIs - Google Picker and Google 
Drive. In one of the projects (the one created earlier) I can see and set 
up scope options inside the console.developers.google.com UI under 
Credentials/OAuth consent screen. In the other project the same screen is 
missing the scope options (and other settings). What am I missing?

-- 
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 https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/5462c93d-072e-4f2a-9210-553313169f76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: HOWTO: SSL for your custom domain on GAE

2012-04-01 Thread p c o p d
very nice article.
thanks for writing it

On Mar 31, 1:52 am, Jeff Schnitzer j...@infohazard.org wrote:
 A number of people have asked me about this, so I wrote up some
 details on how to use CloudFlare to get always-on SSL:

 http://blorn.com/post/20185054195/ssl-for-your-domain-on-google-app-e...

 Enjoy,
 Jeff

-- 
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 hide url extension (.html) from the page in python in app engine

2012-03-30 Thread p c o p d
hi.
thanks so much for the guidance.
i will try to follow your advice.
regards

On Mar 26, 12:25 pm, Ajit ajithwi...@gmail.com wrote:
 Hi,

 You could map the urls in urls.py and there you can customize urls to
 be shown for your pages.
 For eg:
  ('contact', associated handler method for contact.html),
  ('about', associated handler method for about.html)

 On Mar 25, 4:39 pm,p c o p dpc...@yahoo.com wrote:







  hi . i am new  app engine user. please help me how can i hide the url
  extension i mean .html from the page in python in app engine?
  i want my pages to be shown as about instead of about.html
  contact instead of contact.html
  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] how to hide url extension (.html) from the page in python in app engine

2012-03-25 Thread p c o p d
hi . i am new  app engine user. please help me how can i hide the url
extension i mean .html from the page in python in app engine?
i want my pages to be shown as about instead of about.html
contact instead of contact.html
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] Google App abuse

2011-12-12 Thread Martin O. Hamann
howdy


I have found 2 web apps that take advantage of Google's technology to steal 
content!

http://gaucho-labnol.appspot.com/
http://mirrorrr.appspot.com/

These apps reflect the content of entire domains. I want to report the 
abuse and ask 
for advice at the same time, what can I do about it.

cheers
--

-- 
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/-/fr1dFpP04ZQJ.
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] Cron jobs doesn't write to datastore

2011-10-12 Thread O
I have some cronjobs defined, their job is to update the datastore on
a regular basis.
- What I notice is that the cron jobs report to run fine according to
AppEngine, but no data is to be found in the datastore.
- If I navigate to the cronjob url manually in my webbrowser the
datastore is updated as it should.
- In my local development environment the local datastore is updated
as it should when I launch the webapp using the local development
server (using Eclipse with GWT plugin)

/cronjobs/cron.html?apikey=XXuserid=XXrequest=servers
Update the server list daily every day 00:00 (UTC)
2011/10/12 00:00:00 on time Success

/cronjobs/cron.html?apikey=XXuserid=XXrequest=static/strings
Update the server list daily every day 00:10 (UTC)
2011/10/12 00:10:00 on time Success



Where should I start looking ? It's kinda hard to debug since this
only fails on the automated chron jobs :/




-- 
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: Text files bulk upload : any advice ?

2011-04-14 Thread Tony O Dowd
Hi there, this might be helpful. I've recently developed a file
uploaded for an crowd source application I'm involved in and have used
a DiskFileItemFactory. Once you create a factory object you can set
the size of the files that are to be uploaded. Bt default it's 10K but
you cN manually set this  for smaller sizes. here is some code
snippets that may be helpful :-


DiskFileItemFactory factory = new DiskFileItemFactory();  // create
the factory for file uploading
factory.setSizeThreshold(Memory); // this sets the threshold for files
to be held in memory or stored on disk
factory.setRepository(server folder); // defines the location on your
server where the files are to be stored

You  should use this in conjunction with a ServletFileUpload object so
you can bulk load multiple files to your server.

Hope this is helpful,

T.


On Apr 13, 11:53 am, davidgm david.guyonmar...@gmail.com wrote:
 Hi there,

 I've read
 * how to upload one text file - that's ok.
 * how to bulk upload data (csv)  - that's ok also.

 But this doesn't help with for this problem:

 = I need to upload a few dozen of small text files (a few kbytes
 each).

 I need to refresh them sometimes. They will be stored in datastore
 with a few metadata (filename and a release no).

 I've been thinking to merge them into one big file to split then later
 in GAE. But I would rather not do it this way, unless you have a nice
 technique to handle that. They all have special characters of all
 kinds and unicode...

 Do you have any suggestion ?
 Thank you

-- 
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: Just a little help

2011-04-11 Thread Tony O Dowd

Are you using Python or JAVA to build your servlets?

If You're using Java you need to define your servlet in your web.XML
file. You simply define the servlet name, the class it points to and
then the mapping of the servlet name to it's URL. If you checkout the
default web.XML file that is created when you build the default GWT
app in eclipse you'll see a good example of this.

On Apr 11, 7:26 am, Divyahans divyaha...@gmail.com wrote:
 Hi, I'm just starting off with App Engine and was looking for a little
 help.

 I've made Java Servlets on App Engine with the URLs like 
 -http://www.test.appspot.com/test

 But, how would I make a Java Servlet with the URL 
 -http://www.test.appspot.com/test/page2

 Could someone give me some advice?

-- 
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] Redirecting to a web page from a servlet

2011-04-11 Thread Tony O Dowd
Im calling a httpservlet from a GXT FormPanel using the usual
FormPanel.submit() method. This calls the doPost( request, response)
method of the httpservlet. Im using Submit as I'm uploading data to
the sever from a client using a FileUploadField in the FormPanel.

My problem is that by using FormPanel.Submit(), the browser opens a
new tab and  jumps to the HTML page of the httpservlet, thus changing
the focus from my GXT main application running in the browser.

anyone know a neat solution to prevent this and maintain the focus in
the main GXT application tab?

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] Blocked in China?

2011-04-07 Thread Mikko O
Hi,

Our friends in China have problems to access *.appspot.com domains. 

Is this temporary problem or does China tend to ban Google stuff with a big 
hand?

Also Google Groups seem to be unreachable from the location.

-- 
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: Using eclipse to build google gadgets...

2011-03-25 Thread Tony O Dowd
You've made an Irish man very happy to read this.stellar stuff!

On Mar 23, 8:24 pm, yuvi yuvalheft...@gmail.com wrote:
 Hi,

 I have been doing that for the last year and about to release a new
 open-source for that Gadglet 

 The CLIENT side is done with GWT library from Google see

 http://code.google.com/p/gwt-google-apis/wiki/GadgetsGettingStarted

 http://gwt-google-apis.googlecode.com/svn/javadoc/gadgets/1.2/index.html

 The SERVER side is implemented on Google App Engine ... in between a
 complete JSON data protocol.

 Feel free to ask more questions directly, and if you are interested
 you can have Gadglet alpha version in about 3 weeks.

 On Mar 23, 6:20 pm, Tony O Dowd tonyat...@gmail.com wrote: Anyone got a 
 good reference to using eclipse to develop google
  gadgets. I traced an article that offered a solution that requires
  lots of additional changes to linkers and other system libraries.
  Surely, there is an easier way. Anyone got a better path to follow?

-- 
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] Using eclipse to build google gadgets...

2011-03-23 Thread Tony O Dowd
Anyone got a good reference to using eclipse to develop google
gadgets. I traced an article that offered a solution that requires
lots of additional changes to linkers and other system libraries.
Surely, there is an easier way. Anyone got a better path to follow?

-- 
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] Can't create a new app using the Google App Engine...

2011-03-22 Thread Tony O Dowd
I've created my first App on the Google App Engine and everything went
well, however, now when I try to create a new application it asks me
to Verify my Account using SMS. As I've already done this previously,
it will not allow me to specify my phone number again. I've tried
using other phone numbers but it just won't let me past this
verification screen

Anybody experience a similar problem and have a solution?

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.



Re: [appengine-java] Re: Probably a newbie question (most likely)

2011-02-23 Thread Fernando O.
Actually I had to persist the user :D

But I found another problem: The Key for the Thread is a Long... Appengine
is generating dupes for that key even though it's the pk. It loooks like it
realizes that a Thread is owned by a user and in the DB it ends with a PK
UserID, ThreadID

The weird part is that the comment does not inherits that and if I open the
thread 1 for user A and thread 1 for user B I see the same comments.




On Wed, Feb 23, 2011 at 11:42 AM, WillSpecht willspe...@gmail.com wrote:

 Check out this blog post:

 http://gae-java-persistence.blogspot.com/2009/10/creating-bidrectional-owned-one-to-many.html

 I'm pretty sure you want to be persisting the thread and not the
 comment.  If you make it un-owned, you want the thread to have a key
 and a user, then each comment has a key and a parent key which is the
 key of the thread it belongs to.  if you do a query where parent key
 == thread key you should get all the comments that belong to the
 thread.

 On Feb 22, 7:06 pm, Fernando O. fot...@gmail.com wrote:
  tried that and it's telling me
  org.datanucleus.exceptions.NucleusObjectNotFoundException: Could not
  retrieve entity of kind Thread with key Thread(51)
 
  I also tried doing a query with the Thread key and UserKey (wich is the
 key
  for a thread) and then I get an exception about modifying 2 entities in 1
  transaction :S
 
  On Tue, Feb 22, 2011 at 8:56 PM, Fernando O. fot...@gmail.com wrote:
   Thanks! I'll try that. BTW no, addComment does not store the comment.
 
   On Tue, Feb 22, 2011 at 8:49 PM, WillSpecht willspe...@gmail.com
 wrote:
 
   Don't you need to persist the thread as well as the comment?  It's
   hard to analyze your code with such a small sample.  Does addComment
   persist the thread? My
guess is that something is making the transaction fail, probably
   cause you are trying to operate on two different entity groups. I
   would simply store the comment as it's own entity and when you want
   all the comments simply do a query for comments with parentKey ==
   ThreadKey.
 
   On Feb 21, 9:30 pm, Fernando O. fot...@gmail.com wrote:
Hi all.
First of all I have to admit: I havent read all the docs.
 
I had a small app running, it basically has this:
A User:
@PersistenceCapable(detachable = true)
@FetchGroup(name = _post, members = { @Persistent(name = posts)
 })
public class User implements Serializable{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
@Persistent(mappedBy = user, defaultFetchGroup = true)
@Element(dependent = true)
private ListPost posts;
}
 
A thread :
 
@PersistenceCapable(detachable = true)
@FetchGroup(name = _user, members = { @Persistent(name = user)})
public class Thread implements Serializable {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long key;
 
@Persistent(defaultFetchGroup = true)
@Element(dependent = true)
private User user;
...
 
}
 
So now I want to add comments, each comment will have: the user that
   made
the comment, and the thread that it belongs to, and some other
 fields:
@PersistenceCapable(detachable = true)
public class ThreadComment implements Serializable{
 @PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
 
@Persistent(defaultFetchGroup = true)
@Element(dependent = true)
private User user;
 
@Persistent(defaultFetchGroup = true)
@Element(dependent = true)
private Thread thread;
...
 
}
 
I changed the Thread to include a list of comments:
@PersistenceCapable(detachable = true)
@FetchGroup(name = _user, members = { @Persistent(name =
comments),@Persistent(name
= user)})
public class Thread implements Serializable {

@Persistent(defaultFetchGroup = true)
@Element(dependent = true)
private ListThreadComment comments;
 
}
 
My problem is that meanwhile this works in memory when I try to
 persist
   the
ThreadComment
PersistenceManager pm = getPMF();
Transaction tx = pm.currentTransaction();
tx.begin();
thread.addComment(comment);
pm.makePersistent(comment);
tx.commit();
pm.close();
 
the code gets excecuted but I don't see the comment in the database
 (in
   fact
the logs show no db activity either)
So I don't see an exception, the code gets excecuted but I don't see
 the
comment in the DB.
 
I already have the db with soem threads without comments, this is a
 new
feature
 
Any idea of what I'm doing wrong? (please don't say everything :D )
 
Thanks!
 
Fernando
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Google App Engine for Java group.
   To post to this group, send email to
   google-appengine-java@googlegroups.com.
   To unsubscribe from this group, send email

Re: [appengine-java] Re: Probably a newbie question (most likely)

2011-02-22 Thread Fernando O.
Thanks! I'll try that. BTW no, addComment does not store the comment.

On Tue, Feb 22, 2011 at 8:49 PM, WillSpecht willspe...@gmail.com wrote:

 Don't you need to persist the thread as well as the comment?  It's
 hard to analyze your code with such a small sample.  Does addComment
 persist the thread? My
  guess is that something is making the transaction fail, probably
 cause you are trying to operate on two different entity groups. I
 would simply store the comment as it's own entity and when you want
 all the comments simply do a query for comments with parentKey ==
 ThreadKey.

 On Feb 21, 9:30 pm, Fernando O. fot...@gmail.com wrote:
  Hi all.
  First of all I have to admit: I havent read all the docs.
 
  I had a small app running, it basically has this:
  A User:
  @PersistenceCapable(detachable = true)
  @FetchGroup(name = _post, members = { @Persistent(name = posts) })
  public class User implements Serializable{
  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key key;
 
  @Persistent(mappedBy = user, defaultFetchGroup = true)
  @Element(dependent = true)
  private ListPost posts;
  }
 
  A thread :
 
  @PersistenceCapable(detachable = true)
  @FetchGroup(name = _user, members = { @Persistent(name = user)})
  public class Thread implements Serializable {
  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Long key;
 
  @Persistent(defaultFetchGroup = true)
  @Element(dependent = true)
  private User user;
  ...
 
  }
 
  So now I want to add comments, each comment will have: the user that made
  the comment, and the thread that it belongs to, and some other fields:
  @PersistenceCapable(detachable = true)
  public class ThreadComment implements Serializable{
   @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key key;
 
  @Persistent(defaultFetchGroup = true)
  @Element(dependent = true)
  private User user;
 
  @Persistent(defaultFetchGroup = true)
  @Element(dependent = true)
  private Thread thread;
  ...
 
  }
 
  I changed the Thread to include a list of comments:
  @PersistenceCapable(detachable = true)
  @FetchGroup(name = _user, members = { @Persistent(name =
  comments),@Persistent(name
  = user)})
  public class Thread implements Serializable {
  
  @Persistent(defaultFetchGroup = true)
  @Element(dependent = true)
  private ListThreadComment comments;
 
  }
 
  My problem is that meanwhile this works in memory when I try to persist
 the
  ThreadComment
  PersistenceManager pm = getPMF();
  Transaction tx = pm.currentTransaction();
  tx.begin();
  thread.addComment(comment);
  pm.makePersistent(comment);
  tx.commit();
  pm.close();
 
  the code gets excecuted but I don't see the comment in the database (in
 fact
  the logs show no db activity either)
  So I don't see an exception, the code gets excecuted but I don't see the
  comment in the DB.
 
  I already have the db with soem threads without comments, this is a new
  feature
 
  Any idea of what I'm doing wrong? (please don't say everything :D )
 
  Thanks!
 
  Fernando

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



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



Re: [appengine-java] Re: Probably a newbie question (most likely)

2011-02-22 Thread Fernando O.
tried that and it's telling me
org.datanucleus.exceptions.NucleusObjectNotFoundException: Could not
retrieve entity of kind Thread with key Thread(51)

I also tried doing a query with the Thread key and UserKey (wich is the key
for a thread) and then I get an exception about modifying 2 entities in 1
transaction :S

On Tue, Feb 22, 2011 at 8:56 PM, Fernando O. fot...@gmail.com wrote:

 Thanks! I'll try that. BTW no, addComment does not store the comment.

 On Tue, Feb 22, 2011 at 8:49 PM, WillSpecht willspe...@gmail.com wrote:

 Don't you need to persist the thread as well as the comment?  It's
 hard to analyze your code with such a small sample.  Does addComment
 persist the thread? My
  guess is that something is making the transaction fail, probably
 cause you are trying to operate on two different entity groups. I
 would simply store the comment as it's own entity and when you want
 all the comments simply do a query for comments with parentKey ==
 ThreadKey.

 On Feb 21, 9:30 pm, Fernando O. fot...@gmail.com wrote:
  Hi all.
  First of all I have to admit: I havent read all the docs.
 
  I had a small app running, it basically has this:
  A User:
  @PersistenceCapable(detachable = true)
  @FetchGroup(name = _post, members = { @Persistent(name = posts) })
  public class User implements Serializable{
  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key key;
  @Persistent(mappedBy = user, defaultFetchGroup = true)
  @Element(dependent = true)
  private ListPost posts;
  }
 
  A thread :
 
  @PersistenceCapable(detachable = true)
  @FetchGroup(name = _user, members = { @Persistent(name = user)})
  public class Thread implements Serializable {
  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Long key;
 
  @Persistent(defaultFetchGroup = true)
  @Element(dependent = true)
  private User user;
  ...
 
  }
 
  So now I want to add comments, each comment will have: the user that
 made
  the comment, and the thread that it belongs to, and some other fields:
  @PersistenceCapable(detachable = true)
  public class ThreadComment implements Serializable{
   @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key key;
 
  @Persistent(defaultFetchGroup = true)
  @Element(dependent = true)
  private User user;
 
  @Persistent(defaultFetchGroup = true)
  @Element(dependent = true)
  private Thread thread;
  ...
 
  }
 
  I changed the Thread to include a list of comments:
  @PersistenceCapable(detachable = true)
  @FetchGroup(name = _user, members = { @Persistent(name =
  comments),@Persistent(name
  = user)})
  public class Thread implements Serializable {
  
  @Persistent(defaultFetchGroup = true)
  @Element(dependent = true)
  private ListThreadComment comments;
 
  }
 
  My problem is that meanwhile this works in memory when I try to persist
 the
  ThreadComment
  PersistenceManager pm = getPMF();
  Transaction tx = pm.currentTransaction();
  tx.begin();
  thread.addComment(comment);
  pm.makePersistent(comment);
  tx.commit();
  pm.close();
 
  the code gets excecuted but I don't see the comment in the database (in
 fact
  the logs show no db activity either)
  So I don't see an exception, the code gets excecuted but I don't see the
  comment in the DB.
 
  I already have the db with soem threads without comments, this is a new
  feature
 
  Any idea of what I'm doing wrong? (please don't say everything :D )
 
  Thanks!
 
  Fernando

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




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



[appengine-java] Probably a newbie question (most likely)

2011-02-21 Thread Fernando O.
Hi all.
First of all I have to admit: I havent read all the docs.

I had a small app running, it basically has this:
A User:
@PersistenceCapable(detachable = true)
@FetchGroup(name = _post, members = { @Persistent(name = posts) })
public class User implements Serializable{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent(mappedBy = user, defaultFetchGroup = true)
@Element(dependent = true)
private ListPost posts;

}
A thread :

@PersistenceCapable(detachable = true)
@FetchGroup(name = _user, members = { @Persistent(name = user)})
public class Thread implements Serializable {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long key;

@Persistent(defaultFetchGroup = true)
@Element(dependent = true)
private User user;
...
}


So now I want to add comments, each comment will have: the user that made
the comment, and the thread that it belongs to, and some other fields:
@PersistenceCapable(detachable = true)
public class ThreadComment implements Serializable{
 @PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent(defaultFetchGroup = true)
@Element(dependent = true)
private User user;

@Persistent(defaultFetchGroup = true)
@Element(dependent = true)
private Thread thread;
...
}

I changed the Thread to include a list of comments:
@PersistenceCapable(detachable = true)
@FetchGroup(name = _user, members = { @Persistent(name =
comments),@Persistent(name
= user)})
public class Thread implements Serializable {

@Persistent(defaultFetchGroup = true)
@Element(dependent = true)
private ListThreadComment comments;
}


My problem is that meanwhile this works in memory when I try to persist the
ThreadComment
PersistenceManager pm = getPMF();
Transaction tx = pm.currentTransaction();
tx.begin();
thread.addComment(comment);
pm.makePersistent(comment);
tx.commit();
pm.close();

the code gets excecuted but I don't see the comment in the database (in fact
the logs show no db activity either)
So I don't see an exception, the code gets excecuted but I don't see the
comment in the DB.

I already have the db with soem threads without comments, this is a new
feature

Any idea of what I'm doing wrong? (please don't say everything :D )


Thanks!

Fernando

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



Re: [appengine-java] Re: Problem with persist a child class

2010-09-24 Thread Fernando O.
you don't need an aditional key

your problem is that you already have a @PrimaryKey in Fecha so you don't
need it in RegFechaUsuario.

Cheers,
Fernando

On Thu, Sep 23, 2010 at 8:30 PM, lisandrodc lisandr...@gmail.com wrote:

 Hi!Cyrille I add a primary key in my child class:

 @PersistenceCapable(identityType =
 IdentityType.APPLICATION,detachable=true)
 public class RegFechaUsuario extends Fecha  {
 @PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;
@Persistent
 private int puntos;
@Persistent
private Long idUsuarioFecha;
@Persistent
private Long idFechaOriginal;


 And the exception is:

Error in meta-data for model.RegFechaUsuario: More than one
 primary key field.

 Caused by:

 Error in meta-data for model.RegFechaUsuario: More than one primary
 key field.
 org.datanucleus.store.appengine.MetaDataValidator
 $DatastoreMetaDataException: Error in meta-data for
 model.RegFechaUsuario: More than one primary key field.
at

 org.datanucleus.store.appengine.MetaDataValidator.validatePrimaryKey(MetaDataValidator.java:
 416)
at

 org.datanucleus.store.appengine.MetaDataValidator.validate(MetaDataValidator.java:
 120)
at

 org.datanucleus.store.appengine.DatastoreManager.validateMetaDataForClass(DatastoreManager.java:
 766)
at

 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPreProcess(DatastorePersistenceHandler.java:
 328)
 at

 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects(DatastorePersistenceHandler.java:
 251)
at

 org.datanucleus.store.appengine.BatchPutManager.processBatchState(BatchPutManager.java:
 35)
at
 org.datanucleus.store.appengine.BatchManager.finish(BatchManager.java:
 54)
at
 org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager
 $BatchManagerWrapper.call(DatastoreJDOPersistenceManager.java:127)
at
 org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager
 $BatchManagerWrapper.access$200(DatastoreJDO

 On 23 sep, 05:25, Cyrille Vincey crll...@gmail.com wrote:
  There is no primary key in your child class.
  Add one.
 
  On 23/09/10 04:40, lisandrodc lisandr...@gmail.com wrote:
 
 
 
   Hi ! I have a problem when persist a chid class.
   The parent class:
 
   @PersistenceCapable
 
   @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
   public  abstract class Fecha   {
 
   @PrimaryKey
   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
   private Key id;
   @Persistent
   private String nombre;
   @Persistent
   private Date fechaIni;
   @Persistent
   private Date fechaFin;
 
   @Persistent(defaultFetchGroup = true)
   ListPartido partidos;
 
   private Long id2;
 
   private Long kind;
 
   The child class:
   @PersistenceCapable(identityType =
   IdentityType.APPLICATION,detachable=true)
   public class RegFechaUsuario extends Fecha  {
 
   @Persistent
   private int puntos;
   @Persistent
   private Long idUsuarioFecha;
   @Persistent
   private Long idFechaOriginal;
 
   The method at persist:
 
   public void crearRegFechaUsuario(RegFechaUsuario regFechaUsuario) {
   //regFechaUsuario is an object initialized
   Transaction tx = pm.currentTransaction();
   try {
   tx.begin();
 
   pm.makePersistentAll(regFechaUsuario);
  //here is the exception
   tx.commit();
   } finally {
   // pm.close();
   if (tx.isActive()) {
   tx.rollback();
   }
   }
 
   }
 
   And the exception is (internal error of the library of google apps or
   datanucleus), the cast:
 
   Problem accessing /Prode/JugarFecha.action. Reason:
 
   java.lang.Long cannot be cast to java.lang.String
 
   Caused by:
 
   java.lang.ClassCastException: java.lang.Long cannot be cast to
   java.lang.String
   at
  
 org.datanucleus.store.appengine.DatastoreRelationFieldManager.checkForParentSw
   itch(DatastoreRelationFieldManager.java:
   202)
   at org.datanucleus.store.appengine.DatastoreRelationFieldManager
   $1.setObjectViaMapping(DatastoreRelationFieldManager.java:133)
   at org.datanucleus.store.appengine.DatastoreRelationFieldManager
   $1.apply(DatastoreRelationFieldManager.java:112)
   at
  
 org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations(D
   atastoreRelationFieldManager.java:
   81)
   at
  
 org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations(Datastore
   FieldManager.java:
   955)
   at
  
 org.datanucleus.store.appengine.DatastorePersistenceHandler.storeRelations(Dat
   astorePersistenceHandler.java:
   546)
   at
  
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPostProcess(
   DatastorePersistenceHandler.java:
   304)
   at
  
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects(Data
   storePersistenceHandler.java:
   256)
   at
  
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject(Datas
   

[google-appengine] TransactionFailedError: too much contention on these datastore entities. please try again.

2010-03-09 Thread Magnus O.
Hi,

Im using the bulk upload tool to upload alot of entities (6 million).
The upload has been going on for about four days now and is soon
finished. The last couple of ours I have been getting a hole lot of
TransactionFailedError: too much contention on these datastore
entities. please try again. errors in the upload tool. What does this
mean?

Magnus

-- 
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-appeng...@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] Total Stored Data is 7.37GB but Size of all entities says 1GB...

2010-03-09 Thread Magnus O.
Hi,

I started uploading a hole lot of entities (6 million) a couple of
days ago using the bulk upload tool. My csv file included about 6
million rows (entities) and the total size of the csv file was 350mb
in UTF-8 format.

The upload is soon finished (has been uploaded for four days) and I
noticed a weired thing in the my dashboard. The Total Stored Data has
grown from 0 to 7.37GB of data while the database statistic says that
the total size of my entities is 1GB. What is the restoring 6.37GB of
data?

Magnus

-- 
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-appeng...@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: Total Stored Data is 7.37GB but Size of all entities says 1GB...

2010-03-09 Thread Magnus O.
Ahh, so I really should set noindex on properties that I don't need to
be indexed then :)

On Mar 9, 1:19 pm, 风笑雪 kea...@gmail.com wrote:
 Indexes are also takes 
 space.http://code.google.com/intl/en/appengine/articles/storage_breakdown.html

 --
 keakon

 2010/3/9 Magnus O. mag...@magnusottosson.se:



  Hi,

  I started uploading a hole lot of entities (6 million) a couple of
  days ago using the bulk upload tool. My csv file included about 6
  million rows (entities) and the total size of the csv file was 350mb
  in UTF-8 format.

  The upload is soon finished (has been uploaded for four days) and I
  noticed a weired thing in the my dashboard. The Total Stored Data has
  grown from 0 to 7.37GB of data while the database statistic says that
  the total size of my entities is 1GB. What is the restoring 6.37GB of
  data?

  Magnus

  --
  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-appeng...@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-appengine+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/google-appengine?hl=en.

-- 
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-appeng...@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] Bulk upload - OperationalError: unable to open database file

2010-03-04 Thread Magnus O.
Hi,

I'm trying to upload a large set of data (8 million entities). I'm
testing the upload like this:

C:\Users\magnus\Desktop\citiesappcfg.py upload_data --
config_file=cityloader.py --filename=allCountriescsv.csv --kind=City c:
\Users\magnus\Code\blirdetsol.se --db_filename=progress.sql --dry_run
--batch_size=5 --rps_limit=10

However, after processing a number of lines I get:

Application: xx; version: xxx.
Uploading data records.
[INFO] Logging to bulkloader-log-20100305.084929
[INFO] Throttling transfers:
[INFO] Bandwidth: 25 bytes/second
[INFO] HTTP connections: 8/second
[INFO] Entities inserted/fetched/modified: 10/second
[INFO] Opening database: progress.sql
[INFO] Running in dry run mode, skipping remote_api setup
[INFO] Connecting to xxx/remote_api
[INFO] Starting import; maximum 5 entities per post
..
..
..
..
..
..
..

[ERROR   ] [Thread-11] ProgressTrackerThread:
Traceback (most recent call last):
  File C:\Program Files (x86)\Google\google_appengine\google\appengine
\tools\bulkloader.py, line 1431, in run
self.PerformWork()
  File C:\Program Files (x86)\Google\google_appengine\google\appengine
\tools\bulkloader.py, line 2202, in PerformWork
self.UpdateProgress(item)
  File C:\Program Files (x86)\Google\google_appengine\google\appengine
\tools\bulkloader.py, line 2238, in UpdateProgress
self.db.UpdateState(item.progress_key, item.state)
  File C:\Program Files (x86)\Google\google_appengine\google\appengine
\tools\bulkloader.py, line 2015, in UpdateState
(new_state, key))
OperationalError: unable to open database file
[INFO] Unexpected thread death: Thread-11
[INFO] An error occurred. Shutting down...
[WARNING ] data source thread hung while trying to exit

Any ideas on this problem? Can't the sqllite db handle the large
amount of data?

//Magnus

-- 
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-appeng...@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] Bulk uploading data does not upload everything

2010-03-02 Thread Magnus O.
Hi,

I tried to upload a large set of data using the upload_data option. I
have created a csv files for my data and it's about 87000 lines in it.
When I tried to upload it just uploaded 8260 items end exited with a
successfull result.

Is there a limit in the uploader?

This is the csv file I try to upload:
http://docs.google.com/leaf?id=0B_TiMdLE7NyrMGU4YjAwMmItZmJkMS00YWRjLWI0Y2UtYzQ4OTU1Njk4N2Ezhl=en
This is the cityloader.py:
https://docs.google.com/leaf?id=0B_TiMdLE7NyrNTEwMjg3MGItMzU5OS00YWNlLTlmMzEtMWFmNzkwN2RiYTMzhl=en

And I try to upload using this cmd: appcfg.py upload_data --
config_file=cityloader.py --filename=cities.csv --kind=City app-
dir --db_filename=progress.sql

Any ideas why it just uploads the first 8260 lines?

-- 
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-appeng...@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] this resource used a high amount of CPU and may soon exceed it's qouta

2010-01-24 Thread Magnus O.
Hi,

I have an app which has enabled billing. Totally I'm far from
exceeding my qouta but in the logs I see on many requests the
following: this resource used a high amount of CPU and may soon
exceed it's qouta. It seems like these requests use about 1000cpu_ms.
How much is allowed for one requests? I read something about per-
minute qouta...

The handler of this type of requests just acts like a proxy server to
a rest api:

--
import cgi
import urllib
import wsgiref.handlers
import datetime
from google.appengine.ext import webapp
from google.appengine.api import urlfetch
from google.appengine.api import memcache

class YrController(webapp.RequestHandler):

def get(self):

self.response.headers['Content-Type'] = text/xml
self.response.headers['Cache-Control'] = public, max-age=3600

endpoint = 'http://api.yr.no/weatherapi/locationforecast/1.6/'

params = self.request.GET
apiquery = urllib.urlencode(params)

weather = memcache.get(apiquery)
lastmod = memcache.get(apiquery + Last-Modified)
expires = memcache.get(apiquery + Expires)

if lastmod is None:
lastmod = 
datetime.datetime.today().replace(microsecond=0)
if expires is None:
expires = lastmod + datetime.timedelta(hours=1)

if self.request.headers.has_key(If-Modified-Since):
dt = self.request.headers.get(If-Modified-Since)
modsince = datetime.datetime.strptime(dt, %a, %d %b %Y 
%H:%M:%S
GMT)
if modsince = lastmod:
self.error(304)
return

if weather is None:
result = urlfetch.fetch(url=endpoint + '?' + apiquery,
method=urlfetch.GET)
weather = result.content
memcache.set(key=apiquery, value=result.content, 
time=3600)
memcache.set(key=apiquery + Last-Modified, 
value=lastmod,
time=3600)
memcache.set(key=apiquery + Expires, value=expires, 
time=3600)


self.response.headers['Last-Modified'] = lastmod.strftime(%a, 
%d %b
%Y %H:%M:%S GMT)
self.response.headers['Expires'] = expires.strftime(%a, %d %b 
%Y %H:
%M:%S GMT)

self.response.out.write(weather)

def main():
application = webapp.WSGIApplication([('/api/', YrController)],
debug=True)
wsgiref.handlers.CGIHandler().run(application)

if __name__ == __main__:
main()
--

Is it because the requests can take some time to excecute (waiting for
the the urlfetch request) it takes alot of cpu_ms? How can I improve
the performance of this?

Magnus

-- 
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-appeng...@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] Quota's

2010-01-24 Thread Magnus O.
Hi,

The free quote includes 4gb of incoming requests using URL Fetch. The
totals of free quota for incoming traffic is 1gb which in practice
limits the URL Fetch free quota to 1gb since it counts towards the
incoming traffic quota. This is kind of misleading isn't it?

Magnus

-- 
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-appeng...@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] Problem figuring our the logs

2010-01-22 Thread Magnus O.
Hi,

On the dashboard for my application I see that I have several errors
on the path /. When I click on the link I can see the following in
the log:

01-22 12:46AM 25.130 / 405 10ms 9cpu_ms 0kb FeedBurner/1.0 (http://
www.FeedBurner.com),gzip(gfe),gzip(gfe)
74.125.44.136 - - [22/Jan/2010:00:46:25 -0800] HEAD / HTTP/1.1 405
124 - FeedBurner/1.0 (http://www.FeedBurner.com),gzip(gfe),gzip(gfe)

What exactly does this mean, I can see that I get a 405 response but
why? This is not logged as an error, it's loggen under requests
only.

Any ideas?

Magnus

-- 
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-appeng...@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: Problem figuring our the logs

2010-01-22 Thread Magnus O.
Hi Nick,

From the logs it seems like the path is / (the root of my domain)
and in the handler for that path I have:

def main():
application = webapp.WSGIApplication([('/.*',
MainController)],debug=True)
wsgiref.handlers.CGIHandler().run(application)

So I guess anything I throw at this handler should be ok? How can
someone get a 405?

Magnus

On Jan 22, 2:38 pm, Nick Johnson (Google) nick.john...@google.com
wrote:
 Hi Magnus,

 405 is Method not allowed. It generally occurs when you are using a
 framework such as webapp that requires you to define each method you want to
 be supported, and a client attempts to request a page with an unsupported
 method.

 A quick and easy way to eliminate this issue for your app is to add this to
 your base handler:

 ---
   def head(self, *args, **kwargs):
     self.get(*args, **kwargs)
     self.response.clear()
 ---

 -Nick Johnson

 On Fri, Jan 22, 2010 at 1:31 PM, Magnus O. 





 magnus.ottos...@magnusottosson.se wrote:
  Hi,

  On the dashboard for my application I see that I have several errors
  on the path /. When I click on the link I can see the following in
  the log:

  01-22 12:46AM 25.130 / 405 10ms 9cpu_ms 0kb FeedBurner/1.0 (http://
 www.FeedBurner.com),gzip(gfe),gzip(gfe)
  74.125.44.136 - - [22/Jan/2010:00:46:25 -0800] HEAD / HTTP/1.1 405
  124 - FeedBurner/1.0 (http://www.FeedBurner.com),gzip(gfe),gzip(gfe)

  What exactly does this mean, I can see that I get a 405 response but
  why? This is not logged as an error, it's loggen under requests
  only.

  Any ideas?

  Magnus

  --
  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-appeng...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine+unsubscr...@googlegroups.comgoogle-appengine%2Bunsubscrib 
  e...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-appengine?hl=en.

 --
 Nick Johnson, Developer Programs Engineer, App Engine
 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
 368047

-- 
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-appeng...@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: Problem figuring our the logs

2010-01-22 Thread Magnus O.
Ah ok, now I get it. The feedburner bot propably just requests the
head method to validate if the page exists. I will add the head
methods as you described.

Thank you!

Magnus

On Jan 22, 3:46 pm, Nick Johnson (Google) nick.john...@google.com
wrote:
 Hi,

 On Fri, Jan 22, 2010 at 2:42 PM, Magnus O. 

 magnus.ottos...@magnusottosson.se wrote:
  Hi Nick,

  From the logs it seems like the path is / (the root of my domain)
  and in the handler for that path I have:

  def main():
         application = webapp.WSGIApplication([('/.*',
  MainController)],debug=True)
         wsgiref.handlers.CGIHandler().run(application)

 This isn't the handler - it's the code that invokes the handler. The handler
 is 'MainController', and if it doesn't define a 'head()' method, any HTTP
 HEAD requests will fail for it.

 -Nick Johnson







  So I guess anything I throw at this handler should be ok? How can
  someone get a 405?

  Magnus

  On Jan 22, 2:38 pm, Nick Johnson (Google) nick.john...@google.com
  wrote:
   Hi Magnus,

   405 is Method not allowed. It generally occurs when you are using a
   framework such as webapp that requires you to define each method you want
  to
   be supported, and a client attempts to request a page with an unsupported
   method.

   A quick and easy way to eliminate this issue for your app is to add this
  to
   your base handler:

   ---
     def head(self, *args, **kwargs):
       self.get(*args, **kwargs)
       self.response.clear()
   ---

   -Nick Johnson

   On Fri, Jan 22, 2010 at 1:31 PM, Magnus O. 

   magnus.ottos...@magnusottosson.se wrote:
Hi,

On the dashboard for my application I see that I have several errors
on the path /. When I click on the link I can see the following in
the log:

01-22 12:46AM 25.130 / 405 10ms 9cpu_ms 0kb FeedBurner/1.0 (http://
   www.FeedBurner.com),gzip(gfe),gzip(gfe)
74.125.44.136 - - [22/Jan/2010:00:46:25 -0800] HEAD / HTTP/1.1 405
124 - FeedBurner/1.0 (http://www.FeedBurner.com),gzip(gfe),gzip(gfe)

What exactly does this mean, I can see that I get a 405 response but
why? This is not logged as an error, it's loggen under requests
only.

Any ideas?

Magnus

--
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.comgoogle-appengine%2Bunsubscrib
 e...@googlegroups.comgoogle-appengine%2Bunsubscrib
  e...@googlegroups.com
.
For more options, visit this group at
   http://groups.google.com/group/google-appengine?hl=en.

   --
   Nick Johnson, Developer Programs Engineer, App Engine
   Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
  Number:
   368047

  --
  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-appeng...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine+unsubscr...@googlegroups.comgoogle-appengine%2Bunsubscrib 
  e...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-appengine?hl=en.

 --
 Nick Johnson, Developer Programs Engineer, App Engine
 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
 368047

-- 
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-appeng...@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] URGENT! I cannot enable billing

2010-01-18 Thread Magnus O.
Hi,

My application just reached the free billig qouta and has been
disabled. I tried to enable the billig and waited about 25 minutes for
it to be activated. After I waited 25 minutes the account went from
being activated to free.

Why hasn't my quouta been release and why is the account labeled as
free?

//Magnus
-- 
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-appeng...@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: URGENT! I cannot enable billing

2010-01-18 Thread Magnus O.
The billing has now started. I just had to wait a bit...

On 18 Jan, 20:31, Magnus O. magnus.ottos...@magnusottosson.se
wrote:
 Hi,

 My application just reached the free billig qouta and has been
 disabled. I tried to enable the billig and waited about 25 minutes for
 it to be activated. After I waited 25 minutes the account went from
 being activated to free.

 Why hasn't my quouta been release and why is the account labeled as
 free?

 //Magnus
-- 
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-appeng...@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: Long Response times?

2009-11-30 Thread Magnus O.
It will gzip if I set the content type to text/xml instead of
application/xml. So that's good enough :)

About the latency you might be right that it is a geographic latency
issue. I compared it to the static files and they take about the same
time to load.

Thanks!

Are the servers of app engine all hosted in the US? There is
geographic spread of the servers so the client always will send the
request to a geographic close server? That would have been awesome!

//Magnus

On Nov 30, 9:08 pm, Ikai L (Google) ika...@google.com wrote:
 Interesting, I just checked that link and it is not coming back in gzip
 format. Have you seen that it will gzip if you change the format to plain
 text?

 On Mon, Nov 30, 2009 at 12:07 PM, Ikai L (Google) ika...@google.com wrote:



  Where are you seeing that the content is not gzipped? Your client has to
  specify that it can accept gzip.

  As far as your client side results go, this could simply be a result of
  geographic latency. The 95ms is the time it takes to render the page, and
  what you are seeing in Firebug is the full round trip time.

  On Thu, Nov 26, 2009 at 12:11 AM, Magnus O. 
  magnus.ottos...@magnusottosson.se wrote:

  I did some profiling and this is the results:

  I used this url as reference:
 http://blirdetsol.appspot.com/api/?lat=57.34145354230627;lon=113.6080...

  Using the logging tool in python it seems like this request takes 95ms
  to handle on the server:

  11-26 12:02AM 52.792 /api/?
  lat=57.34145354230627;lon=113.608098 200 95ms 96cpu_ms 66kb
  Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/
  20091102 Firefox/3.5.5,gzip(gfe)
  212.247.53.124 - - [26/Nov/2009:00:02:52 -0800] GET /api/?
  lat=57.34145354230627;lon=113.608098 HTTP/1.1 200 66326 -
  Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/
  20091102 Firefox/3.5.5,gzip(gfe) blirdetsol.appspot.com

  11-26 12:02AM 52.863 Start api main function
  11-26 12:02AM 52.866 Start api response handling
  11-26 12:02AM 52.880 Returned content from mechached

  Firebug told me the following data about the same request:

  DNS Lookup: 0ms
  Connecting: 0ms
  Queuing: 0ms
  Waiting for response: 244ms
  Recieving data: 253ms

  These numbers are actually pretty good but what is it that makes the
  server to take 244ms before it actually sends any data to the client
  when the request only took 95ms to handle?

  Another question a little bit off topic, why is this response not
  gzipped? From searching I found that it seems like xml content is not
  gzipped, why?

  //Magnus

  On Nov 24, 7:20 pm, Ikai L (Google) ika...@google.com wrote:
   Are you measuring the request from the client side or the server side?
  What
   do your server logs say?

   When it comes to client side optimizations, there are a ton of things
  you
   can do to improve the performance. What you'll want to do is benchmark
  on
   the server using the admin console, then do benchmarking on the client
  side
   using a tool such as YSlow:

  http://developer.yahoo.com/yslow/

   This will tell you if you need to set cache headers, minify JavaScript,
  etc.
   Can you post some numbers from both the server and the client?

   On Tue, Nov 24, 2009 at 12:14 AM, Magnus O. 

   magnus.ottos...@magnusottosson.se wrote:
Hi!,

I feel it's slow in both the development environment and live. I have
run some profiling on the site with firebug and I can see that the
waiting for response part on all request to script handlers is about
800ms. This seems like a very long time. The site I have developed is
a weather service and I fetcht the weather data using ajax requests. I
takes a few requests to load all the weather.

In a test it took 24 requests to load all the weatherdata and the load
time for this was 13.24 seconds. This is a long time to fetch these
request. About 99% of this time is waiting for response. I'm using
memcached to cache the response using this code:

import cgi
import urllib
import wsgiref.handlers
from google.appengine.ext import webapp
from google.appengine.api import urlfetch
from google.appengine.api import memcache

class YrController(webapp.RequestHandler):

       def get(self):
               self.response.headers['Content-Type'] =
  application/xml

               endpoint = '
   http://api.yr.no/weatherapi/locationforecast/1.6/'

               params = self.request.GET
               apiquery = urllib.urlencode(params)

               weather = memcache.get(apiquery)

               if weather is not None:
                       self.response.out.write(weather)
                       return
               else:

                       result = urlfetch.fetch(url=endpoint + '?' +
apiquery,
method=urlfetch.GET)
                       memcache.add(key=apiquery,
  value=result.content,
time=3600

[google-appengine] Re: Long Response times?

2009-11-26 Thread Magnus O.
I did some profiling and this is the results:

I used this url as reference: 
http://blirdetsol.appspot.com/api/?lat=57.34145354230627;lon=113.608098

Using the logging tool in python it seems like this request takes 95ms
to handle on the server:

11-26 12:02AM 52.792 /api/?
lat=57.34145354230627;lon=113.608098 200 95ms 96cpu_ms 66kb
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/
20091102 Firefox/3.5.5,gzip(gfe)
212.247.53.124 - - [26/Nov/2009:00:02:52 -0800] GET /api/?
lat=57.34145354230627;lon=113.608098 HTTP/1.1 200 66326 -
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/
20091102 Firefox/3.5.5,gzip(gfe) blirdetsol.appspot.com

11-26 12:02AM 52.863 Start api main function
11-26 12:02AM 52.866 Start api response handling
11-26 12:02AM 52.880 Returned content from mechached

Firebug told me the following data about the same request:

DNS Lookup: 0ms
Connecting: 0ms
Queuing: 0ms
Waiting for response: 244ms
Recieving data: 253ms


These numbers are actually pretty good but what is it that makes the
server to take 244ms before it actually sends any data to the client
when the request only took 95ms to handle?

Another question a little bit off topic, why is this response not
gzipped? From searching I found that it seems like xml content is not
gzipped, why?

//Magnus

On Nov 24, 7:20 pm, Ikai L (Google) ika...@google.com wrote:
 Are you measuring the request from the client side or the server side? What
 do your server logs say?

 When it comes to client side optimizations, there are a ton of things you
 can do to improve the performance. What you'll want to do is benchmark on
 the server using the admin console, then do benchmarking on the client side
 using a tool such as YSlow:

 http://developer.yahoo.com/yslow/

 This will tell you if you need to set cache headers, minify JavaScript, etc.
 Can you post some numbers from both the server and the client?

 On Tue, Nov 24, 2009 at 12:14 AM, Magnus O. 





 magnus.ottos...@magnusottosson.se wrote:
  Hi!,

  I feel it's slow in both the development environment and live. I have
  run some profiling on the site with firebug and I can see that the
  waiting for response part on all request to script handlers is about
  800ms. This seems like a very long time. The site I have developed is
  a weather service and I fetcht the weather data using ajax requests. I
  takes a few requests to load all the weather.

  In a test it took 24 requests to load all the weatherdata and the load
  time for this was 13.24 seconds. This is a long time to fetch these
  request. About 99% of this time is waiting for response. I'm using
  memcached to cache the response using this code:

  import cgi
  import urllib
  import wsgiref.handlers
  from google.appengine.ext import webapp
  from google.appengine.api import urlfetch
  from google.appengine.api import memcache

  class YrController(webapp.RequestHandler):

         def get(self):
                 self.response.headers['Content-Type'] = application/xml

                 endpoint = '
 http://api.yr.no/weatherapi/locationforecast/1.6/'

                 params = self.request.GET
                 apiquery = urllib.urlencode(params)

                 weather = memcache.get(apiquery)

                 if weather is not None:
                         self.response.out.write(weather)
                         return
                 else:

                         result = urlfetch.fetch(url=endpoint + '?' +
  apiquery,
  method=urlfetch.GET)
                         memcache.add(key=apiquery, value=result.content,
  time=3600)
                         self.response.out.write(result.content)

  def main():
         application = webapp.WSGIApplication([('/api/',
  YrController)],debug=True)
          wsgiref.handlers.CGIHandler().run(application)

  if __name__ == __main__:
         main()

  This handler works like a proxy server against a xml api. I can
  understand that it takes some time to load when the data is fetched
  from the api but once the data is in memcached it should not take
  800ms for the server to handle the response. This webbapp used to be
  written in ASP .NET also using memcached and there the average
  waiting for response time for a request is about 100ms.

  I will run some profiling on the handler and see what it is that takes
  time. Or could anyone else se what it is? Anyway I could optimize this
  for shorter load times?

  //Magnus

  On Nov 24, 12:45 am, Ikai L (Google) ika...@google.com wrote:
   What part of this application is slow? Is it just slow in development
  mode?
   The link you sent out seems to load reasonably fast.

   What may be happening is that your application may be cycling out. We do
   this to dynamically adjust the number of instances to match the level of
   load your application is experiencing. If your application is cycled out,
   when a request comes in, we cycle it back in, but to do this, we need to
   load

[google-appengine] Re: Long Response times?

2009-11-24 Thread Magnus O.
Hi!,

I feel it's slow in both the development environment and live. I have
run some profiling on the site with firebug and I can see that the
waiting for response part on all request to script handlers is about
800ms. This seems like a very long time. The site I have developed is
a weather service and I fetcht the weather data using ajax requests. I
takes a few requests to load all the weather.

In a test it took 24 requests to load all the weatherdata and the load
time for this was 13.24 seconds. This is a long time to fetch these
request. About 99% of this time is waiting for response. I'm using
memcached to cache the response using this code:

import cgi
import urllib
import wsgiref.handlers
from google.appengine.ext import webapp
from google.appengine.api import urlfetch
from google.appengine.api import memcache

class YrController(webapp.RequestHandler):

def get(self):
self.response.headers['Content-Type'] = application/xml

endpoint = 'http://api.yr.no/weatherapi/locationforecast/1.6/'

params = self.request.GET
apiquery = urllib.urlencode(params)

weather = memcache.get(apiquery)

if weather is not None:
self.response.out.write(weather)
return
else:

result = urlfetch.fetch(url=endpoint + '?' + apiquery,
method=urlfetch.GET)
memcache.add(key=apiquery, value=result.content, 
time=3600)
self.response.out.write(result.content)

def main():
application = webapp.WSGIApplication([('/api/',
YrController)],debug=True)
wsgiref.handlers.CGIHandler().run(application)

if __name__ == __main__:
main()



This handler works like a proxy server against a xml api. I can
understand that it takes some time to load when the data is fetched
from the api but once the data is in memcached it should not take
800ms for the server to handle the response. This webbapp used to be
written in ASP .NET also using memcached and there the average
waiting for response time for a request is about 100ms.

I will run some profiling on the handler and see what it is that takes
time. Or could anyone else se what it is? Anyway I could optimize this
for shorter load times?

//Magnus

On Nov 24, 12:45 am, Ikai L (Google) ika...@google.com wrote:
 What part of this application is slow? Is it just slow in development mode?
 The link you sent out seems to load reasonably fast.

 What may be happening is that your application may be cycling out. We do
 this to dynamically adjust the number of instances to match the level of
 load your application is experiencing. If your application is cycled out,
 when a request comes in, we cycle it back in, but to do this, we need to
 load your environment and fire up an application instance.

 On Sat, Nov 21, 2009 at 7:29 AM, Magnus O. 





 magnus.ottos...@magnusottosson.se wrote:
  Hi,

  I just started developing with python and google app engine and my
  first project is to build a small easy proxy server to enable cross
  domain xml requests from the client. I'm experiencing logn response
  times in all python handlers. Static files as being served fast but
  python handlers are loading slow 800ms - 1.5 seconds. For instance,
  here is my default page that (for now) just loads an index.html static
  file as template:

  import cgi
  import urllib
  import os
  import wsgiref.handlers
  from google.appengine.ext import webapp
  from google.appengine.api import urlfetch
  from google.appengine.ext.webapp import template

  class MainController(webapp.RequestHandler):

         def get(self):

                 template_values = {}

                 path = os.path.join(os.path.dirname(__file__), 'index.html')
                 self.response.out.write(template.render(path,
  template_values))

  def main():
         application = webapp.WSGIApplication([('/',
  MainController)],debug=True)
         wsgiref.handlers.CGIHandler().run(application)

  if __name__ == __main__:
         main()

  Anyone that can tell me why the load times are so slow? You can see it
  in action here:http://blirdetsol.appspot.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-appeng...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine+unsubscr...@googlegroups.comgoogle-appengine%2Bunsubscrib 
  e...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-appengine?hl=.

 --
 Ikai Lan
 Developer Programs Engineer, Google App Engine

--

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-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr

[google-appengine] Long Response times?

2009-11-23 Thread Magnus O.
Hi,

I just started developing with python and google app engine and my
first project is to build a small easy proxy server to enable cross
domain xml requests from the client. I'm experiencing logn response
times in all python handlers. Static files as being served fast but
python handlers are loading slow 800ms - 1.5 seconds. For instance,
here is my default page that (for now) just loads an index.html static
file as template:

import cgi
import urllib
import os
import wsgiref.handlers
from google.appengine.ext import webapp
from google.appengine.api import urlfetch
from google.appengine.ext.webapp import template

class MainController(webapp.RequestHandler):

def get(self):

template_values = {}

path = os.path.join(os.path.dirname(__file__), 'index.html')
self.response.out.write(template.render(path, template_values))

def main():
application = webapp.WSGIApplication([('/',
MainController)],debug=True)
wsgiref.handlers.CGIHandler().run(application)

if __name__ == __main__:
main()




Anyone that can tell me why the load times are so slow? You can see it
in action here: http://blirdetsol.appspot.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-appeng...@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=.




[google-appengine] Re: Request Greater Index Quota?

2009-08-27 Thread O

Ok, I emailed you.  Thanks

On Aug 25, 7:43 pm, Jeff S (Google) j...@google.com wrote:
 Hi O,

 I've reset the index count quota and error out the indexes which were stuck
 in the building state. It does look like you have quite a few indexes, how
 many do you anticipate needing? It is usually no problem to increase the
 number of index for an app, though there is an upper limit which no one has
 hit yet to my knowledge. I'm curious if there is a way to reduce the number
 of indexes for your app or possibly restructure a few queries to remove the
 need for some of these indexes. The reason I advocate reducing indexes in
 general is that they can make writes to the datastore more expensive when a
 large number of indexes are involved. Feel free to email me privately if you
 don't feel comfortable discussing on the group.

 Thank you,

 Jeff

 On Tue, Aug 25, 2009 at 2:25 PM, O obisho...@gmail.com wrote:

  When I upload (ogweb.appspot.com), I get the error 500 message.  I
  searched here, and it seems that error is related to the index quota.
  I do have a lot of indexes.  How do I request a greater index quota?
  Thanks.
--~--~-~--~~~---~--~~
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] Request Greater Index Quota?

2009-08-25 Thread O

When I upload (ogweb.appspot.com), I get the error 500 message.  I
searched here, and it seems that error is related to the index quota.
I do have a lot of indexes.  How do I request a greater index quota?
Thanks.

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