Re: Recommendations for having a static index page

77 views
Skip to first unread message

JPe...@ykksnap-america.com

unread,
Nov 14, 2012, 4:20:08 PM11/14/12
to pylons-...@googlegroups.com
In production, most people use a static webserver
for this.  Read  nginx or apache2.  Typically you
might serve all content with the static server and
reverse proxy to pyramid for the dynamic content.

You can also look at uwsgi or mod_python as the pyramid
WSGI server, but it is usually easier to set up reverse
proxy.  Just don't get confused and try to set up both.

jim penny

pylons-...@googlegroups.com wrote on 11/14/2012 04:28:59 PM:

> Ellison Marks <gty...@gmail.com>

> Sent by: pylons-...@googlegroups.com
>

> 11/14/2012 04:28 PM
>
> Please respond to
> pylons-...@googlegroups.com

>
> To

>
> pylons-...@googlegroups.com

>
> cc

>
> Subject

>
> Recommendations for having a static index page

>
> So I've been learning pyramid, and I'm not sure of the best way to
> serve a static page from root. I've got a few ideas, but would
> appreciate more experienced input.

> 1. Use a template. This strikes me as a pretty bad idea right off.
> 2. Have the main page redirect to a static page. Not entirely
> desirable, but it would work well enough, I think.

> 3. Use paster's urlmap to serve the static page from root and the
> app from somewhere below that. Seems slick, but maybe limiting on
> how I could construct urls. Everything would have to be below /
> appname, rather than just /. Unless there's some way I could map
> different parts of the app to different parts of the urlmap. @_@

> 4. Have the web server handle it. Sort of another variation on 3,
> with similar limitations it seems.

> For reference, I'm using the zodb scaffold. Thanks in advance.
> --
> You received this message because you are subscribed to the Google
> Groups "pylons-discuss" group.
> To view this discussion on the web visit
https://groups.google.com/
> d/msg/pylons-discuss/-/wwcN_pJUkSwJ.
> To post to this group, send email to pylons-...@googlegroups.com.
> To unsubscribe from this group, send email to pylons-discuss
> +unsub...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/
> group/pylons-discuss?hl=en.

JPe...@ykksnap-america.com

unread,
Nov 14, 2012, 4:26:24 PM11/14/12
to pylons-...@googlegroups.com
On second reading, I am not sure that what I
wrote makes sense.  I think you want something
a bit different.  Are your trying to automatically
generate the index page?  How often do you expect
the index page to change?

[In general, pyramid does not do a great job of
handling purely static data.  It works, and it is
fine for debugging, but it is relatively slow and
may require more memory than systems tailored for
static data.]

jim penny

pylons-...@googlegroups.com wrote on 11/14/2012 04:20:08 PM:

> JPe...@ykksnap-america.com

> Sent by: pylons-...@googlegroups.com
>

> 11/14/2012 04:20 PM
>
> Please respond to
> pylons-...@googlegroups.com

>
> To

>
> pylons-...@googlegroups.com

>
> cc

>
> Subject

>
> Re: Recommendations for having a static index page

Ellison Marks

unread,
Nov 14, 2012, 4:57:53 PM11/14/12
to pylons-...@googlegroups.com
Thanks for the quick reply.

No, I think you had it right the first time, the index page will probably change almost never. Out of curiosity, would it be a good idea to mock up some sort of index page and still use waitress for development, or go to an actual web server now?

Malthe Borch

unread,
Nov 14, 2012, 5:04:54 PM11/14/12
to pylons-...@googlegroups.com
On 14 November 2012 22:28, Ellison Marks <gty...@gmail.com> wrote:
> Use a template. This strikes me as a pretty bad idea right off.

The `pyramid_skins` package provides a small "framework" that
addresses this (and other) need:

http://packages.python.org/pyramid_skins/

\malthe

JPe...@ykksnap-america.com

unread,
Nov 14, 2012, 4:56:45 PM11/14/12
to pylons-...@googlegroups.com
I would just use waitress until things are settled
out.

jim


11/14/2012 04:57 PM

To view this discussion on the web visit https://groups.google.com/d/msg/pylons-discuss/-/HReaqwx9wnYJ.


To post to this group, send email to pylons-...@googlegroups.com.

To unsubscribe from this group, send email to pylons-discus...@googlegroups.com.


For more options, visit this group at

http://groups.google.com/group/pylons-discuss?hl=en.

Jonathan Vanasco

unread,
Nov 14, 2012, 11:34:10 PM11/14/12
to pylons-...@googlegroups.com
for a current project:

DEV
nginx - port 80
proxy pass to pserve ( waitress ) - port 5020

PROD/STAGING
nginx - port 80
uwsgi integration to pyramid

i decided that using nginx on dev was just a lot easier for me
a- i just launch it once, and its no real drain on my mac, so i only have to auth to bind to port 80/443 once
b- it makes writing/debugging http/https stuff so much simpler.
c- it makes dealing with static/nonstatic stuff simpler too.

of course i need different nginx setups on each machine as the directories and deployments are different, but developing against it has made that very very simple.
Reply all
Reply to author
Forward
0 new messages