Re: What I've learned deploying pylons

2009-03-30 Thread Arun Tomar

hi!

well quite a discussion. just to add  share my experience of
developing on pylons  deploying it.

My requirement was to host multiple pylons application, on a single
server. so running each app on paster daemon  proxy to it via either
apache or nginx was not a very optimal solution for me.

So i tried using apache 2+ mod_wsgi, which is good  works well, but
it's a bit slow for now. i hope that in future it's performance will
increase more.

Then i tried nginx+mod_wsgi, which is great in terms of performance,
speed  scalability. You can just keep on adding different pylons
webapps as virtual hosts to nginx  everything works. so far it has
been great.

Our product is a website management system, ( you can  say a CMS sort
of app ). Ive deployed the nginx + mod_wsgi on our new VPS, and will
be going live any day.


-- 
Regards,
Arun Tomar
blog: http://linuxguy.in
website: http://www.solutionenterprises.co.in

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Routes and Controllers

2009-03-30 Thread edgarsmolow

In my project, there are a number of controllers (and corresponding
templates) that can be grouped together since they share a common
purpose.  To keep things organized, I've put the controllers in a
subdirectory (of the controllers directory) called ai.  For example,
here are the locations of three controllers:
  /myproject/controllers/ai/q01.py
  /myproject/controllers/ai/q23.py
  /myproject/controllers/ai/w02.py

How should Routes be set up so that the following URL is mapped to the
q01 controller above?

http://www.somedomain.com/ai/q01

Would the following be correct (assuming it's placed higher in the
list)?
map.connect('/ai/{controller}/{action}')


Thanks.
Edgar




--~--~-~--~~~---~--~~
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 and Controllers

2009-03-30 Thread edgarsmolow

One more thought...

Would it be necessary to add an entry to Routes for each controller?
Or, can one (or just a few) entries be added which contain dynamic
parts?

Thanks.
Edgar


On Mar 30, 11:43 am, edgarsmolow edgarsmo...@gmail.com wrote:
 In my project, there are a number of controllers (and corresponding
 templates) that can be grouped together since they share a common
 purpose.  To keep things organized, I've put the controllers in a
 subdirectory (of the controllers directory) called ai.  For example,
 here are the locations of three controllers:
   /myproject/controllers/ai/q01.py
   /myproject/controllers/ai/q23.py
   /myproject/controllers/ai/w02.py

 How should Routes be set up so that the following URL is mapped to the
 q01 controller above?

 http://www.somedomain.com/ai/q01

 Would the following be correct (assuming it's placed higher in the
 list)?
 map.connect('/ai/{controller}/{action}')

 Thanks.
 Edgar
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



email host environment for development purpose

2009-03-30 Thread karikris...@gmail.com

I use Pylons for past two months. I used Windows XP with SP2 where I
used Jmailsrv for email server so that I can test the emails my
application send in my development PC. Recently I switched to ubuntu
8.10. What is the similar environment you guys use it for email
testing? My laptop is four years old, works slow.

Tell me the some light weight pop3  smtp servers you guys using for
development.


--~--~-~--~~~---~--~~
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: What I've learned deploying pylons

2009-03-30 Thread Jared Rhine

On 03/29/2009 01:17 PM, Jose Galvez wrote:
 Max also mentions upstartn, whats the advantage to that over using the
 system V script?

Two advantages are obvious: automatic restart and a dramatically
shorter amount of config needed to get running.

While supervisord, monit, etc seems to be more popular, I've been
using runit everywhere for years and have succeeded in converting a
number of people to its use.  runit is basically an open-source,
maintained version of DJB's daemontools.  daemontools I guess is open-
source now, but DJB's previous can't distribute this code if it has
been modified killed it as a viable project.

runit's configuration looks much more like upstart than supervisord;
here's one of my production pylons runit start scripts:

-

#!/bin/sh



exec 21

PY=/usr/local/python
export PYTHONPATH=$PY/lib/python2.5/site-packages

cd /home/tsm
exec chpst -u tsm:tsm $PY/bin/paster serve --reload tsm-prod.ini

-

Another start script:

-

#!/bin/sh
exec 21
exec chpst -u bots:bots -/ /home/eggdrop ./eggrop -n ./eggdrop.conf

-

(The exec 21 is to capture stderr output; runit arranges to
capture all stdout of the program and put it into automatically-
rotated log files.  upstart can do basically the same using upstart-
logd.)

I like runit over upstart, even where upstart is available because 1)
it's available on all unixes and already in most distro package
managers; 2) it uses just scripts and files, not a  custom config
language for dependencies/pre-start/post-stop scripts; 3) by default,
it doesn't replace init(1), just adds itself to init.  But I would use
upstart probably if it was easily available everywhere I admined.

Near as I can see, upstart is a reimplementation of ideas long ago
nailed by daemontools and runit, but with a need to back-support SysV
runlevels, a custom config language (instead of some specific
conventions), more direct support for service dependencies, and some
Ubuntu specifics.

Someone asked if upstart was going to replace SysV startup (at least
on ubuntu).  That's their intent; I dunno how successful they will be.
I've had no problems mixing and matching startup/supervision
systems, so I don't see a real need for it to be either/or.  I have
many servers with a variety of supervision systems; I tend not to
place Apache under runit (it's easy) because Apache works fine out of
the box on Debian and I haven't had Apache die on me in probably a
decade.

In general, I like all the run in foreground approaches (runit,
daemontools, upstart, supervisord).  It's just safer to assume each
layer will die eventually, and arrange for there to be direct
supervision all the way back to init(1).  @reboot techniques make me
nervous, though that's also a handy approach.

Note that it's a really good idea to actual monitor the resulting
service, not just the process id.  In this way, monit (or nagios/
whatever) configured to monitor the actual HTTP port and try a restart
if that fails is more reliable than just restart if the process
dies.  This is because it's possible for the web app process to be
running, but something has broken (database connection, permissions,
etc) that keeps it from actually serving HTTP.

I might use a great solution like ngnix+mod_wsgi in production for
great performance, but it'd end up having ngnix monitored by runit.

-- Jared
--~--~-~--~~~---~--~~
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 and Controllers

2009-03-30 Thread edgarsmolow

I read the docs, but still don't quite understand how to apply in this
situation.  I created a series of controllers in the /controllers/
logic directory.  This is a line in Routes:

map.connect('/logic/q01/{action}/', controller='logic/q01')

But, this produces a 404 (not found) error:
http://localhost:5000/logic/q01/view

What should the mapping be set to so that the view action in the logic/
q01 controller is run:

Edgar



On Mar 30, 1:58 pm, Wyatt Baldwin wyatt.lee.bald...@gmail.com wrote:
 On Mar 30, 8:43 am, edgarsmolow edgarsmo...@gmail.com wrote:



  In my project, there are a number of controllers (and corresponding
  templates) that can be grouped together since they share a common
  purpose.  To keep things organized, I've put the controllers in a
  subdirectory (of the controllers directory) called ai.  For example,
  here are the locations of three controllers:
/myproject/controllers/ai/q01.py
/myproject/controllers/ai/q23.py
/myproject/controllers/ai/w02.py

  How should Routes be set up so that the following URL is mapped to the
  q01 controller above?

 http://www.somedomain.com/ai/q01

  Would the following be correct (assuming it's placed higher in the
  list)?
  map.connect('/ai/{controller}/{action}')

 This is close, but I don't think it would work, as the controller is
 'ai/q01'. The answer you seek is somewhere near here:

 http://pylonshq.com/docs/en/0.9.7/configuration/#url-config
--~--~-~--~~~---~--~~
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: What I've learned deploying pylons

2009-03-30 Thread Graham Dumpleton



On Mar 30, 10:56 pm, Arun Tomar tomar.a...@gmail.com wrote:
 hi!

 well quite a discussion. just to add  share my experience of
 developing on pylons  deploying it.

 My requirement was to host multiple pylons application, on a single
 server. so running each app on paster daemon  proxy to it via either
 apache or nginx was not a very optimal solution for me.

 So i tried using apache 2+ mod_wsgi, which is good  works well, but
 it's a bit slow for now. i hope that in future it's performance will
 increase more.

Apache/mod_wsgi performance with a typical Python web application
should not be much different to other solutions.

The mistake people often make in comparing it to others is that they
don't take into consideration when benchmarking it that Apache/
mod_wsgi performs lazy loading where as others will often preload the
application. Not realising this and factoring it into how you run your
benchmarks, and/or not configuring Apache/mod_wsgi to preload the
application can really screw up your results and give the impression
that Apache/mod_wsgi performs poorly.

If you have any remaining interest in Apache/mod_wsgi, you may perhaps
want to go over to the mod_wsgi list and can review how you were
actually setting up your system and performing the benchmarking and
work out why you were seeing sub optimal performance. Even if there
were an issue in Apache/mod_wsgi, things will never improve if you
never feedback information about problems you may have encountered.

Graham

 Then i tried nginx+mod_wsgi, which is great in terms of performance,
 speed  scalability. You can just keep on adding different pylons
 webapps as virtual hosts to nginx  everything works. so far it has
 been great.

 Our product is a website management system, ( you can  say a CMS sort
 of app ). Ive deployed the nginx + mod_wsgi on our new VPS, and will
 be going live any day.

 --
 Regards,
 Arun Tomar
 blog:http://linuxguy.in
 website:http://www.solutionenterprises.co.in
--~--~-~--~~~---~--~~
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 and Controllers

2009-03-30 Thread Wyatt Baldwin

On Mar 30, 4:09 pm, edgarsmolow edgarsmo...@gmail.com wrote:
 I read the docs, but still don't quite understand how to apply in this
 situation.  I created a series of controllers in the /controllers/
 logic directory.  This is a line in Routes:

 map.connect('/logic/q01/{action}/', controller='logic/q01')

Try this:

map.connect('/{controller}/{action}/')

The docs say that {controller} is somewhat special in that it will
match forward slashes, while most dynamic parts don't.


 But, this produces a 404 (not found) 
 error:http://localhost:5000/logic/q01/view

 What should the mapping be set to so that the view action in the logic/
 q01 controller is run:

 Edgar

 On Mar 30, 1:58 pm, Wyatt Baldwin wyatt.lee.bald...@gmail.com wrote:

  On Mar 30, 8:43 am, edgarsmolow edgarsmo...@gmail.com wrote:

   In my project, there are a number of controllers (and corresponding
   templates) that can be grouped together since they share a common
   purpose.  To keep things organized, I've put the controllers in a
   subdirectory (of the controllers directory) called ai.  For example,
   here are the locations of three controllers:
     /myproject/controllers/ai/q01.py
     /myproject/controllers/ai/q23.py
     /myproject/controllers/ai/w02.py

   How should Routes be set up so that the following URL is mapped to the
   q01 controller above?

  http://www.somedomain.com/ai/q01

   Would the following be correct (assuming it's placed higher in the
   list)?
   map.connect('/ai/{controller}/{action}')

  This is close, but I don't think it would work, as the controller is
  'ai/q01'. The answer you seek is somewhere near here:

 http://pylonshq.com/docs/en/0.9.7/configuration/#url-config
--~--~-~--~~~---~--~~
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: What I've learned deploying pylons

2009-03-30 Thread Wyatt Baldwin

On Mar 28, 11:50 pm, Wichert Akkerman wich...@wiggy.net wrote:
 Previously Noah Gift wrote:
  On Sun, Mar 29, 2009 at 1:05 PM, Mike Orr sluggos...@gmail.com wrote:

   On Sat, Mar 28, 2009 at 4:42 PM, jose jj.gal...@gmail.com wrote:
So this brings me to the heart of what I've learned, if you are going
to deploy a long running app how do you do it?

   I put all my Pylons and Quixote apps under Supervisord, with Apache
   mod_proxy.  I want to try nginx when I have a chance.

   Some people prefer mod_wsgi because it runs everything under Apache
   processes, but I like being able to supervisor stop and supervisor
   start individual applications for maintenance and debugging, plus
   seeing them under their own names in the ps listing.

  This recently came up at work, at one other gotcha is that you have to write
  your own init script.  Is there a recipe on the Pylons wiki for this?

 You can do three things:

 - start supervisord using init by adding an entry in /etc/inittab. This
   requires root and is for the very paranoid: even if supervisord dies
   (which never happens) it will be restarted.

 - use an init script to start supervisord at system boot. Requires root.

 - Start supervisord using an @reboot crontab entry in a normal account.
   Does not require root. Works on all Linux distributions, I'm not sure
   is other cron implementation support this.

 The last one is my preferred method: it is trivial to setup and can be
 done by any normal user.

Well, I went and got all excited about supervisor, then learned that
it doesn't support Python 2.6 very well and may never[1] (although it
does seem to work to some extent in my setup with Python 2.6.1). I
also noticed that the last 3.0 alpha release was over a year ago.

Questions: Which versions of supervisor and Python are ya'll using
together? Should I go for supervisor 2.1 or 2.2b1 or 3.0a6 or ...?

Currently, there's nothing I'm really using from Python 2.6 and
switching back to 2.5 wouldn't be a big problem, but it would be nice
to be able to move to it in the future.

[1] 
http://lists.supervisord.org/pipermail/supervisor-users/2009-March/000312.html
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Shabti - some paster template power-ups for Pylons

2009-03-30 Thread Graham Higgins

Now that Pylons 0.9.7 has been released and Pycon has been put to bed,
I thought I'd better bite the bullet and get Shabti out of the door
for people to play with, so I pushed it up to PyPi. Here's the
skinny ...

-
Shabti is a collection of customised project templates for Pylons
intended to provide some quick and easy kickstarts for building web
applications in Pylons.

Each template adds one or more selected features to the standard
Pylons project build. Examples of added features are:

Elixir :: a declarative layer on top of SQLAlchemy,

FormAlchemy :: generation of forms via introspection of database
schemas

RDFAlchemy :: an RDF-based modelling ORM (Object-RDF-Model).

The Shabti project itself stands as an example of how to create a
customised Pylons template that bundles up one’s typical Pylons power-
ups into a single and conveniently re-usable kickstart macro:

$ paster create --template shabti_template_name project_name

Shabti is probably best viewed as the lazy person’s alternative to
tedious copying and pasting of code fragments scattered all over the
net.
-

Full docs are on http://bel-epa.com/shabtidocs/index.html, it should
give you a good idea of what's there and how it works.

It's an extensive set of templates, quite a lot of them require
additional modules but because I've not yet figured out how to
dynamically trigger prompts to install optional modules on a per-
template basis, there are a couple of places where running the
generated project will initially fail because a couple of modules need
to be easy_installed -- e.g. the microsite template uses Babel but
that's the only one that does and it just doesn't make sense to impose
that dependency on the entire package.

All the generated projects have tests of varying limited degrees of
thoroughness, so it will be worth running nosetests in the generated
projects as matter of course.

Comments, observations, questions, corrections and constructive
criticism will be welcomed.

Cheers,

Graham Higgins.

http://www.linkedin.com/in/ghiggins




--~--~-~--~~~---~--~~
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 and Controllers

2009-03-30 Thread Tomasz Narloch

edgarsmolow pisze:
 One more thought...

 Would it be necessary to add an entry to Routes for each controller?
 Or, can one (or just a few) entries be added which contain dynamic
 parts?

 Thanks.
 Edgar


 On Mar 30, 11:43 am, edgarsmolow edgarsmo...@gmail.com wrote:
   
 In my project, there are a number of controllers (and corresponding
 templates) that can be grouped together since they share a common
 purpose.  To keep things organized, I've put the controllers in a
 subdirectory (of the controllers directory) called ai.  For example,
 here are the locations of three controllers:
   /myproject/controllers/ai/q01.py
   /myproject/controllers/ai/q23.py
   /myproject/controllers/ai/w02.py

 How should Routes be set up so that the following URL is mapped to the
 q01 controller above?

 http://www.somedomain.com/ai/q01

 Would the following be correct (assuming it's placed higher in the
 list)?
 map.connect('/ai/{controller}/{action}')


 
Maybe it is not the best routes but it's works:
map.connect('/error/{action}', controller='error')
map.connect('/error/{action}/{id}', controller='error')
...
map.connect('/admin/page/{action}/{id}',
controller='admin/page', action='index', id=None, _minimize=True)
map.connect('/admin/price/{action}/{id}',
controller='admin/price', action='index', id=None, _minimize=True)
map.connect('/admin/mail/{action}/{id}',
controller='admin/mail', action='index', id=None, _minimize=True)
map.connect('/admin/client/{action}/{id}',
controller='admin/client', action='index', id=None, _minimize=True)

map.connect('/admin/{action}', controller='administrator', 
action='index', _minimize=True)

...
map.connect('/', controller='home', action='index')
map.connect('Default', '/{controller}/{action}')

if I go to /admin - then controller=administrator, method=index
if I go to /admin/page - then controller=admin/page, method=index

Best Regards


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---