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.
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-discuss@googlegroups.com wrote on 11/14/2012 04:28:59 PM:
> Ellison Marks <gty...@gmail.com> > Sent by: pylons-discuss@googlegroups.com
> 11/14/2012 04:28 PM
> Please respond to
> pylons-discuss@googlegroups.com
> To
> pylons-discuss@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-discuss@googlegroups.com.
> To unsubscribe from this group, send email to pylons-discuss
> +unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/ > group/pylons-discuss?hl=en.
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-discuss@googlegroups.com wrote on 11/14/2012 04:20:08 PM:
> JPe...@ykksnap-america.com > Sent by: pylons-discuss@googlegroups.com
> 11/14/2012 04:20 PM
> Please respond to
> pylons-discuss@googlegroups.com
> To
> pylons-discuss@googlegroups.com
> cc
> Subject
> Re: Recommendations for having a static index page
> 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-discuss@googlegroups.com wrote on 11/14/2012 04:28:59 PM:
> > Ellison Marks <gty...@gmail.com> > > Sent by: pylons-discuss@googlegroups.com
> > 11/14/2012 04:28 PM
> > Please respond to
> > pylons-discuss@googlegroups.com
> > To
> > pylons-discuss@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-discuss@googlegroups.com.
> > To unsubscribe from this group, send email to pylons-discuss
> > +unsubscribe@googlegroups.com.
> > For more options, visit this group at http://groups.google.com/ > > group/pylons-discuss?hl=en. > -- > 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
> +unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/ > group/pylons-discuss?hl=en.
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?
> 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 <javascript:> wrote on 11/14/2012 04:20:08 PM:
> > JPe...@ykksnap-america.com <javascript:> > > Sent by: pylons-...@googlegroups.com <javascript:>
> > 11/14/2012 04:20 PM
> > Please respond to > > pylons-...@googlegroups.com <javascript:>
> > To
> > pylons-...@googlegroups.com <javascript:>
> > cc
> > Subject
> > Re: Recommendations for having a static index page
> > 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 <javascript:> wrote on 11/14/2012 04:28:59 > PM:
> > > Ellison Marks <gty...@gmail.com <javascript:>> > > > Sent by: pylons-...@googlegroups.com <javascript:>
> > > 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<javascript:> > . > > > To unsubscribe from this group, send email to pylons-discuss > > > +unsub...@googlegroups.com <javascript:>. > > > For more options, visit this group at http://groups.google.com/ > > > group/pylons-discuss?hl=en. > > -- > > You received this message because you are subscribed to the Google > > Groups "pylons-discuss" group. > > To post to this group, send email to pylons-...@googlegroups.com<javascript:> > . > > To unsubscribe from this group, send email to pylons-discuss > > +unsub...@googlegroups.com <javascript:>. > > For more options, visit this group at http://groups.google.com/ > > group/pylons-discuss?hl=en.
I would just use waitress until things are settled
out.
jim
Ellison Marks <gty...@gmail.com> Sent by: pylons-discuss@googlegroups.com
11/14/2012 04:57 PM
Please respond to
pylons-discuss@googlegroups.com
To
pylons-discuss@googlegroups.com
cc
Subject
Re: Recommendations for having a static index page
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?
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
> 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. > -- > You received this message because you are subscribed to the Google > Groups "pylons-discuss" group.
> 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.
-- 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/-/HReaqwx9wnYJ.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to pylons-discuss+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
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.
On Wednesday, November 14, 2012 4:57:53 PM UTC-5, Ellison Marks wrote:
> 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?