[pylons-discuss] Static Files on Elastic Beanstalk

2017-11-01 Thread Andrew Burnett


I'm trying to serve some static css, png's, etc. from my Pyramid app that's 
hosted on Elastic Beanstalk. It works fine on my local machine but when I 
try to run on EB, neither the CSS nor the images are found. Here's the 
relevant code:


>From .ebextensions:


option_settings:
  aws:elasticbeanstalk:container:python:
WSGIPath: pyramid.wsgi
  aws:elasticbeanstalk:application:
Application Healthcheck URL: /health
  aws:elasticbeanstalk:container:python:staticfiles:
"/static/": "static/"


>From home.make




















>From static_config.py


from pyramid.security import NO_PERMISSION_REQUIRED
### INCLUDEME
def includeme(config):
"""Configure static endpoints.
"""
config.add_static_view(name='static',\
   path='app:static')

-- 
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 to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/b9be3daf-93cf-49c9-9ffd-f67d43e8289d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] How to enable JSON renderer as default for all views?

2017-11-01 Thread Michael Merickel
This renderer feature does not override the other one which is "if you
return a Response object then no renderers will be invoked". HTTPOk is a
Response subclass. This is covered in the first few paragraphs of the
renderer chapter. I'd be open to a PR that clarified the docs on this in
the section you linked since it does say "all views". It is infact "all
views that do not return something directly adaptable to a response such as
an implementer of IResponse, or an object whose type is registered as a
response adapter".

https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/renderers.html#renderers

On Wed, Nov 1, 2017 at 3:23 AM,  wrote:

> Hello,
>
> The documentation for the default renderer for all views
> 
> seems to suggest that the following should work:
>
> from pyramid.renderers import JSON
>
> config = Configurator(
> …
> )
> config.add_renderer(None, JSON())
>
> Alas, when one of the views returns HTTPOk() the response type is still
> html. How to I make JSON the default renderer here for *all* views?
>
> Thanks!
> Jens
>
> --
> 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 to pylons-discuss@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/pylons-discuss/d730910a-2425-48fa-841b-4f891ddc525e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAKdhhwFOhrfHpF0BG9vjpm_S0q_Pq69jaofVNEZzVuksOOkcrg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[pylons-discuss] How to enable JSON renderer as default for all views?

2017-11-01 Thread jens . troeger
Hello,

The documentation for the default renderer for all views 

 
seems to suggest that the following should work:

from pyramid.renderers import JSON

config = Configurator(
…
)
config.add_renderer(None, JSON())

Alas, when one of the views returns HTTPOk() the response type is still 
html. How to I make JSON the default renderer here for *all* views?

Thanks!
Jens

-- 
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 to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/d730910a-2425-48fa-841b-4f891ddc525e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.