[google-appengine] Re: Static file access for reading custom configuration file
You must not put this yaml file in a directory for static content. You can't open these static files with python/java code 2009/8/2 VKM : > > Hi, > > I am writing a yaml configuration file for my application. This config > file will contain few static settings (eg. drop down menu options). I > may need to add or remove few options from the menu so in that case I > will just need to change my yaml file and upload the app and changes > will reflect. > > But when I read the file, it gives error: file not accessible. I saw > the warning messages and it says: dev_appserver.py Blocking access to > static file ... > > Can any body give me solution for this! How to read a static file, > like a config file. Do I need to do chances in my app.yaml file? > > Thanks > > Regards, > VKM > > > > --~--~-~--~~~---~--~~ 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: Static file access for reading custom configuration file
Hi Could you tell me then how to use my custom Yaml file for application settings? One simple way is to have a new python file with settings stored as dic or list etc and import it in main program. But that is not the good way. I want to give access of Yaml file to my clients so that they can modify the file and can update the content without worrying about Python code. Regards, VKM On Aug 4, 4:50 pm, djidjadji wrote: > You must not put this yaml file in a directory for static content. > You can't open these static files with python/java code > > 2009/8/2 VKM : > > > > > Hi, > > > I am writing a yaml configuration file for my application. This config > > file will contain few static settings (eg. drop down menu options). I > > may need to add or remove few options from the menu so in that case I > > will just need to change my yaml file and upload the app and changes > > will reflect. > > > But when I read the file, it gives error: file not accessible. I saw > > the warning messages and it says: dev_appserver.py Blocking access to > > static file ... > > > Can any body give me solution for this! How to read a static file, > > like a config file. Do I need to do chances in my app.yaml file? > > > Thanks > > > Regards, > > VKM --~--~-~--~~~---~--~~ 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: Static file access for reading custom configuration file
> I want to give access of Yaml file to my clients To my knowledge that's impossible and that wouldn't be a good idea as the app.yaml file can contain security settings you don't want your clients able to change, for example: - url: /remote_api script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py login: admin So you have to use the other method you've described. --~--~-~--~~~---~--~~ 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: Static file access for reading custom configuration file
You can define you own yaml file. and then read it directly (by the way you can't from code, access app.yaml or index.yaml) Do something like this from yaml import load def loadSettings(settings='settings.yaml'): settings = load(open(settings,'r').read())) return settings mysettings = loadSettings() You probably want to cache this either in a module or memcache so you don't have to reread it all the time. Rgds Tim On Aug 6, 10:33 am, VKM wrote: > Hi > > Could you tell me then how to use my custom Yaml file for application > settings? One simple way is to have a new python file with settings > stored as dic or list etc and import it in main program. But that is > not the good way. I want to give access of Yaml file to my clients so > that they can modify the file and can update the content without > worrying about Python code. > > Regards, > VKM > > On Aug 4, 4:50 pm, djidjadji wrote: > > > You must not put this yaml file in a directory for static content. > > You can't open these static files with python/java code > > > 2009/8/2 VKM : > > > > Hi, > > > > I am writing a yaml configuration file for my application. This config > > > file will contain few static settings (eg. drop down menu options). I > > > may need to add or remove few options from the menu so in that case I > > > will just need to change my yaml file and upload the app and changes > > > will reflect. > > > > But when I read the file, it gives error: file not accessible. I saw > > > the warning messages and it says: dev_appserver.py Blocking access to > > > static file ... > > > > Can any body give me solution for this! How to read a static file, > > > like a config file. Do I need to do chances in my app.yaml file? > > > > Thanks > > > > Regards, > > > VKM --~--~-~--~~~---~--~~ 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: Static file access for reading custom configuration file
the yaml file must be next to the python files and not marked as static in app.yaml How do you want to let the client upload the yaml file. If that is with an html form then you must store the file in the datastore 2009/8/6 Tim Hoffman : > > You can define you own yaml file. and then read it directly (by the > way you can't from code, access > app.yaml or index.yaml) > > Do something like this > > from yaml import load > > def loadSettings(settings='settings.yaml'): > > settings = load(open(settings,'r').read())) > > return settings > > mysettings = loadSettings() > > You probably want to cache this either in a module or memcache so you > don't have to reread it all the time. > > Rgds > > Tim > > > On Aug 6, 10:33 am, VKM wrote: >> Hi >> >> Could you tell me then how to use my custom Yaml file for application >> settings? One simple way is to have a new python file with settings >> stored as dic or list etc and import it in main program. But that is >> not the good way. I want to give access of Yaml file to my clients so >> that they can modify the file and can update the content without >> worrying about Python code. >> >> Regards, >> VKM >> >> On Aug 4, 4:50 pm, djidjadji wrote: >> >> > You must not put this yaml file in a directory for static content. >> > You can't open these static files with python/java code >> >> > 2009/8/2 VKM : >> >> > > Hi, >> >> > > I am writing a yaml configuration file for my application. This config >> > > file will contain few static settings (eg. drop down menu options). I >> > > may need to add or remove few options from the menu so in that case I >> > > will just need to change my yaml file and upload the app and changes >> > > will reflect. >> >> > > But when I read the file, it gives error: file not accessible. I saw >> > > the warning messages and it says: dev_appserver.py Blocking access to >> > > static file ... >> >> > > Can any body give me solution for this! How to read a static file, >> > > like a config file. Do I need to do chances in my app.yaml file? >> >> > > Thanks >> >> > > Regards, >> > > VKM > > > --~--~-~--~~~---~--~~ 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: Static file access for reading custom configuration file
Hi thanks for the reply. I want my users to change the settings in yaml file (like settings.yaml) as and when they require and click on a button to let us know that the user wants updates to be committed. Once that update signal comes to us, a shell script can update the application on GAE. Btw, I tried reading yaml file using open but I put that file in static folder and it showed blocked error. Tim can you tell me where this settings.yaml file should be stored? Should it be stored along with other python scripts i.e. at root level? Could you please give little more explaination. Regards, VKM On Aug 7, 12:36 am, djidjadji wrote: > the yamlfilemust be next to the python files and not marked asstaticin > app.yaml > > How do you want to let the client upload the yamlfile. If that is > with an html form then you must store thefilein the datastore > > 2009/8/6 Tim Hoffman : > > > > > You can define you own yamlfile. and then read it directly (by the > > way you can't from code, access > > app.yaml or index.yaml) > > > Do something like this > > > from yaml import load > > > def loadSettings(settings='settings.yaml'): > > > settings = load(open(settings,'r').read())) > > > return settings > > > mysettings = loadSettings() > > > You probably want to cache this either in a module or memcache so you > > don't have to reread it all the time. > > > Rgds > > > Tim > > > On Aug 6, 10:33 am, VKM wrote: > >> Hi > > >> Could you tell me then how to use my custom Yamlfilefor application > >> settings? One simple way is to have a new pythonfilewith settings > >> stored as dic or list etc and import it in main program. But that is > >> not the good way. I want to give access of Yamlfileto my clients so > >> that they can modify thefileand can update the content without > >> worrying about Python code. > > >> Regards, > >> VKM > > >> On Aug 4, 4:50 pm, djidjadji wrote: > > >> > You must not put this yamlfilein a directory forstaticcontent. > >> > You can't open thesestaticfiles with python/java code > > >> > 2009/8/2 VKM : > > >> > > Hi, > > >> > > I am writing a yaml configurationfilefor my application. This config > >> > >filewill contain fewstaticsettings (eg. drop down menu options). I > >> > > may need to add or remove few options from the menu so in that case I > >> > > will just need to change my yamlfileand upload the app and changes > >> > > will reflect. > > >> > > But when I read thefile, it gives error:filenot accessible. I saw > >> > > the warning messages and it says: dev_appserver.py Blocking access to > >> > >staticfile... > > >> > > Can any body give me solution for this! How to read astaticfile, > >> > > like a configfile. Do I need to do chances in my app.yamlfile? > > >> > > Thanks > > >> > > Regards, > >> > > VKM --~--~-~--~~~---~--~~ 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: Static file access for reading custom configuration file
Ok, its working now. Thanks Tim. I just put file along with other python files and it worked. Thanks, Regards, VKM On Aug 8, 1:41 pm, VKM wrote: > Hi thanks for the reply. > > I want my users to change the settings in yamlfile(like > settings.yaml) as and when they require and click on a button to let > us know that the user wants updates to be committed. Once that update > signal comes to us, a shell script can update the application on GAE. > > Btw, I tried reading yamlfileusing open but I put thatfileinstaticfolder and > it showed blocked error. Tim can you tell me where > this settings.yamlfileshould be stored? Should it be stored along > with other python scripts i.e. at root level? Could you please give > little more explaination. > > Regards, > VKM > > On Aug 7, 12:36 am, djidjadji wrote: > > > the yamlfilemust be next to the python files and not marked asstaticin > > app.yaml > > > How do you want to let the client upload the yamlfile. If that is > > with an html form then you must store thefilein the datastore > > > 2009/8/6 Tim Hoffman : > > > > You can define you own yamlfile. and then read it directly (by the > > > way you can't from code, access > > > app.yaml or index.yaml) > > > > Do something like this > > > > from yaml import load > > > > def loadSettings(settings='settings.yaml'): > > > > settings = load(open(settings,'r').read())) > > > > return settings > > > > mysettings = loadSettings() > > > > You probably want to cache this either in a module or memcache so you > > > don't have to reread it all the time. > > > > Rgds > > > > Tim > > > > On Aug 6, 10:33 am, VKM wrote: > > >> Hi > > > >> Could you tell me then how to use my custom Yamlfilefor application > > >> settings? One simple way is to have a new pythonfilewith settings > > >> stored as dic or list etc and import it in main program. But that is > > >> not the good way. I want to give access of Yamlfileto my clients so > > >> that they can modify thefileand can update the content without > > >> worrying about Python code. > > > >> Regards, > > >> VKM > > > >> On Aug 4, 4:50 pm, djidjadji wrote: > > > >> > You must not put this yamlfilein a directory forstaticcontent. > > >> > You can't open thesestaticfiles with python/java code > > > >> > 2009/8/2 VKM : > > > >> > > Hi, > > > >> > > I am writing a yaml configurationfilefor my application. This config > > >> > >filewill contain fewstaticsettings (eg. drop down menu options). I > > >> > > may need to add or remove few options from the menu so in that case I > > >> > > will just need to change my yamlfileand upload the app and changes > > >> > > will reflect. > > > >> > > But when I read thefile, it gives error:filenot accessible. I saw > > >> > > the warning messages and it says: dev_appserver.py Blocking access to > > >> > >staticfile... > > > >> > > Can any body give me solution for this! How to read astaticfile, > > >> > > like a configfile. Do I need to do chances in my app.yamlfile? > > > >> > > Thanks > > > >> > > Regards, > > >> > > VKM --~--~-~--~~~---~--~~ 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: Static file access for reading custom configuration file
You know yo would be far better off having your yaml file (or the definitions) defined as an entity in the datastore and then you users could just upload new versions Which means you don't need to do deployments all the time T On Aug 8, 4:47 pm, VKM wrote: > Ok, its working now. Thanks Tim. I just put file along with other > python files and it worked. > > Thanks, > > Regards, > VKM > > On Aug 8, 1:41 pm, VKM wrote: > > > Hi thanks for the reply. > > > I want my users to change the settings in yamlfile(like > > settings.yaml) as and when they require and click on a button to let > > us know that the user wants updates to be committed. Once that update > > signal comes to us, a shell script can update the application on GAE. > > > Btw, I tried reading yamlfileusing open but I put thatfileinstaticfolder > > and it showed blocked error. Tim can you tell me where > > this settings.yamlfileshould be stored? Should it be stored along > > with other python scripts i.e. at root level? Could you please give > > little more explaination. > > > Regards, > > VKM > > > On Aug 7, 12:36 am, djidjadji wrote: > > > > the yamlfilemust be next to the python files and not marked asstaticin > > > app.yaml > > > > How do you want to let the client upload the yamlfile. If that is > > > with an html form then you must store thefilein the datastore > > > > 2009/8/6 Tim Hoffman : > > > > > You can define you own yamlfile. and then read it directly (by the > > > > way you can't from code, access > > > > app.yaml or index.yaml) > > > > > Do something like this > > > > > from yaml import load > > > > > def loadSettings(settings='settings.yaml'): > > > > > settings = load(open(settings,'r').read())) > > > > > return settings > > > > > mysettings = loadSettings() > > > > > You probably want to cache this either in a module or memcache so you > > > > don't have to reread it all the time. > > > > > Rgds > > > > > Tim > > > > > On Aug 6, 10:33 am, VKM wrote: > > > >> Hi > > > > >> Could you tell me then how to use my custom Yamlfilefor application > > > >> settings? One simple way is to have a new pythonfilewith settings > > > >> stored as dic or list etc and import it in main program. But that is > > > >> not the good way. I want to give access of Yamlfileto my clients so > > > >> that they can modify thefileand can update the content without > > > >> worrying about Python code. > > > > >> Regards, > > > >> VKM > > > > >> On Aug 4, 4:50 pm, djidjadji wrote: > > > > >> > You must not put this yamlfilein a directory forstaticcontent. > > > >> > You can't open thesestaticfiles with python/java code > > > > >> > 2009/8/2 VKM : > > > > >> > > Hi, > > > > >> > > I am writing a yaml configurationfilefor my application. This > > > >> > > config > > > >> > >filewill contain fewstaticsettings (eg. drop down menu options). I > > > >> > > may need to add or remove few options from the menu so in that > > > >> > > case I > > > >> > > will just need to change my yamlfileand upload the app and changes > > > >> > > will reflect. > > > > >> > > But when I read thefile, it gives error:filenot accessible. I saw > > > >> > > the warning messages and it says: dev_appserver.py Blocking access > > > >> > > to > > > >> > >staticfile... > > > > >> > > Can any body give me solution for this! How to read astaticfile, > > > >> > > like a configfile. Do I need to do chances in my app.yamlfile? > > > > >> > > Thanks > > > > >> > > Regards, > > > >> > > VKM --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---