for tracking purposes, i created a stub issue for the docs referencing this
thread
--
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
Just want to give a quick warning that a lot of the pdf libraries use crazy
amounts of memory. I have no experience with pdfkit, and it may behave
differently.
If it causes issues with memory/performance, I usually handle this stuff in
Pyramid one of two ways:
a- I segment out the PDF
I'd be interested to know how you eventually achieve this, so please post
an update!
I ran into the same problem a few years ago, and the Auth docs weren't
really written yet... so I just ditched Pyramid's Auth system and we built
our own.
--
You received this message because you are
i've never seen pyramid-kvs before.
pyramid_redis_sessions is actively discussed here, is recommended in the
docs, and has contributions by at least one of the core pyramid developers.
pyramid_kvs may be better for a variety of reasons, but i'd be more
inclined to select pyramid_redis_sessions
On Wednesday, December 24, 2014 1:52:53 PM UTC-5, Mike Orr wrote:
I think I misunderstood what you meant. You mean to display the
current session (in which case it can pull it from 'request.session'
without knowing the session ID)? I do do that in some applications,
and that may be the
Yeah, it's because the cookievalue is signed:
https://github.com/ericrasmussen/pyramid_redis_sessions/blob/master/pyramid_redis_sessions/__init__.py
Using the pyramid functions by default, which serializes to b64:
On Tuesday, December 23, 2014 4:56:15 PM UTC-5, Mike Orr wrote:
Works. I'll just need to write a script to dump the session.
I like do to things like this in behind a /admin page, this way I can see
everything in real time (and use pprrint)
--
You received this message because you are
On Monday, December 22, 2014 3:40:11 PM UTC-5, Tres Seaver wrote:
The mailer is a utility (a singleton), registered in 'request.registry'.
Just to expand on this answer a bit...
The mailer is designed to be configured-for and associated-with the scope
of an application -- not each
I've never used Pyramid under windows, so I could be off here...
But when running under Mac/Linux, one can trip 500x error that just says
Invalid Request (or similar) under a few scenarios:
• exceptions in the wsgi middleware stack
• exceptions in most areas of the debugtoolbar code
•
I'll preface this by saying that I'm biased towards Pyramid, and when I
have to program - I prefer it. I begrudgingly program though - I'm usually
on the business/product/management side. But in the past 3 years: I've
been working extensively with Pyramid on a personal project, was CTO of a
To phrase things slightly differently:
Wordpress is a fairly high-level Web Application that has a rigid internal
API that deals with Admin Consumer views, requires a singular database
connection (mysql), and offers a plugins and theming architecture. Plugins
interact with the internal API
Yes with www. But of course it can also be a different domain.
Great! Some people just don't realize that. Glad you do.
If you're really worried about theoretical optimal speeds, the approach I
like is to use getting a dedicated domain that is 4-5 characters on a 2
letter extension (i.e.
On Tuesday, November 11, 2014 3:03:52 PM UTC-5, Marc Rijken wrote:
In my situation the CDN is behind a different domain name as the main
site: cdn.example.com vs www.example.com. In bowerstatic you can define
that the statics assets will have a different base than the regular pages.
I cleaned up some code used to monitor dogpile caching through the
debugtoolbar
the package works by wrapping api calls to a dogpile cache region, and
logging their performance (timing, hit/miss, key, etc)
statistics and raw data are both shown in the debugtoolbar, with everything
colorcoded
that is a perfect commit message!
--
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email
Re: SqlAlchemy
The first thing I do with problems like this, is to remove every single
.pyc and .pyo file in my projects' directory tree.
9/10 times, the problem is that I changed the some imports and old .pyc
files are being picked up. one way this can affect you is in this example:
if you
I jut got confused on that too, because I read it too fast.
It might be more clear if the line:
The steps each correspond to a directory in this repo, where each
step/topic/directory is a Python package.
was in it's own paragraph.
--
You received this message because you are subscribed to
A slight variant is to dispatch on the init:
class MyThing(object):
def __init__(self, **kwarg):
s = kwarg['source']:
if s == 'db':
self._init_db(**kwarg)
elif s == 'json':
self._init_sson(**kwarg)
else:
raise ValueError(invalid source)
def _init_db(self, **kwarg):
pass
def _init_json(self,
You have 3 options:
1. Generate the CSS in your main template (in a style section)
2. Generate the CSS as a dynamic file
3. Use a static CSS file, and generate CSS overrides in the main template
(in a style section)
I prefer option 3.
--
You received this message because you are subscribed
A while back I had a lot of issues debugging Ajax requests, as the toolbar
only shows the passive request data. I had to manually recreate the url
(using a mix of web browser devtools and custom logging) and paste it into
a new browser window to get to the active tools that the debugtoolbar
i'm using url dispatch , and I have some routes that begin with this:
/by/{username:\w+}
i now need to support 'id' based urls as well. e.g.
/by/{userid:\-\d+}
the regexes are actually more complicated, and defined elsewhere.
there is an approach i think I'd like to pursue, and
Thanks! It looks like Route Factory is what I want.
The docs are pretty sparse on it (at least on
http://docs.pylonsproject.org/docs/pyramid/en/latest/narr/urldispatch.html)
I'll look up some examples in public Pyramid projects and blogs later.
I didn't realize that I could affect the dict
wow. thanks. that is a much cleaner explanation than the docs.
converting to a factory was ridiculously simple!
--
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email
I recommend that you don't do this.
It sounds convenient now, but as your project or package matures, you will
end up creating an unmaintainable mess.
The big benefit of having declaring all the routes together, is that you
have a single chunk of code that maps every single route -- and lets
I'm having two issues with logging on production. Hoping someone can point
out my mistake
First- My production.ini has the root logger set to WARNING
[logger_root]
level = WARNING
handlers = console
One (unconfigured) package would often end up logging at the DEBUG level
with
I don't have an exact answer, but I can give you a starting point -
It's my understanding that with the datastax driver/api, there is a large
initial connection hit, and most people want to re-use the same same
Session across multiple requests to minimize that. It looks like a popular
The `new transaction` + `commit` messages for every debugtoolbar hit were
starting to be too much noise on my dev environment. (every 5 seconds or
so, an ajax request is made by the toolbar)
i couldn't find a good way to suppress them within the debugtoolbar itself,
so ended up just dropping
On Thursday, September 25, 2014 1:21:33 PM UTC-4, tonthon wrote:
1- Use something like sqlautocode to dynamically build models regarding
your existing database structure
2- Migrate tables to fit your declared models
3- Delete your tables
You'll use 1 and 2 if you'd like to keep the
most of these questions are more SqlAlchemy oriented, not about pyramid.
the initialize_db stuff is only needed when you're creating a database from
scratch. many people don't do that. there are a handful of SqlAlchemy
oriented projects on PyPi that will build a declarative based models.py
Try searching shared memory gunicorn
While gunicorn doesn't support shared memory, there are a lot of
workarounds on various lists and stack overflow to solve your exact need.
Most of them seem indexed under the shared memory concept.
--
You received this message because you are subscribed
commandline
$ pip install pyramid_mailer==4.1
setup.py:
install_requires = ['pyramid_mailer ==4.1']
--
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
On Thursday, September 4, 2014 6:35:36 AM UTC-4, Paul Everitt wrote:
Lately I've been doing a lot of frontend development: AngularJS talking to
a REST API in Pyramid. Which also means the modern frontend toolchain: npm,
bower, grunt/gulp, with Karma/Protractor for testing. Do you think I
A better way to state what I meant to say: I think the more attractive
proposals offer a few things:
• They're not just concerned with HOW to use something, but WHY people
should use it
• They show people how to do something the right way or a better way
than they currently handle
• They
There are also a bunch on the PyCon Video Archive:
http://pyvideo.org/search?models=videos.videoq=pyramid
--
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
it's late and i'm still in the office, so here's some probably bad ideas
that might help until someone can answer tomorrow from similar experience.
My question is, can I get it to just store a native Redis hash?
I don't know this package at all but I spent a lot of time with `dogpile`
and
On Tuesday, July 29, 2014 6:59:05 PM UTC-4, Laurence Rowe wrote:
If you are only interested in using the database roles for authorization
rather than authentication then you could switch role at the beginning of
the transaction so you don't have to deal with custom connection pooling,
I have a bit of non-pyramid/sqlalchemy insight / warnings for this:
with this design pattern, you're going to need to pay close attention to
the database server setup, and (probably) either disable connection pooling
or create some sort of management for it. depending on usage, you have the
The docs would suggest that you're fine for this use case
http://docs.pylonsproject.org/projects/pyramid/en/latest/api/threadlocal.html?highlight=get_current_request#pyramid.threadlocal.get_current_request
This function should be used extremely sparingly, usually only in unit
You can just use the SqlAlchemy events as in the examples in the SqlAlchemy
docs.
If you need to access the current request, you can use Pyramid's
`get_current_request`, which is rather lightweight.
Just a quick bit of forewarning / pIanning -- t's usually best to keep the
pyramid code
As far as pyramid is concerned, all you really need is something like this:
class ClassBasedView(BaseObject):
@view_config( route_name=order_json_api, renderer=json)
def order_json_api(self):
custom_json_data = json_data( self.request ) ## returns a dict
return custom_json_data
You can
This works under Pyramid for me
-- https://gist.github.com/jvanasco/17e1118b3f04dee75353
IIRC before|after update triggers within the context of a flush ( either
explicit or part of a commit ) and the SQL for a class actually being
emitted.
Is it possible that you're not calling
Torsten--
Thanks for the tip! I had no idea about Invoke, and I immediately noticed
that it's written by the developer who maintains Fabric. Then I read this
page about Invoke + Fabric 2.x http://www.fabfile.org/roadmap.html
--
You received this message because you are subscribed to the
On Tuesday, July 8, 2014 1:51:04 PM UTC-4, Michael Merickel wrote:
In my own software there is a build step in our deployment pipeline
that aggregates these assets. This pipeline however has nothing to do
with pyramid or python. There's just a bash script that knows to move
the assets
On Tuesday, July 8, 2014 10:19:31 AM UTC-4, Paul Everitt wrote:
1) Visually grouping related views. Let's say you have a BlogEntry. It has
a few views. I personally like having a BlogEntryView view class to group
them together. Just an aesthetic point.
We typically use class methods
If you have expensive calculations, you can just lock them down onto a POST
page under HTTPS with a CSRF token. That will eliminate most issues.
You can also segment expensive routes to run in their own application
instance , and throttle users (based on session, ip, etc ) so that general
I don't think pylonshq is used anymore. Those links should probably be
fixed. I'll file a ticket.
You might be able to just remove these 2 lines from setup.cfg:
[easy_install]
find_links = http://www.pylonshq.com/download/
You can grab most (all?) of the packages from
I just wanted to pull all these links together into this thread for
reference::
There's already a bit of discussion on that:
* https://github.com/Pylons/pyramid/issues/1336
This seems to be a tangent to another discussion (which you started!) here :
*
If your result-set is small, have you considered
tempfile.SpooledTemporaryFile - or slurping the entire DB record from the
database within the view?
--
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To unsubscribe from this group and stop
fwiw, uwsgi has a `post_fork_hook` that might be useful for you.
in order to use pycrypto on uswgi , you have to do something like this in
pyramid:
import uwsgi
from Crypto.Random import atfork
def post_fork_hook():
atfork()
You can use Command Line Pyramid for this.
http://docs.pylonsproject.org/docs/pyramid/en/latest/narr/commandline.html
1. Create a Python script that loads the pyramid API and bootstraps a
request object.
2. Do whatever you want.
3. Trigger the script with whatever scheduling software you
among the various optimizations, -O / PYTHONOPTIMIZE will strip out
`assert` statements
i came across 4 assert statements in the pyramid core; they just looked to
be runtime checks
everything seems to run fine... and I'm getting around a 20% performance
bump on speed so far
just wanted to
since you're using sqlalchemy, you could use a pyramid subscriber to
configure the session / engine... and use one of sqlalchemy's hooks to
automatically filter for you.
https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/PreFilteredQuery
On Monday, May 19, 2014 7:06:20 PM UTC-4, Randall Leeds wrote:
http://docs.pylonsproject.org/projects/pyramid/en/master/narr/renderers.html#using-the-add-adapter-method-of-a-custom-json-renderer
FWIW, I found it more beneficial to use a custom JSON serializer and make
it available via a
long day...
i meant that at some point you may be using a variety of scripts/apps that
somehow interact with your project (celery, twisted, etc). If you rely on
the pyramid rendering framework for this, you essentially become dependent
on Pyramid for this.
If you have a standalone package
On Thursday, May 8, 2014 8:08:37 PM UTC-4, Chris McDonough wrote:
On 05/08/2014 04:42 PM, Jonathan Vanasco wrote:
I understand this to mean (from your earlier emails, you don't expressly
say it above) that you want to be sure that there is a existing session
that has the id 123 if you
On Thursday, May 8, 2014 7:16:43 AM UTC-4, Chris McDonough wrote:
All of the above use cases presume that you have visibility into the
session implementation's backend to load data. If you do, that's fine,
but there are no APIs in Pyramid that provide this functionality, so
you're
On Thursday, May 8, 2014 1:40:58 PM UTC-4, Chris McDonough wrote:
I'd be surprised. That'd presume the two implementations stored data in
the exact same way, which might well be the case, but can't be assumed.
If it didn't break, it'd only be by happy accident.
agreed. most just
I don't think this is doable.
if you have this route accept slashes
/{base_id}/{sub_id_with_slashes}
than how do you differentiate these 2 routes ?
/{base_id}/{sub_id_with_slashes}
/{base_id}/{sub_id_with_slashes}/{some_text}
this url would match both patterns :
which is why I keep badgering him to weigh in on this issue only.
sorry, i feel a bit clearer on what you want to hear now.
for this particular need, the others tabled, it's largely testing and
troubleshooting -- and it is a bit more advanced.
things we've used that key for in the past
This doesn't make much sense to me.
Wouldn't there be much more utility to have the response_callback AFTER the
response is created, this way it can operate on the response object?
I did some digging in the source, and came across this change:
On Saturday, May 3, 2014 7:02:46 AM UTC-4, Chris McDonough wrote:
Sure. It's always a tradeoff, though. If we over-specify the session
interface, it makes session implementers' lives harder, and may reduce
flexibility for consumers.
I agree there is a tradeoff, but I don't see how
On Wednesday, April 30, 2014 4:28:49 PM UTC-4, Chris McDonough wrote:
By the way, thank you for keeping up with this discussion, I know
debating about things with folks who don't share your point of view can
get pretty boring and frustrating.
Thanks, and right back at you on both
On Thursday, May 1, 2014 12:52:17 AM UTC-4, Michael Merickel wrote:
It sounds like you'll be interested in subscriber predicates.
http://docs.pylonsproject.org/projects/pyramid/en/1.5-branch/narr/hooks.html#subscriber-predicates
Personally I send emails from message queue in a separate
Understood.
We use PostgreSQL as the default messaging queue for development
configurations. Less moving parts than also running Redis (which is in
production / staging and what the backend devs and contractors use
locally).
It works, but I wouldn't want to put it into production. Our
i need to ship, so am cutting a corner.
I came up with this quick snippet to provide eventless rendering until
there's time for a proper solution.
it just loops together the `render()` and `RendererHelper.render()`
functionality.
https://gist.github.com/jvanasco/e39fe984015a25e9aa33
--
The focus of this discussion shouldn't be the merits, drawbacks, or
implementation details of server-side sessions vs client-side sessions --
which everyone is quick to chime in on. We can talk about that all day.
We have, many times..
My concern isn't that there is a session_id variable in
Does anyone have a recommendation for making the current request (for the
debugtoolbar itself) available to custom panel templates ?
i just realized that the request which is passed along is the original
request -- not the request for the debugtoolbar panel.
i tried passing into a template
oh!
so the panel is generated during the first request (__init__) and attached
to the history; then looked up and rendered in the toolbar views ?
--
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To unsubscribe from this group and stop
this entire package makes so much more sense now. wow.
--
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email
to pylons-discuss+unsubscr...@googlegroups.com.
To post to
We've run into an annoying edge-case with our use of BeforeRender.
Our app utilizes BeforeRender to optimize priming/loading our object cache
and data standardization. It's awesome and works great.
We recently noticed some odd bugs and a general slowness from caches that
weren't primed
A few thoughts, no answers or suggestions (other than the first )
- if you need to do internal requests, use `requests`. `urllib` is the
devil.
- if this is just a handful of views, I would probably have Pyramid1 set an
auth-token, either as a cookie a get argument, and redirect to Pyramid2.
On Monday, April 28, 2014 11:46:22 PM UTC-4, Bert JW Regeer wrote:
What are you using the session ID for?
Performance logging (session_id into statsd and logs). Unit Testing.
Integrated Testing. Automated Test suites. Development Troubleshooting ;
Production Customer support.
Often times
1. Like I mentioned above, but not very clearly, the big reason why I
dislike the pyramid_session_[foo] approach, is that the only
standardization is how it adapts to the ISession interface. There's no
standardization on the (de)serialization interface. With the Beaker model,
almost
On Monday, April 28, 2014 1:11:17 PM UTC-4, Chris McDonough wrote:
As the class docstring indicates, the only contstraints on keys and
values are that they must be pickleable. If some sessioning
implementation does not provide this feature, it doesn't meet the
ISession interface (which
FWIW, I handle my user interactions like this:
there's a 'normal' pyramid beaker session on http sessions used to maintain
login state and display data. ( request.session )
there's a secondary https only session , provided by a quick library i put
together ( request.session_https )
i keep the log files on the actual root in /var/log/MyApp . they can get
large , and that is on it's own partition ( so nothing dies if the logs
don't rotate by accident )
--
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To unsubscribe from
You can still use pyramid_beaker. It works fine under pyramid 1.5 .
There are a few heated discussions in the archives over it. It's a sore
point for many. I could be wrong on this, but last I checked it's not so
much deprecated as it is off the radar.A lot of us still use it for
On Wednesday, April 23, 2014 12:56:11 PM UTC-4, Chris McDonough wrote:
Right, it's just not maintained. If someone wants to maintain it,
they're free to pick it up. I wrote the original bindings but I
can't/won't maintain it anymore. The Beaker code itself has no current
maintainer,
On Wednesday, April 23, 2014 2:23:03 PM UTC-4, Chris Rossi wrote:
sudo apt-get install redis-server is pretty easy. Then you have a
service on localhost listening to the default port, there's pretty much
zero configuration required.
It's a breeze to run and manage for sure; especially
i'm not sure if this holds true in zodb.
but if you're using SqlAlchemy and didn't do any actual database work,
calling `commit()` has no perceptible effect. sqlalchemy doesn't actually
talk/connect to the database until you do the first query in a session.
in practice...
1. you
I never came into a good unit-test strategy for non-full stack operations.
I do have a workaround.
I ended up using a bootstrapped command-line pyramid script. That starts
up and manages a Request for me. I don't use pyramid_tm for database
yet, so am a little unsure of this... but...
I
oh sweet. thanks.
for some reason, i didn't think of looking at the pyramid_mako docs. I
went through pyramid docs, and the the pyramid+pyramid_mako source, but not
the pyramid_mako docs. sigh.
On Thursday, April 3, 2014 9:06:51 PM UTC-4, Michael Merickel wrote:
pyramid_mako has the
I've run into a situation where I have some application code in a .mako
file as a 'def' statement. this filefunction is used by several other
templates.
i've come into the situation where I now also need to render this def
directly.
i can handle that in the Mako API itself using something
What do you mean by Auto Commit ?
1) SqlAlchemy has an auto-commit mode. That means you do not wrap
statements in transactions, and data is directly written to the tables.
You would still need to call a flush() for SqlAlchemy to talk to the
database though. SqlAlchemy will not talk to the
Assuming this is SqlAlchemy, your only option is to call flush().
`flush()` simply tells the session to talk to the database.
if you don't call `flush()` or `commit()`, SqlAlchemy doesn't talk to the
database, and has no way of obtaining an id.
i think requiring an explicit command to talk to
I'll second using Celery. I use it for the exact same things - Pyramid is
used to handle the request(s) and ask for some work to be completed.
Celery is used to handle the work.
I don't like the idea of forking new work off Pyramid. Pyramid is your web
server. You should really have it
Cool. I'm really interested in how you're deploying and scaling pyramid ,
and hope you'll be able to share some of that.
--
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an
Can you share any details about how you are deploying it? ( number of
servers, uwsgi vs gunicorn vs others ) ?
--
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
After struggling with a decision for a while, I ended up just using fabric
and building this into our deployment routine.
Our pyramid app toggles different includes between Production and Testing
(based on environment.ini variables):
- production
* uses compressed / minified / joined /
We've been building a fairly large system for the past 2 years. Hopefully
going into public beta soon. It deals with a lot of the same concepts as
you're talking about. We've got a website, a twisted daemon and a celery
daemon.
The big tip I can give you is to consider how much you'd like
It wouldn't be too hard to use Pyramid as-is, then just have a pyramid
command-line script that can loop through everything and build out the site
for you.
--
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To unsubscribe from this group and
The only way to affect the # on an invalid form submission would be with
Javascript -- which means that I'd have to stash the 'active-pane'
somewhere on the request object ( to render in the template ).
I could , potentially, post to 'http://path/to/submit#active-tab' -- and
not necessarily
Wondering if anyone else has run into this...
I have some forms in bootstrap that are in tab-panes. In order to handle
a form re-print, one needs to show the tab by specifying an active css
class on the tab and tab-pane (or triggering a js action). The name
of the 'active' tab/pane set is
thanks for the fast reply. i've experimented with that on a few views
before, but never for a form submission.
do you POST into /path/to/submit#pane ?
On Tuesday, March 4, 2014 12:09:09 PM UTC-5, Vincent Catalano wrote:
When dealing with bootstrap's tabs I prefer to handle which tabs should
Thanks for the clarification. That solution won't work for us. We only
redirect on form success, not on form error. form errors are handled
within that request. redirecting to a form page with GET would be a pain,
because we'd have to encode the entire form submission into a GET string
and
In addition to what Vincent noted, I also like to do the following:
|-- models
|-- __init__.py
|-- _core.py
|-- api.py
_core.py -- anything that is shared across the other files in the package.
i.e. a base class, mixins, etc
api.py -- although I still import everything into
1. Depending on your database/infrastructure, I don't think the sqlalchemy
url necessarily needs to be protected. Someone would need to gain console
access to one of our servers in order to connect with our DBs, and at that
point... security concerns like that are a lost cause.
2. Third-Party
should this be a simple upgrade, or are there any migrations to do, things
to watch out for ?
--
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
ldap compatibility is by no means a measure of utility to web-applications.
i've seen very few webapps need ldap, though many GUI and email systems
often need it.
i'm wasn't a fan of python3 for web development about a year ago, because
most of the core web utilities I needed weren't ported
The panel api was definitely changed. The docs were not. Ticket submitted.
The previous versions rendered a template in a way that is 'typical' of
pyramid apps in a 'content' function.
The new version renders a template based on a 'self.data' dict that is
populated on __init__ ; not having
401 - 500 of 1275 matches
Mail list logo