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 <[email protected]> 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 <[email protected]> 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 <[email protected]>:
>
> > > 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---