Bilboon wrote:
Is there a simple way to protect methods of controllers using permission ?
There is always more than one way, despite Python's manifesto :)
You can use AuthKit. Search for AuthKit in this group's archives for
more information.
I personally didn't like that it depends on extra
I have a slightly different version that does a transparent
authentication/authorization. By transparent I meant that there is no
redirect sent to user when authentication is required. WHenever user
tries to access protected action, authentication form is shown and user
gets stright to the action
Hello everybody,
According to PasteScript documentation, ini-file can be easily
converted into startup script on UNIX/Linux platforms by adding
magic-line at the very top, adding [exe] section and setting execution
bit. However, that wont work for ini-files generated using Pylons. The
reason is
That was fast. Thank you 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
Ben Bangert wrote:
def action(self):
req = request.current_obj()
def long_func():
env = req.environ
yield some content
# do something that takes awhile
yield more content
resp = Response()
resp.content = long_func()
return
Jon,
That is a feature. All unspecified parameters are inherited from
current request unless controller name is prefixed with /. In your
case, story is not specified and map has no placeholder for story so it
is placed as get parameter. Put / in front of controller name to make
sure that nothing
Muhammad,
I'd do that this way
from paste.wsgilib import add_close
f = open(filename)
r = Response(mimetype='application/octet-stream')
r.content = add_close(f, lambda: f.close())
return r
--~--~-~--~~~---~--~~
You received this message because you are
Philip,
You are right. add_close is useless in that case. Thanks for correcting
me.
r = Request(mimetype='application/octet-stream')
r.content = open(filename)
return r
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
wyatt-bC wrote:
Howdy. I'm doing some AJAXy stuff and I can't seem to get a status code
other than 200.
The relevant controller looks like this (sort of):
def show(self, blah, blah):
# do stuff and set ``code`` depending on what happens
# ...
return
James Gardner wrote:
Hi jw,
This is because a new instance of the controller object is created on
each request, if it wasn't, your controllers would not be thread safe
because class members set by one thread might be read by another.
Hi James,
Is that right that the only reason why
http://www.myghty.org/docs/programmatic.myt#configuration_programmatic_interpreter_standalone
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To post to this group, send email to
Hello everyone,
I'm trying to implement server-push functionality using multipart/x-
mixed-replace content type as following:
# in theory, this function should run forever or until connection is
closed
def generate_stream(boundary):
boundary = '\n%s\n' % boundary
yield boundary
# returns
Hello everybody,
Let's say I need some task to be executed periodically while my WSGI
application is serving requests. In a nutshell, I need to start a
thread that . What is the best place to start such a thread? I ended
up implementing paste.server_runner endpoint where I start my thread
and
Congrats! Nicely done indeed!
The great thing about Pylons (and Python for that matter) is how less
effort has to be put in to make it working the way you want it.
Yesterday I deployed second project that is powered by Pylons.
Unfortunately, I cannot invite everybody to see it because it is
Rick,
If I couldn't use a regular proxy in front of such an application,
I'd rather go for paste.proxy instead of trying to implement it on
Pylons level.
On Mar 25, 5:31 pm, ram [EMAIL PROTECTED] wrote:
I've got a requirement to have our Pylons app act as an occasional
proxy to a different
if 'get_merges' in request.params:
get_merges()
elif 'plot_merges' in request.params:
plot_merges()
else:
# initial form request
On Apr 3, 3:55 pm, ben adam [EMAIL PROTECTED] wrote:
This is what i have in my template:
input class=submit name=get_merges type=submit value= Get
Merges
On Apr 4, 1:29 am, Mike Orr [EMAIL PROTECTED] wrote:
I tried incorporating TurboCheetah into Cheetah and (re)discovered
it's using dotted notation (section.index) rather than the URI
notation (/section/index.tmpl) that Pylons at least is standardizing
on. I'm hesitant to put dotted
On May 3, 9:27 am, C. Handel [EMAIL PROTECTED] wrote:
When i try to start a paster-service using the --user flag i run into
some permission problems
I tried to use this command to start the service:
paster serve server.ini --user=www
Paster will create a temporary objectstore in the
Another way is to set environment variable PYTHON_EGG_CACHE to
something accessible by user that paster switches to after starting
the daemon.
On May 4, 7:59 am, askel [EMAIL PROTECTED] wrote:
On May 3, 9:27 am, C. Handel [EMAIL PROTECTED] wrote:
When i try to start a paster-service using
it is really needed would make a nice
improvement.
On Jun 13, 5:10 pm, Daniel Tang [EMAIL PROTECTED] wrote:
On 6/12/07, askel [EMAIL PROTECTED] wrote:
Hello everyone,
How do I access active sessions? I need to be able to update or close
some sessions. Suppose I disable some user account and I
All I can say, it is classical FUD.
On Jul 4, 1:16 pm, Mike Orr [EMAIL PROTECTED] wrote:
On 6/26/07, Jonas [EMAIL PROTECTED] wrote:
On 26 jun, 01:38, David Smith [EMAIL PROTECTED] wrote:
Jonas wrote:
I comment you the infrastructure that I would use in case we could
let me guess, you do not clear database session before/after each
request
On Aug 6, 12:02 pm, jose [EMAIL PROTECTED] wrote:
I have a perplexing problem and I'm really hopping that there is a
setting or something stupid that I've missed. Here is the issue, I
have an application most of my
i'm just wondering if rollback should be called if commit fails, i.e.
if there is difference between:
try:
...
except:
t.rollback()
else:
t.commit()
and
try:
...
t.commit()
except:
t.rollback()
On Sep 8, 6:23 am, Jose Figueras [EMAIL PROTECTED] wrote:
t =
Mike,
Thank you for posting tips like that and keeping them up to date.
There is small typo in load_environment section -- init_model is
referred as init_engine.
I'm using little different approach. Instead of defining init_model()
and calling scoped_session() with bind parameter I simply
Eric,
Apparently, your javascript code is calling Element.update() with
second argument that contains script tag with
show_button('extra_data_text', 'text version') as its text. Most
likely it is coming from Web server response to Ajax request.
On Feb 26, 2:47 am, Eric Ongerth [EMAIL PROTECTED]
Hi Sam,
On May 28, 6:12 pm, SamDonaldson [EMAIL PROTECTED] wrote:
Yes, lighttpd serving static and all dynamic requests forwarded to the
paster process talking SCGI. Should I make the switch to nginx as it
seems like everybody has something good to say about nginx, and it's a
good load
Hi Wichert,
What I use to avoid such repetitions is:
# in BaseController
# sequence of (param, attr, getter)
_fetch = []
def __before__(self):
for param, attr, getter in self._fetch:
setattr(c, attr, getter(getattr(c, param)))
# in CustomerController
_getters = (
('id',
Hello everyone,
I'm not sure if it is the right place to ask this question but trac at
http://beaker.groovie.org/ seems to be virgin.
Long story short. There is need for some API to enumerate all Beaker
sessions. Sessions are very useful when one needs to transform
stateless HTTP protocol into
Hello guys,
Do you mind if I chime in? I agree that verify should not use 400 HTTP
status code to indicate failure of verifying variable values. I don't
think that even an failure to parse HTTP request body should be
indicated in such a way as long as there were no failure on HTTP
protocol
Well, apparently, my idea on that didn't make it working because it
isn't much different if you use global or local reference to the same
proxy object. At the time that function is called real session and
request are referenced by them.
On Oct 18, 9:56 am, askel [EMAIL PROTECTED] wrote:
Adam
On Mar 20, 1:04 pm, lengani leng...@gmail.com wrote:
What sort of CMS/CMF do you secretly hope to be built on top of
Pylons?
If you need CMS why not use what was specifically designed that way? I
believe people who seek out-of-box CMS should not look at Pylons
because they dont need its power
It all depends on how much of CMS you need in your app. It could be as
simple as Wiki Pylons tutorial which I believe is classical (yet
rudimentary) CMS. My point is that Pylons is possible but not best bet
as long as CMS is concerned.
On Mar 20, 1:04 pm, lengani leng...@gmail.com wrote:
Hi
Edgar,
I'd define controller's __getattr__ method and return some dummy
action as following:
def _dummy_action(self):
...
def __getattr__(self, name):
return self._dummy_action
It will catch all other non-existant attribute requests but this is
probably simpliest working solution.
Cheers
Original poster says he wants to avoid NotImplementedError exception
which only happens in debug mode instead of returning 404.
On Mar 25, 4:27 pm, Wyatt Baldwin wyatt.lee.bald...@gmail.com wrote:
On Mar 25, 11:06 am, askel dummy...@mail.ru wrote:
Edgar,
I'd define controller's
Alexander,
Do you want to know how many children some Parent instance has? If
that's what you're looking for then len(parent.children) is one of
many ways to get answer. It is probably the best one if children are
eager loaded but it is most likely the worst one if they are lazy
loaded.
Cheers
Hello everybody,
I wasn't able to find any information on how to run Pylons app that
uses SQLAlchemy ORM on top of single-thread coroutine based WSGI
server like gevent.pywsgi.WSGIServer so I decided this information
could be usable for somebody else.
I was about to start small backoffice
I forgot to mention that make_psycopg2_green has to be called
somewhere like at the beginning of init_model call.
And the fun part was that I was able to do something like the
following:
# myproject/lib/app_globals.py
from gevent.event import Event
class Globals(object):
def __init__(self,
Hi Nik,
That code while it looks pretty much the same in WSGI server setup
would not work well for SQLAlchemy application because all database
access calls would be done in synchronous mode and that means for
instance that single query that takes long time to execute would block
entire web
Nik,
gevent documentations says the following:
The difference between wsgi.WSGIServer and pywsgi.WSGIServer is that
the first one is very fast as it uses libevent’s http server
implementation but it shares the issues that libevent-http has. In
particular:
* does not support streaming: the
Hello everybody,
It's been a while since this gevent-based library has been announced.
It's an FastCGI/WSGI server implementation using gevent. It has
reached beta-testing stage and everyone is welcome to try it. It can
be used as replacement for flup.fcgi.
I have published new version of
I'm pleased to announce gevent-fastcgi library. It allows you to
deploy your WSGI application using FastCGI protocol. It is still in
Beta stage and I'll greatly appreciate bug reports and ideas on how it
could be improved.
What makes it special? Well, gevent means greenlet co-routines are
used in
Hi Isaac,
I'm not a Pyramid expert but I'd play with mapper parameter of add_view or
view_config for that.
Alex K
On Tuesday, July 17, 2012 9:53:49 AM UTC-4, Isaac Jurado wrote:
Hello,
I would like to know if there is a way to add a fallback view name
when
a context is found but none
Hello everybody,
It's probably (most likely) not the best place to post this so please
excuse my annoyance.
Some time ago I made one of the projects I've been working on
available to everyone through Github.com and PyPi. There is seems to
be some interest in it -- according to PyPi download
Hi Daniel,
Thanks for your reply and the advice. That project is part of my paid
job so it's definitely worthwhile to me. I am a lucky one that's being
paid for what he loves to do.
- Alex K
On Aug 16, 1:26 pm, Daniel Holth dho...@gmail.com wrote:
I feel your pain, but you are doing amazingly
...@plope.com wrote:
On 08/16/2012 12:29 PM, askel wrote:
Hello everybody,
It's probably (most likely) not the best place to post this so please
excuse my annoyance.
Some time ago I made one of the projects I've been working on
available to everyone through Github.com and PyPi
Hi Jonathan,
Thanks for great idea to have home page that makes it super easy to
post comment. I'll work on that.
- Alex K
On Aug 16, 1:59 pm, Jonathan Vanasco jonat...@findmeon.com wrote:
there are a large number of automatic downloads from web crawlers that will
index or re-host the
Hello everybody,
It's probably (most likely) not the best place to post this so please
excuse my annoyance.
Some time ago I made one of the projects I've been working on
available to everyone through Github.com and PyPi. There is seems to
be some interest in it -- according to PyPi download
Hello everybody,
It's probably (most likely) not the best place to post this so please
excuse my annoyance.
Some time ago I made one of the projects I've been working on
available to everyone through Github.com and PyPi. There is seems to
be some interest in it -- according to PyPi download
Hello everybody,
I used Breve template engine for most of my Pylons projects and I
missed it when I switched to Pyramid so I wrote small module that
makes my life little easier.
It can be installed from PyPi as following:
easy_install pyramid_breve
or
pip install pyramid_breve
Once installed
I'm developing renderer library for Pyramid framework. It's just kind
of adapter to use existing template engine in Pyramid applications.
The library is using asset specs for template names. And I'd like it
to use application package name in case asset spec is missing package
part. Originally, I
UTC-4, Chris McDonough wrote:
On Tue, 2012-09-18 at 06:57 -0700, askel wrote:
I'm developing renderer library for Pyramid framework. It's just kind
of adapter to use existing template engine in Pyramid applications.
The library is using asset specs for template names. And I'd like
New version of Breve renderer for Pyramid framework has been released. It's
now possible to control important breve.Template parameters, namely tags,
xmlns and doctype.
For those who's never heard of
pyramid-brevehttp://pypi.python.org/pypi/pyramid-breve.
It's a package that adds Breve
Michael,
It seems to me that while Nginx is configured to connect to uwsgi via
socket file /tmp/uwsgi.sock you make uwsgi bind/listen to TCP port 8080.
- Alex
On Saturday, April 20, 2013 5:46:47 PM UTC-4, Michael wrote:
Hi, I get Internal Server Error running a pyramid sqlalchemy scaffold
On Tuesday, September 18, 2012 3:57:21 PM UTC+2, askel wrote:
I'm developing renderer library for Pyramid framework. It's just kind
of adapter to use existing template engine in Pyramid applications.
The library is using asset specs for template names. And I'd like it
to use application
I had similar problem when I was implementing Breve template engine
renderer (http://github.com/momyc/pyramid-breve). The challenge was that I
standard Pyramid technique of detecting calling package was failing because
call stack was deeper than it usually is and that renderer library package
I had similar problem when I was implementing Breve template engine
renderer (http://github.com/momyc/pyramid-breve). The challenge was that
Pyramid's technique of detecting calling package was failing because call
stack was deeper (and not even constant) than it usually is and that
renderer
Mike, take a look at Breve template
enginehttp://breve.twisty-industries.com/.
It does pretty much what you want.
On Tuesday, December 10, 2013 4:20:34 AM UTC-4, Mike Orr wrote:
Would you like class-based tag helpers to compose an HTML tag
imperatively over several statements? If so, what
would add a dependency to a whole template language
I'm afraid, avoiding dependency on some package by baking your own is
otherwise called reinventing the wheel
it looks like you have to put templates in a *.b file rather than
directly in your Python code.
Breve language IS a 100% Python
That flatten function is not needed. print page works just well.
On Wednesday, January 1, 2014 7:59:36 PM UTC-4, askel wrote:
would add a dependency to a whole template language
I'm afraid, avoiding dependency on some package by baking your own is
otherwise called reinventing the wheel
, 2014 at 3:59 PM, askel homo.pro...@gmail.com javascript:
wrote:
would add a dependency to a whole template language
I'm afraid, avoiding dependency on some package by baking your own is
otherwise called reinventing the wheel
Except when you depend on something large to avoid writing
60 matches
Mail list logo