On 13 дек, 21:45, Ben Bangert <[email protected]> wrote:

Thanks, for the answer Ben!

> What version of Beaker? Are you using the latest?

Yes, beaker 1.5.3. Also I'v update all packages (Paste, PasteScript,
Routes, WebError, PasteScript....)

> I would hope not, there's been lots of large deployments using db sessions. 
> Can you share your session configuration (minus the secret key of course) 
> info?

I can give you SSH to the server with the full access with the explain-
video (in the mail attach). Just send me a mail to the
a.zhabotinskiy[at]gmail.com.

Here is session

>>> pickle.loads(ses)
{'session': {'REMOTE_USER': 1, 'SELECTED_AGREM': u'718000',
'REMOTE_USER_IOSHORT': u'\u0410.\u041b.', 'CASHIER_CODE': 20,
'CASHIER_IP': u'172.16.1.10', 'SELECTED_CARD': u'2002/4754',
'_accessed_time': 1292302460.9694469, '_creation_time':
1292302449.0694289}}

#dev.ini

[app:main]
use = egg:myproj
full_stack = true
static_files = true

cache_enabled = false
cache_dir = %(here)s/data
fonts_dir = %(here)s/data/fonts

beaker.session.key = myproj
beaker.session.secret = somesecret
beaker.session.type = ext:database
beaker.session.sa.url = postgresql://........

#middleware

from beaker.middleware import CacheMiddleware, SessionMiddleware
from paste.cascade import Cascade
from paste.registry import RegistryManager
from paste.urlparser import StaticURLParser
from paste.deploy.converters import asbool
from pylons import config
from pylons.middleware import ErrorHandler, StatusCodeRedirect
from pylons.wsgiapp import PylonsApp
from routes.middleware import RoutesMiddleware

from myproj.config.environment import load_environment

def make_app(global_conf, full_stack=True, static_files=True,
**app_conf):
    """
    config = load_environment(global_conf, app_conf)

    # Configure the Pylons environment
    load_environment(global_conf, app_conf)

    # The Pylons WSGI app
    app = PylonsApp(config=config)

    # Routing/Session/Cache Middleware
    app = RoutesMiddleware(app, config['routes.map'])
    app = SessionMiddleware(app, config)
    app = CacheMiddleware(app, config)
    if asbool(full_stack):
        # Handle Python exceptions
        app = ErrorHandler(app, global_conf,
**config['pylons.errorware'])

        # Display error documents for 401, 403, 404 status codes (and
        # 500 when debug is disabled)
        if asbool(config['debug']):
            app = StatusCodeRedirect(app)
        else:
            app = StatusCodeRedirect(app, [400, 401, 403, 404, 500])

    # Establish the Registry for this application
    app = RegistryManager(app)

    if asbool(static_files):
        # Serve static files
        static_app = StaticURLParser(config['pylons.paths']
['static_files'])
        app = Cascade([static_app, app])

    app.config = config

    return app


> Switch to the following to avoid having to do the id is None check:

Ok, thanks.

> I don't see any reason that'd cause a problem. What kind of setup do you have 
> in production? Are you using any caching proxies (squid, varnish, 
> nginx/apache in certain modes) that could be inadvertently caching pages for 
> other sessions?

I'v start to teach Python through the Pylons May 2009. Project was
running October 2009. Of cource code is not perfect, and maybe some
parts must be better but...

1. Prodution is development.ini
2. Proxy was the first suspicion. I use the FireFox devel toolbar to
see the HTML header request. So, no squid, web-proxy. I'v also try to
run apache2 + mod_wsgi. I decided that it's not a web-server.
3. My project has no IE-support, so in the FF i'v turn off all cache
via about:config -> network.http.use-cache=false. Also I try to add
random numbers to the end of the url, like /someurl?786547523045

I hope this problem can be solved

Best regards,
Alexander

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.

Reply via email to