[google-appengine] How to access normal files in google App engine
Hi, I am a developing a web application which has no database but instead uses some text files(.txt) as a data store. While running on my local machine, I am able to access the folder which has these files (the folder is in my application directory). However, when I upload my application to the app engine server, I am denied permission to access this folder and files. I have tried using os.chmod to change permissions but still nothing works. What could be the problem? -Vaswani --~--~-~--~~~---~--~~ 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 access normal files in google App engine
Hi TIm and Konrad, Thanks for your reply. Ok, Here is the problem in a bit more detail. When I have a single (or more) text file/s in my application directory, appcfg.py uploads the files but if I have a folder inside my application directory it ignores that folder while updating unless I have specified it at static_dir in app.yaml. So my question is How can we upload a directory without specifying it in the app.yaml. Regards Vaswani On Fri, Apr 10, 2009 at 10:09 AM, Tim Hoffman wrote: > > Hi > > You can read files but they must be in you appengine application > directory or a subdirectory. > of it and then uploaded when you deploy > > You can't chmod and there is no need to. > > Also these files shouldn't be accessible through the static files > directive in app.yaml (I believe) > > T > > > > On Apr 10, 12:49 pm, Vaswani wrote: > > Hi, > > > > I am a developing a web application which has no database but instead > > uses some text files(.txt) as a data store. While running on my local > > machine, I am able to access the folder which has these files (the > > folder is in my application directory). However, when I upload my > > application to the app engine server, I am denied permission to access > > this folder and files. > > > > I have tried using os.chmod to change permissions but still nothing > > works. > > What could be the problem? > > > > -Vaswani > > > --~--~-~--~~~---~--~~ 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 access normal files in google App engine
Hi Tim and Konrad, I understand that the ideal way to work with data is to use google data storage. But given some data constraints on my side for now, I have postponed the usage of data storage by a month. I retract my earlier statement that 'appcfg.py update' ignores some files. I probably didn't see the entire noisy messages. The files were getting uploaded but I was not allowed to access them through my script. Its actually strange if I had a small file in the application directory, I was able to access it but if I had folder (with my data files) in the application directory, the permission was denied. Anyway, I need to understand the idiosyncrasies of distributed data network in more detail. But for now I have found a not so sweet solution. I have converted each of my data files into python objects and put in individual small size files (.py) and importing them on demand. It works sweetly now but definitely not a scalable solution. But is there a ways to delete the stuff you uploaded before which you don't need anymore. Regards Gopal On Fri, Apr 10, 2009 at 5:51 PM, Konrad Martin wrote: > > Hi Vaswani ant Tim > > On 11 Apr., 01:56, Tim Hoffman wrote: > > How do you know it is being ignored ? > > How could you know, that's my key question too, as to my knowledge > there is no way to `see` what's uploaded. > > When uploading my experience is you either get an error message or > everything in the root and its subfolders is uploaded, at least `not > uploaded data' never happened to me. > > > Programmig for a high scalable distributed network is just diffrerent. > Some simple tasks, taken for granted on a single machine, just don't > work there. It`s impossible to have a look on all your uploaded > folders for example. > > So working with appEngine you better try not to transfer existing > concepts but to build on small steps. Break up your program into small > steps and try each step on its own. If it's working on appEngine OK, > if not read appEngine docs and google for a working solution to reach > your target. > > To be more specific you need to copy code and error messages related > to your problem. > > Konrad > > > > --~--~-~--~~~---~--~~ 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: I've just found that the app.yaml file won't allow more than 100 handlers...
Hi Larry, I hope you are talking about the number of handlers in the handler script. Its strange that GAE does not allow more than 100 handlers. it should not be the case normally. Anyway, one way you can overcome this issue is to use regex groups to capture URL specific parameters and process the request based on the parameter. This should bring down the number of handlers as I am assuming that many of your urls would be similar. Vaswani On Tue, Apr 14, 2009 at 2:44 PM, Larry wrote: > > Hi > > I've just found that the app.yaml file won't allow more than 100 > handlers. I know this seems plenty but using handlers quite > conservatively I have found myself requiring slightly more than 100 > handlers for my forum. I could just map every URL into one handler and > have that search a dictionary for the correct class to handle the > request but that is rather irritating to recode. > > Are there any better plans? Should I file a bug report requesting a > larger number of handlers. I personally think it should be dynamic > (IE: not limited) or at least be mentioned in the documentation. I > could have avoided this situation had I known about the restriction. > > Thanks! > > Larry > > > --~--~-~--~~~---~--~~ 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: Dynamically generated templates
Looking at the implementation of Django admin module might help. I don't know exact details but for each data type (integer, String, list, date etc it has associated interface objects that it loads to depict the data in the correct controls. Vaswani On Mon, Apr 13, 2009 at 11:04 AM, adelevie wrote: > > Hi. I'm trying to build an a simple CRUD admin section of my > application. Basically, for a given Model, I want to have a template > loop through the model's attributes into a simple table (once I do > this, I can actually implement the CRUD part). A possible way to > accomplish this is to dynamically generate a template with all the > necessary template tags specific to that model. > > Pseudocode: > def generate_tamplate(model): > template.write("") > template.write("") > for attribute in model: > template.write("%s" % attribute) > template.write("") > template.write("") > for attribute in model: > template.write("{{ %s.%s }}" % model.attribute) > template.write("") > template.write("") > > Generating the proper text should not be difficult. I can follow my > pseudocode model and do it Python. Two things im wondering: > 1) Can I do this instead using Django's templating language? that is, > use a template to generate a template > 2) Once I generate the text, how can I wrote that to a file that > webapp's template loader can access? > > I remember a while back seeing something about loading template from > the database. Is this possible with GAE? > > 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] Re: database access by more than one application
Hi, Why can't you have different views for internal and external users in the same application. You can have different authentication for these views. Vaswani On Tue, Apr 14, 2009 at 2:38 PM, bamkraxler wrote: > > Can the database be accessed from more than one application? I would > like to have one application for external users and another for > internal users, both of which access the same database. Basically, > external users will add information to the database and internal users > will run reports, etc. I've looked everywhere on the Google App > Engine web site and cannot find any information on accessing the > database from more than one application. Many 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 -~--~~~~--~~--~--~---