Re: pylons apps?

2006-06-07 Thread Damjan

 Well, the packages I've made (DjangoPaste and CherryPaste) have
 frequently broken due to upstream changes, so in the specific case of TG
 and Django it's not a stable situation.  I haven't revisited Django
 since magic-removal went live; hopefully it's actually better as a
 result.  Ideally what should happen in those packages go into the core
 of their respective system with unit tests, and then they get updated.
 They aren't intrusive (mostly), but most people inside those groups have
 little active interest in integration.

CherryPy 3.0 will obviosly solve all the problems in 2.x and will be
easy-ly usable as a WSGI application. So in 3.0 it will be possible to:
 - have more than one CherryPy app in a single Python process (no
globals)
 - Apps will be easy relocatable, so you can map to them from different
URL's


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss
-~--~~~~--~~--~--~---



Re: session problem in 0.92dev

2006-08-28 Thread Damjan

has_key will be removed in Python3000, use
  if 'client_id' in session:
instead


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss
-~--~~~~--~~--~--~---



Re: PythonOption SCRIPT_NAME /

2006-09-05 Thread Damjan

  And calls to root, for example http://www.example.com; were
  continually
  redirected

 If it's running at the root URL (/), then you can leave off
 SCRIPT_NAME entirely.

Yes, bacause in that case SCRIPT_NAME actually is an empty string.
Probably
  PythonOption SCRIPT_NAME 
would work

 Also, in the latest Paste (easy_install -U Paste==dev), it now comes
 with a modpython script which can directly load paste INI files.
 Using that will also simplify setup and remove the need for a
 startup.py file. Here's the docs for using the paste version:
 http://pylonshq.com/docs/0.9.2/module-paste.modpython.html

Maybe that page needs to be made a bit clearer on PythonOption
SCRIPT_NAME.

If you use the SetHandler python-program in a Location .. Apache
directive, Apache itself will corectly set up the SCRIPT_NAME
environment variable. But if you use it in a Directory directive
Apache will not how to set SCRIPT_NAME corectly, so you need an
explicit PythonOption.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss
-~--~~~~--~~--~--~---



Re: Upload Forget CMS

2006-11-07 Thread Damjan

Maybe you'd like to use CouchDB
http://www.couchdbwiki.com/index.php?title=Basic_Concepts

seems interesting


--~--~-~--~~~---~--~~
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Using Durus with Pylons

2006-12-16 Thread Damjan

 I finally ended up putting the connection in
 MyController.__before__().  That way it's created only in controllers
 that actually use the database,and it's one less module to modify.
 But I still want to see if it's possible to use one connection for
 several requests.

The usual way is to use a global dictionary that holds the connections
indexed by the thread id.
Something like this should work:

id = thread.get_ident()
global conn_cache
conn = conn_cache.get(id, newconnection())

Something like this is implemented in the threading.local() class which
is new in Python 2.4


--~--~-~--~~~---~--~~
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: comments on Unicode document

2006-12-18 Thread Damjan

 http://pylonshq.com/project/pylonshq/browser/Pylons/trunk/docs/internationalization.txt

Wow, great document

 This is a lot of non-Pylons-specific work!

And this should really be added to the Python wiki, too... and
eventually should enter the standard Python documentation.

My notes:

http://pylonshq.com/project/pylonshq/browser/Pylons/trunk/docs/internationalization.txt#L88
stanardised = standardised

http://pylonshq.com/project/pylonshq/browser/Pylons/trunk/docs/internationalization.txt#L107
 This has the useful side effect that English text looks
 exactly the same in UTF-8 as it did in ISO-8859-1 and ASCII, because for every
 ISO-8859-1 character with hexadecimal value 0xXY, the corresponding Unicode
 code point is U+00XY.

This is not true for iso-8859-1 since it defines characters in the
160-255 range too. Only ASCI encoding (0-127) is a proper subset of the
UTF-8 encoding.
http://www.htmlhelp.com/reference/charset/ (ISO 8859-1 character set
overview)


This is a very good takeaway rule:

 The main rule is this::
   Your application should use Unicode for all strings internally, decoding
   any input to Unicode as soon as it enters the application and encoding the
   Unicode to UTF-8 or another encoding on output.

I'd just add 'and encoding the Unicode to UTF-8 or another encoding
ONLY on output.'


--~--~-~--~~~---~--~~
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: comments on Unicode document

2006-12-18 Thread Damjan

   For example MySQL's Unicode documentation is here

 Also note that you need to consider both the encoding of the database
 and the encoding used by the database driver.

 If you're using MySQL together with SQLAlchemy, see the following, as
 there are some bugs in MySQLdb that you'll need to work around:

 http://www.mail-archive.com/sqlalchemy@googlegroups.com/msg00366.html

Shannon, I've read the therad on the sqlalchemy list.. but I never saw
the output of 'show create table ...'.
This is very important because different versions of MySQL might have
different defaults, and your Linux distro might also set it's own
defaults.

The thing is that a conversion can happen in the MySQL C API and in the
MySQL DB too.
I've been using this code to connect to MySQL
db = MySQLdb.connect(db='test', charset='utf8', use_unicode=True)

which, as I understand it, tells the MySQL C API to use UTF-8 over the
wire (charset='utf8'), and to use unicode objects on the Python side of
the things (use_unicode=True). But also my unicode test table is
created like this:
CREATE TABLE `test_unicode_table` (
  `id` int(11) NOT NULL auto_increment,
  `test_column` varchar(5) collate utf8_unicode_ci default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8
COLLATE=utf8_unicode_ci


--~--~-~--~~~---~--~~
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Using Durus with Pylons

2006-12-18 Thread Damjan

Actually this is what I've used to create per thread durus connections
and cache them:

from durus.client_storage import ClientStorage
from durus.connection import Connection
import threading

def connect(address):
tls = threading.local()
try:
  connection = tls.connection
except:
  connection = Connection(ClientStorage(address=address))
  tls.connection = connection
return connection
I'm using it here with Unix domain sockets, so I just need one
'address' parameter.
(BTW I think Durus should unify the address like it's with the Python
sockets, but that's a whole another story).


--~--~-~--~~~---~--~~
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: comments on Unicode document

2006-12-19 Thread Damjan



Are we on the same page, or am I still lost?


Not lost at all :)

Except I'd prefer if all Python API's would be unicode aware, and would
not encode/decode until it's utmost necessary. I think it would be nice
if the Python DB-API is reviewed and make unicode a requirement (for
quieries and results). This would be inline with the P3K efforts. And I
think that most dB drivers today do support unicode, MySQLdb obviously,
psycopg2 and pysqlite2 IMHO support unicode too. So I don't think
SQLAlchemy should do the encode/decode'ing unless the underlaying
driver doesn't support unicode.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Using Durus with Pylons

2006-12-19 Thread Damjan


And now that I re-read it again I see it's wrong.

if 'tls' would've been a global variable it would made some sense


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: UTF-8 ... help

2007-01-14 Thread Damjan


UTF-8 is not ASCII.
ASCII is a 7-bit charset (0-127), UTF-8 is a 8-bit, multibyte, NULL
byte clean, encoding of Unicode.

Unicode is not multi-byte strings. Unicode is the standard that
defines which codepoint (number) is which glyph (character). There are
different ways to represent Unicode in software. UTF-8 is one, UCS-16
or UCS-32 or UTF-16 are another.
UCS-32 is the simplest 32-bit number to Unicode glyph mapping.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: More on unicode

2007-02-02 Thread Damjan

While on the topic ... can someone take a look at
http://routes.groovie.org/trac/routes/ticket/37


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: More on unicode

2007-02-02 Thread Damjan

Thanks, it works... I also notice that with this version of Routes
1.6.3dev-r325 controller arguments are unicode now.

for example, I have
def show(self, pagename):
...
pagename was a byte string before, but now it's unicode... which is
great.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Routes question

2007-02-04 Thread Damjan

I really liked to be able to define a route like this:

map.connect('*pagename;:action', controller='page')

but it seems unpossible (according to
http://routes.groovie.org/manual.html#wildcard-limitations-and-gotchas)
... actually the main problem is because action='index' is defined by
default in Routes ..
since
map.connect('*pagename;:somethingelse', controller='page')
matches correct, but is not usefull.

Any suggestions? For now I specify a route for each action:
map.connect('*pagename;edit', controller='page', action='edit')
map.connect('*pagename;listtags', controller='page',
action='listtags')
map.connect('*pagename;addtag', controller='page',
action='addtag')
map.connect('*pagename;removetag', controller='page',
action='removetag')


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: More on unicode

2007-02-04 Thread Damjan


 What I want is to pick up the languages supported by the browser in the
 order in which they are specified by the browser.  It would appear that
 Firefox changes the sequence of the languages based on the currently
 selected locale - at least my copy does.

Most probably ... since that string comes from the locale.
(intl.accept_languages in ./toolkit/chrome/global/intl.properties -
I'm helping with a Firefox localization and have the source here :) )


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Request: tutorial for ToscaWidgets :)

2007-02-05 Thread Damjan

I've created this Genshi markup for a project of mine
http://groups.google.com/group/pylons-discuss/web/edit.html ... now I
have this tagging widget there that works with Mochikit. It shows the
tags associated with a page, and allows for AJAX adding and removing
of the tags (with all the bells and whistles).

So the input to the widget is, the initial taglist, addtag and
removetag URL's and a url for the activity indicator.

Now I thinks it would be great if this was a ToscaWidget, that I could
reuse in other pages.. but I don't know anything about ToscaWidgets
(yet) ... so maybe if someone can create a ToscaWidget of this example
it would be an interesting and helpfull tutorial?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Request: tutorial for ToscaWidgets :)

2007-02-07 Thread Damjan

  It would be nice if those parameters could be passed to a constructor
  in a single js call, that would make wraping it in a TW quite easy
  and it would allow having multiple taggers in the same page.

 So you mean like more object oriented javascript?...

 I've never done that, but I can try.

Done! :)
I've replaced the file on 
http://groups.google.com/group/pylons-discuss/web/edit.html
with the new version. I've tested with two DIV's and it works just
fine.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Adding Genshi Template Engine (environment.py vs middleware.py)

2007-02-17 Thread Damjan

  # Setup Genshi(only) Template Engine

 Implying that mix'n'match isn't supported?

That's copy/paste from the recipe I've found... I don't use other
templates so I've not even tried mixing them. So I don't imply
anything.



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Adding Genshi Template Engine (environment.py vs middleware.py)

2007-02-17 Thread Damjan


 I only thought that it might be a bit premature to hard-code it into
 the project templates as the only engine.

 Unless Genshi is now part of the standard Pylons easy_install?

 Which is what I should have written in the first place.

Aha I understand what you mean...

No, I don't propose to make Genshi default in the environment.py, but
to slightly reorganize environment.py and middleware so that templates
are configured in environment.py and not in middleware.py, which to me
is more logical.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



setting a cookie whether a redirect happens or not - part 2

2007-02-17 Thread Damjan

There was a discussion recently about this on this list but also on
IRC etc.
I have two sollutions, one was to make a custom redirect response that
then I could modify.

The other is to modify Pylons so that instead of re-raiseing the
HTTPException in WSGIController.__call__ so that the httpexceptions
middleware catches it, instead create a response out of the exception
and then call __after__ with that reponse.

The patch for the second sollution is here : 
http://pylonshq.com/project/pylonshq/ticket/201

Just look at the (positive) changes my controller had, after applying
#201,
here's the diff of my controller http://paste.lisp.org/display/37002.

The patch in #201 could be also made a lot shorter if Paste implements
a get_response() call in the HTTPException class.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: problems with paster serve reload

2007-02-19 Thread Damjan

 I've been getting this on Gentoo ever since I started using Pylons two
 months ago, on two different versions of Pylons and Paste (both Python
 2.4.x).  Only I don't have to modify any files; merely running paster
 serve --reload and ctrl-c is enough to leave threads running which
 have to be manually killed.  On the other hand it *does* reload files
 properly I think.

As far as I understand paster restarts the whole process, so ofcourse
it *reloads* properly :)

Is it possible that Gentoo has some patched Python version? I don't
remember ever happening to me that CTRL-C would not kill the server. I
use Slackware and ArchLinux and Python 2.4 (2.4.2 and 2.4.4).



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Routes generates bad URLs with args containing spaces

2007-03-16 Thread Damjan

Isn't + and %20 considered the same in HTTP??


On Mar 17, 12:12 am, Mike Orr [EMAIL PROTECTED] wrote:
 I have a bunch of images with spaces in the filenames.  I need to
 embed the filename in the URL with the proper escaping, so:
 6001/1355/SHELLNAIRN08OCT05 _24_.jpg
 should be:
 /attachments/6001/1355/SHELLNAIRN08OCT05%20_24_.jpg

 I have a route like this:

 NUMERIC = R\d+
 map.connect(attachment, /attachments/:orr_id/:entry_id/:filename,
 requirements={orr_id: NUMERIC, entry_id: NUMERIC})

 $ paster shell development.ini h.url_for(attachment, orr_id=6001, 
 entry_id=1355,

 filename='SHELLNAIRN08OCT05 _24_.jpg')
 '/attachments/6001/1355/SHELLNAIRN08OCT05+_24_.jpg'

 Oops, it quoted it query-string style.  Maybe I should escape the
 argument myself.

  h.url_for(attachment, orr_id=6001, entry_id=1355,

 filename='SHELLNAIRN08OCT05%20_24_.jpg')
 '/attachments/6001/1355/SHELLNAIRN08OCT05%2520_24_.jpg'

 Now it double-quoted.  Is this a bug or am I using it wrong?  My
 Quixote application uses %20 for spaces and has never had a problem
 finding the images.

 My current workaround is to replace the '+' afterward.

  url = h.url_for(attachment, orr_id=6001, entry_id=1355,

 filename='SHELLNAIRN08OCT05 _24_.jpg') url.replace(+, %20)

 '/attachments/6001/1355/SHELLNAIRN08OCT05%20_24_.jpg'

 --
 Mike Orr [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Enable SSL only for selected controllers

2007-07-23 Thread Damjan

You'll set your app with both a SSL and non-SSL server.

Then in your login form you'll set https:// as the POST action.
Even better if the login form itself is served as https:// - you can
do that by changing the Login url in the HTML but also you can check
in the controller that shows the login form if it's a secure and
redirect if it isn't.

Also, after a successfull login, you can redirect back to the non-SSL
site (but are cookies sent by browsers then?) ... you might need to
use cookies in URL's instead (for ex. gmail).


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Sessions - database or filesystem

2007-10-19 Thread Damjan

 If you're not clustered, I see no reason to use  the filesystem session as 
 it'll be faster.

no reason to use or not to use??


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Mysql database server failover

2007-11-08 Thread Damjan

 By master-master you mean each database updates the other when a
 change comes in?  How did you structure that?

http://www.howtoforge.com/mysql_master_master_replication

MySQL master-master is kind of like bidirectional master-slave. This
is supported in version 5.0 and above. In previous version auto-
increment collumns would conflict.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Routes: Subdomain won't work with referers (bug?)

2007-11-16 Thread Damjan

If you plan to run the *same* web application for different entities -
thus you need different data (icons, templates, db...) in your app  -
maybe it's better to check for environ['HOST'] in your controllers
explicitly, and act acordingly?

After a while, I'm sure a pattern will emerge so you could also fold
some common code in __before__ or __after__ or in the controller base
class.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Pylons + mod_wsgi Oracle

2008-02-13 Thread Damjan

AFAIK
you'll have to start httpd with
env  - ORACLE_HOME=... /usr/sbin/httpd
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Routes 1.8 Release

2008-04-07 Thread Damjan


 I don't know the real reason behind this change but for me it feels
 more natural and elegant to have clean URLs with slashes than using
 any other caracters =)

well the difference is between
/some_resource;edit
/some_resource;preview
etc.
and
/some_resource/edit

now /edit looks like an aditional resource... ;edit otoh looks like a
special view of the resource.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Routes 1.8 Release

2008-04-07 Thread Damjan

maybe because of this:
http://www.issociate.de/board/post/11276/Forwarding_URL_with_semicolon.html

although I don't think Apache is doing the correct thing there... I'll
check that later
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Running Pylons with PHP

2008-05-12 Thread Damjan

 But named virtual hosts won't work if you're using HTTPS.

Well, there's a patch for Apache to support that, and nginx also does
support the TLS extension for single ip based HTTPS.

Firefox 2.0 and IE 7.0 I htink also support this.

(the feature is named TLS SNI.. https://sni.velox.ch/ )
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Pylons and memory use

2008-06-08 Thread Damjan

cat /proc/pid/status will give you a lot of information about memory
usage.
ex:
...
VmPeak: 2316 kB
VmSize: 2212 kB
VmLck: 0 kB
VmHWM:   940 kB
VmRSS:   936 kB
VmData:  164 kB
VmStk:84 kB
VmExe:12 kB
VmLib:  1876 kB
VmPTE:20 kB
...

On Jun 7, 7:57 pm, Jose Galvez [EMAIL PROTECTED] wrote:
 newbie question - how do you determine how much memeory your app is
 using, on Linux of course
 Jose

 Ben Bangert wrote:
  On Jun 6, 2008, at 9:43 PM, John Salerno wrote:

  I was thinking about signing up with a web host that supports Pylons
  (among many other things) and one of the differences between the
  various plans is application memory for long-running processes. The
  plan I'd like to sign up for has 80MB. Does anyone know if this is
  enough for basic Pylons applications?

  The PylonsHQ site takes up about 39 megs of memory (25mb on launch,
  and I cache a bunch of docs to memory which grows it to about 39). I
  don't see why 80mb wouldn't be enough.

  Just in general, how exactly can I calculate how much memory a Pylons
  application (or any other type of application, for that matter) will
  require? Is there some general range I might be able to rely on? Does
  80MB seem like enough for just playing around and hobbyist work?

  Sure, no problem. PylonsHQ will run for months without budging past
  39mb. It's serving up the reference docs right now, and has a Pastebin
  using a Postgres database via SQLAlchemy.

  A significantly larger app that I run at the company I'm at peaks a
  bit higher at 122mb.

  Cheers,
  Ben


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: mod_wsgi does not check for changed files?

2008-06-27 Thread Damjan

http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode

On Jun 27, 9:53 pm, webwurst [EMAIL PROTECTED] wrote:
 Hi!

 If i start a pylons project with paster i can add the parameter --
 relaod, so changes to the source code are reflected directly. But i'm
 using mod_wsdi now and i have to restard apache if i want changes in a
 python file to take effect!

 Is there a way that changed files are checked with mod_wsgi?

 Cheers,
 webwurst
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Is Django more popular than Pylons?

2009-01-28 Thread Damjan

 In production, I've gone to always using virtualenvs.

Python 2.6 now supports $PYTHONUSERBASE, just set it to a directory
(doesn't need to exist), for example:

export PYTHONUSERBASE=$HOME/mydev/
pip.py install FormAlchemy

Now I do have in ~/.pydistutils.cfg
[install]
user=True

It's similar to virtualenv, but kind-of more clean, and doesn't copy
the whole python executable in each env (which I never liked).

To switch to another env, just reset the variable.
--~--~-~--~~~---~--~~
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: Is Django more popular than Pylons?

2009-01-29 Thread Damjan

 Oh, this is the same as the per-user install directory? 
 http://www.python.org/dev/peps/pep-0370/

 I thought there could be only one site-packages per user, not multiple
 ones per application.

yes, that's the feature, $PYTHONUSERBASE controls which environment
you are using, so you can have as many as you want (the *user* as such
doesn't matter any).

I've been using it for some time, and looks good to me, haven't seen
any problems.

It's much cleaner too.. no copies of anything (neither the
interpreter, neither the other modules that virtualenv copies or
links), no hacks in some other modules.
--~--~-~--~~~---~--~~
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: Is Django more popular than Pylons?

2009-01-30 Thread Damjan

 Damjan, and does ipython works from $PYTHONUSERBASE? because it
 doesn't works on virtualenv. If if works then would be another great
 advantage :)

Yes it works. I've just installed the distro version of ipython, and
it can import the modules in my USERBASE, no problem.

So you don't even need to install it in the virtual environment.
--~--~-~--~~~---~--~~
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: Source encoding issues

2009-01-30 Thread Damjan

On Jan 30, 11:36 am, Domen Kožar ielect...@gmail.com wrote:
 I somewhat figured out that my u'strings' get encoded to latin, even
 though utf-8 is set as OS locale, vim encoding and python source
 encoding.

 After fiddling around, I got that far:http://paste.pocoo.org/show/101978/

 Any idea what could trigger such behaviour?

You need to put # -*- coding: utf-8 -*-
as one of the few first lines in your pytohn files. That way Python
knows what encoding your strings are written in. (there's a pep about
this too).

The interactive python interpreter behaves a little different since it
uses the locale when started and assumes strings are written in that
locales charset.

I guess the Pylons shell doesn't implement this same thing (ipython
has the same bug).
--~--~-~--~~~---~--~~
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: Source encoding issues

2009-01-31 Thread Damjan


 I know about the pep and how python source files are encoded, but the
 interactive shell is something completely different. I wonder on what
 local env variable does shell depend. Since I have all of them
 either sl_SI.UTF8 or en_GB.UTF-8.

The Python interactive shell depends on the locale (LANG or LC_xxx,
run locale to see).

The paster shell is just buggy I'd say (same as ipython).
--~--~-~--~~~---~--~~
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: installation has NEVER worked on the first try in two years of using Pylons

2009-04-09 Thread Damjan

 I get frustrated every time I setup a new virtualENV as I forgot that
 something always breaks.  

For those using Python 2.6*, I'd like to see how much better/worse
this sollution is:

# starting from scratch, a clean slate:
wget https://svn.openplans.org/svn/pip/trunk/pip.py
chmod +x pip.py
export PYTHONUSERBASE=$HOME/myenv
export PATH=$HOME/myenv/bin:$PATH
./pip.py install --install-option=--user Pylons

You should get everything installed in $HOME/myenv/lib/python2.6/site-
packages and $HOME/myenv/bin


I've used it on linux and it never failed me. I wonder how it works on
Mac OS X and Windows (since I don't have access to those).

I do notice, that I don't get setuptools installed in the USER-BASE,
since nothing in Pylons seems to require it, but I do have a recent
version (0.6c9) installed system-wide from a distro package. Does
Pylons use it on it's own?



* This relies on the Python 2.6 feature aka pep-370:
http://docs.python.org/whatsnew/2.6.html#pep-370-per-user-site-packages-directory
--~--~-~--~~~---~--~~
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: How to run pylons (paster) without enter certificate password ?

2009-04-09 Thread Damjan

 Is it a simple way to run daemon (paster) using certificate? Before
 every start of paster I have to enter my 'certificate password'. Maybe
 is it a parameter to use it in command line?

are you talking about a SSL certificate? you can easyly save a non-
encripted private key with the openssl tool. But in that case you
must make sure nobody could ever make a copy of the .key file.

I think the syntax is: openssl -in encrypted.key -out non-enc.key
--~--~-~--~~~---~--~~
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: Authkit vs repoze.who for openid

2009-07-18 Thread Damjan

 SqlAlchemy is not requirement for OpenID but you still need SQL backend
 for OpenID. I believe that's only limitation of python-openid library
 which might be already addressed and I am not aware about it. My
 implementation works properly with MySQL only. I know how to fix SQLite
 backend but had no time for that yet. I have not tested it with
 PostgreSQL as well (but I hope it works).

I don't see why an OpenID library or middleware would need to have any
storage ... can't it just give me the ID of the user, and I could
store it in my session or do whatever I choose to do with it!??
--~--~-~--~~~---~--~~
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: Authkit vs repoze.who for openid

2009-07-19 Thread Damjan

 2) Your server should remember somehow who and when initiated OpenID
 request. So it create OpenID session and saves it to database (OpenID
 session usually is encoded into return URL);

I can remember that in the http session (which could be Beakers secure
cookie)
--~--~-~--~~~---~--~~
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: mod_wsgi and auth_kit: Login doesn't work

2009-07-20 Thread Damjan

 [Fri Jul 17 19:01:43 2009] [error] [client 192.168.1.100] TypeError:
 sequence of string values expected, value of type literal found,
 referer:http://192.168.1.100/

This seems like the common error in middleware to not return strings
but probably a number in your case.

You could try to wrap different middleware (AurhKit?) with
wsgiref.validate to check it's conformance to the WSGI standard.

http://docs.python.org/library/wsgiref.html#module-wsgiref.validate
--~--~-~--~~~---~--~~
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: Counting feed subscribers

2009-11-24 Thread Damjan
 The only thing I can think of is to put a random number in a query
 parameter when generating feed URLs.  Then the number of active feeds
 each month would be the count of unique feed numbers. Or is there a
 better way?

route them through feedburner? :)

--

You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-disc...@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.