Re: Pylons with gzip compression?

2008-12-19 Thread Dalius Dobravolskas

Hi,

 I am beginning and I have one question about running Pylons(paster)
 v0.9.6 with gzip compression(for pages) How to do it? :)
Two ways:
1) Search for gzipmiddleware here:
http://pylonsbook.com/alpha1/wsgi

Actually it would be nice if this middleware were available in Pylons
by default. Maybe it is?

2) Serve behind apache and use apache's modules (mod_deflate);

-- 
Dalius
http://blog.sandbox.lt

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Flickr tutorial under 0.9.7?

2008-12-19 Thread Wichert Akkerman

Previously Matt Feifarek wrote:
 On Wed, Dec 17, 2008 at 6:19 PM, Ben Bangert b...@groovie.org wrote:
 
 
  I've updated the front page in the codebase which will soon be up at
  http://beta.pylonshq.com/, to properly reflect what's in Pylons 0.9.7.
  Should be deployed there shortly. I'm also getting most of the links fixed
  up so the site can be ready for launch with 0.9.7 final rather soon.
 
 
 Wow, Ben, the new site looks GREAT!
 
 Well done.

Indeed. And curious wants to know: is that a Pylons-powered CMS? It
looks like one..

Wichert.

-- 
Wichert Akkerman wich...@wiggy.netIt is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Pylons with gzip compression?

2008-12-19 Thread sniipe

thanks :) everything works :) In my opinion it should be implemented
by default :P

On 19 Gru, 09:14, Dalius Dobravolskas
dalius.dobravols...@gmail.com wrote:
 Hi,

  I am beginning and I have one question about running Pylons(paster)
  v0.9.6 with gzip compression(for pages) How to do it? :)

 Two ways:
 1) Search for gzipmiddleware here:http://pylonsbook.com/alpha1/wsgi

 Actually it would be nice if this middleware were available in Pylons
 by default. Maybe it is?

 2) Serve behind apache and use apache's modules (mod_deflate);

 --
 Daliushttp://blog.sandbox.lt
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Pylons with gzip compression?

2008-12-19 Thread Tomasz Narloch

Dalius Dobravolskas pisze:
 Hi,

   
 I am beginning and I have one question about running Pylons(paster)
 v0.9.6 with gzip compression(for pages) How to do it? :)
 
 Two ways:
 1) Search for gzipmiddleware here:
 http://pylonsbook.com/alpha1/wsgi

 Actually it would be nice if this middleware were available in Pylons
 by default. Maybe it is?
   
I know that above example from book works but compressing  the same  
static css and js each request is not that I need.
How can I add cache for this gziped file?

Best Regards,
Tomek

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



RE: Problem with pylons install on win XP 32

2008-12-19 Thread Jules Stevenson


 
 You should work with Python 2.5, or maybe you could use 0.9.7rc

Not really an option, we're tied into 2.6 [64 bit windows - nice :P] because
that's the version the 3d app we use predominantly here uses.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Two problems with AuthKit 0.4.1 and Pylons 0.9.7rc2

2008-12-19 Thread Andre Kolell

Hi,

thanks a lot for your help.

Now I decided to change AuthKit's method to forward instead of form.

This solved both problems.

Andre

- Ursprüngliche Mail -
Von: Dalius Dobravolskas dalius.dobravols...@gmail.com
An: pylons-discuss@googlegroups.com
Gesendet: Donnerstag, 11. Dezember 2008 14:20:41 GMT +01:00 
Amsterdam/Berlin/Bern/Rom/Stockholm/Wien
Betreff: Re: Re: Two problems with AuthKit 0.4.1 and Pylons 0.9.7rc2


Hello,

 I think that I will stay at AuthKit because it works fine for everything else 
 I'm doing. There are only the two problems I described earlier.
James is reading this group now. Maybe he will answer ;-)

 You told me about a callback for doing some operations (inserting something 
 into the session) immediately after the user logged in. I've taken a look at 
 http://authkit.org/svn/AuthKit/trunk/authkit/authenticate/form.py but I don't 
 know hot to implement that. May be my python/pylons knowledge isn't good 
 enough yet!? :( Can you give me a little more help with that?
Sorry, that's all what I see myself. You should analyze code from there.

 Is there someone around who had the second problem (after logging in page 
 isn't completely loaded) too and knows a solution?
I guess problem is that POST method does not re-post parameters.
That's all. I recommend showing form only to authorized users. Maybe
that's the problem?

-- 
Dalius
http://blog.sandbox.lt



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Problem with redirect_to and SSL

2008-12-19 Thread Andre Kolell

Hello,

I'm using Apache with SSL and use it's Proxy functionality to forward requests 
to the local running Paster (with Pylons 0.9.7rc2). SSL and Links work fine 
(with Mako). Only when Pylons comes to use the redirect_to-function it always 
ends up in http- instead of https-Connections. Using protocol='https' as a 
redirect_to-Parameter only solves my problem at first view, but as I'm 
developing local without SSL, it's not really a solution. 

I also seems as if request.environ['wsgi.url_scheme'] gives me http instead 
of https. May be redirect_to uses request.environ['wsgi.url_scheme']? 

Does anyone know why redirect_to doesn't use SSL-Connections and how I can make 
redirect_to using them?

Best regards,
Andre

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Routes user survey

2008-12-19 Thread Ben Bangert

On Dec 18, 2008, at 6:36 PM, Mike Orr wrote:


 file - controllers/semi_static.py
 controller - SemiStaticController
 method - faq


Note that you can customize the controller name if desired by dropping  
a line into semi_static.py like so:


__controller__ = 'MyClassController'

Cheers,
Ben

smime.p7s
Description: S/MIME cryptographic signature


pylons with sqlalchemy - UnboundExecutionError

2008-12-19 Thread wellhong

Hi all,

Ever since I've moved my application onto a production server with
apache and mod_wsgi, I constantly get the UnboundExecutionError after
a certain amount of time. On my local workstation, everything seems to
work fine however once it's moved over to the production server, this
error occurs.

I've tried various things like using meta.Session.mapper as opposed
to orm.mapper in the __init__.py file in /models directory. I also
incorporate this code into the ___init__.py file:

def pylons_scope():
import thread
from pylons import config
return Pylons|%s|%s % (thread.get_ident(), config._current_obj
())

...and then incorporating it like so:

sm = orm.sessionmaker(autoflush=True, transactional=True, bind=engine)

meta.engine = engine
meta.Session = orm.scoped_session(sm, pylons_scope)

I also tried enabling the beaker.session values in my .ini file but
that didn't seem to work either.

So I'm basically stuck at this point. I would appreciate any help on
this matter since I would like to continue using pylons and sqlalchemy
for future projects but need to make sure that it can pass this
hurdle.

Thanks,
Dave

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



category support for flash

2008-12-19 Thread Wichert Akkerman
Often it is very useful to have flash/status messages of several
different types, for example to be able to differentiate between
informational messages, warnings and errors. To do that I made
a simple extension to WebHelpers to add category support to its
Flash class. The change is completely backwards compatible, so if
you do not need categories you will never notice them.

Patch attached.

Wichert.

-- 
Wichert Akkerman wich...@wiggy.netIt is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---

diff -wurN WebHelpers-0.6.4/webhelpers/pylonslib.py WebHelpers/webhelpers/pylonslib.py
--- WebHelpers-0.6.4/webhelpers/pylonslib.py	2008-12-01 23:59:25.0 +0100
+++ WebHelpers/webhelpers/pylonslib.py	2008-12-19 20:52:10.0 +0100
@@ -9,6 +9,17 @@
 # modules should be importable on any Python system for the standard
 # regression tests.
 
+class Message(object):
+def __init__(self, category, message):
+self.category=category
+self.message=message
+
+def __str__(self):
+return self.message
+
+__unicode__ = __str__
+
+
 class Flash(object):
 Accumulate a list of messages to show at the next page request.
 
@@ -64,13 +75,15 @@
 def __init__(self, session_key=flash):
 self.session_key = session_key
 
-def __call__(self, message):
+def __call__(self, message, category=notice):
+if category not in [ warning, notice, error, success ]:
+raise ValueError(category)
 from pylons import session
-session.setdefault(self.session_key, []).append(message)
+session.setdefault(self.session_key, []).append((category, message))
 session.save()
 
 def pop_messages(self):
 from pylons import session
 messages = session.pop(self.session_key, [])
 session.save()
-return messages
+return [Message(*m) for m in messages]


Re: category support for flash

2008-12-19 Thread Mike Orr

On Fri, Dec 19, 2008 at 11:57 AM, Wichert Akkerman wich...@wiggy.net wrote:
 Often it is very useful to have flash/status messages of several
 different types, for example to be able to differentiate between
 informational messages, warnings and errors. To do that I made
 a simple extension to WebHelpers to add category support to its
 Flash class. The change is completely backwards compatible, so if
 you do not need categories you will never notice them.

What kind of template do you use to display this?  Do you display all
categories in the same place or in different places?

I have an application with a second message in a different location,
used to show 2 objects added, 1 object removed, etc.  I used a
different Flash object and a different session key for it.

-- 
Mike Orr sluggos...@gmail.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: category support for flash

2008-12-19 Thread Wichert Akkerman

Previously Mike Orr wrote:
 
 On Fri, Dec 19, 2008 at 11:57 AM, Wichert Akkerman wich...@wiggy.net wrote:
  Often it is very useful to have flash/status messages of several
  different types, for example to be able to differentiate between
  informational messages, warnings and errors. To do that I made
  a simple extension to WebHelpers to add category support to its
  Flash class. The change is completely backwards compatible, so if
  you do not need categories you will never notice them.
 
 What kind of template do you use to display this?  Do you display all
 categories in the same place or in different places?

I show them in the same manner using self-healing messages (ie the same
kind of thing Growl does on OSX) with different styling for different
types of messages. I have the exact same interface in javascript which
I use to show messages returned by JSON calls or other notices.

Wichert.

-- 
Wichert Akkerman wich...@wiggy.netIt is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: category support for flash

2008-12-19 Thread Mike Orr

On Fri, Dec 19, 2008 at 11:57 AM, Wichert Akkerman wich...@wiggy.net wrote:
 Often it is very useful to have flash/status messages of several
 different types, for example to be able to differentiate between
 informational messages, warnings and errors. To do that I made
 a simple extension to WebHelpers to add category support to its
 Flash class. The change is completely backwards compatible, so if
 you do not need categories you will never notice them.

 Patch attached.

Opened a ticket for it.
http://pylonshq.com/project/pylonshq/ticket/551

As soon as 0.9.7 is out I can put it in a point release.

If you could write a little howto about using it with Ajax and styling
different categories, I'm sure it would help a fair number of people.

-- 
Mike Orr sluggos...@gmail.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---