Python is "caching" it at the class level.
It looks like you are defining GetDomain.domain to os.environ['SERVER_NAME']
only once on its first usage per server instance.
a) Try using a property/function to return os.environ['SERVER_NAME']
or
b) use a class instance defined attribute such as
def __init__(self):
self.domain = os.environ['SERVER_NAME']
and instantiate for each server request.
On Mon, Jul 20, 2009 at 12:49 AM, PatHaugen <[email protected]> wrote:
>
> I have multiple domains pointed to Python code merely reporting the
> domain name as a test within a H1 tag in a Django template:
>
> <h1>{{ domain }}</h1>
>
> Python code:
>
> class GetDomain():
> domain = os.environ['SERVER_NAME']
> ...
> domain = GetDomain.domain
> template_values = {
> 'domain': domain,
> }
> path = os.path.join(os.path.dirname(__file__), 'index.html')
> self.response.out.write(template.render(path, template_values))
>
> The issue I'm having is possibly with GAE caching output and not
> processing each time the page is hit.
>
> Example domains:
> www.domain1.com
> www.domain2.com
> www.domain3.com
>
> When I visit any domain the first time, I get the expected result:
> <h1>www.domain3.com</h1>
>
> However for the next 5 or so minutes, going to www.domain1.com or
> www.domain2.com shows the SAME output:
> <h1>www.domain3.com</h1>
>
> GAE is caching the output possibly? What is going on causing this
> unexpected result in code that works properly?
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---