suggestion for scaffolds

25 views
Skip to first unread message

Jonathan Vanasco

unread,
Feb 3, 2012, 12:28:18 PM2/3/12
to pylons-devel

two quick suggestions for scaffolds. i'd be happy to submit a patch
if the maintainers agree:

1. Move cache_max_age to a dev.ini setting

scaffolds currently have this line:

https://github.com/Pylons/pyramid/blob/master/pyramid/scaffolds/alchemy/%2Bpackage%2B/__init__.py
https://github.com/Pylons/pyramid/blob/master/pyramid/scaffolds/starter/%2Bpackage%2B/__init__.py
https://github.com/Pylons/pyramid/blob/master/pyramid/scaffolds/zodb/%2Bpackage%2B/__init__.py
config.add_static_view('static', 'static', cache_max_age=3600)

That's great in production, but on dev you often need to test against
css/js/img changes

I found this approach works very well:
__init__.py
config.add_static_view('static', 'static',
cache_max_age=settings['static.cache_max_age'])
dev.ini
static.cache_max_age= 60

[ then i use 3600 on production.ini and 600 on staging.ini ]


2. migrate all the /static/ items to /static/pyramid/

it's too cluttered and slightly intimidating , and when you're playing
around... i want to clean out those files but I don't want to lose
them (yet).

Mike Orr

unread,
Feb 3, 2012, 12:32:34 PM2/3/12
to pylons...@googlegroups.com
On Fri, Feb 3, 2012 at 9:28 AM, Jonathan Vanasco <jona...@findmeon.com> wrote:
> 2. migrate all the /static/ items to /static/pyramid/
>
> it's too cluttered and slightly intimidating , and when you're playing
> around... i want to clean out those files but I don't want to lose
> them (yet).

+1

I usually delete them immediately, but when I started I was reluctant
to because I didn't know which ones I might want to use or refer to.

--
Mike Orr <slugg...@gmail.com>

Blaise Laflamme

unread,
Feb 3, 2012, 1:29:15 PM2/3/12
to pylons...@googlegroups.com
Good point... I'm currently rewriting the scaffold theme and hope to have it done before 1.3 release
Reply all
Reply to author
Forward
0 new messages