Re: [web2py] Re: How do I display uploaded images from uploads folder

2019-11-12 Thread Dave S


On Monday, November 11, 2019 at 10:39:58 PM UTC-8, Maurice Waka wrote:
>
> Thanks.
> Let me work it out.
> Regards
>
>>
>>
Also note that a file uploaded to an upload field is not stored with the 
name the user passed to the upload form; instead, it is stored with a 
mangled, er, obfuscated name, and to find the file you should expect to do 
a db query.  See Chapter 6 under Field Types.

/dps



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/33a47191-56bd-410f-8aec-9ddf08ff7063%40googlegroups.com.


Re: [web2py] Re: rename request hostname

2019-11-12 Thread Yoel Benitez Fonseca
H!

El lun., 11 nov. 2019 a las 17:03, Dave S ()
escribió:

>
>
> On Monday, November 11, 2019 at 7:12:44 AM UTC-8, Yoel Benitez Fonseca
> wrote:
>>
>> h!
>>
>> Is it possible to change the hostname that comes in the form request  so
>> that outbound links have the hostname i want?
>>
>
> I think you want to look at routes.py, but I haven't tried this use case,
> so any details I could give you are in the book.
>


No, I know what my mistake is, some of the links are generated by *URL*,
using the *host* and *scheme* parameters. In case it serves anyone else,
all this is deploying the app as a lambda funsion on AWS with zappa with an
NGINX in front as a proxy.

I guess I will have to hard code  the host directly in the code.



>
>
>>
>> I have an app in an internal network that I want to make visible from the
>> outside with an nginx proxy, all relative links work correctly, this would
>> be the example of configuration in nginx:
>>
>> location ~* ^/(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
>>  rewrite ^/(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$
>> /some-folder/statics/staging/$2 break;
>> proxy_ignore_headers Cache-Control;
>> add_header Cache-Control public;
>> add_header Cache-Control max-age=31536000; # seconds, one year
>> proxy_pass_request_headers  on;
>> proxy_pass https://some.internal.server.local;
>> }
>>
>> location ~* ^/(.*)$ {
>> rewrite ^/(.*)$ /staging/$1 break;
>> proxy_set_header Host "some.internal.server.local";
>> proxy_set_header X-Real-IP $remote_addr;
>> proxy_ssl_server_name on;
>> proxy_pass https://some.internal.server.local;
>> }
>>
>>
>> That works correctly for any relative link, the problem comes with
>> uploads, whose links are being generated for some reason including the
>> hostname:
>>
>> https://some.internal.server.local
>> /app/download/some.object.a051462ffdcb77a3.746d706c32417038422e6a7067.jpg
>>
>> and how it happens, i can't change the internal server name and need to
>> pass the proxy_set_header Host or I will not have access to that host... The
>> only thing I can think of is telling WEB2PY to use a fixed host name when
>> generating the links.
>>
>>
> /dps
>
>
>
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/c747477d-0665-45ba-92f5-e2a87e2d1fca%40googlegroups.com
> 
> .
>


-- 
Msc. Yoel Benítez Fonseca

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAFDb1rVwfPpsSoAzyymWZdJG%2Bo6pOg9zP9ukNFkMJcZ%3DquzReA%40mail.gmail.com.


[web2py] Re: Redis session error - latest web2py master

2019-11-12 Thread Jim S
Just wondering if there has  been any further work on this.

I'm working on converting all to python 3 but this is keeping us from 
moving right now.

-Jim

On Wednesday, November 6, 2019 at 5:34:16 PM UTC-6, Jim S wrote:
>
> Same here.  I've reported and submitted a fix but it was rejected.  It 
> worked for all of our use cases.
>
> On Wednesday, November 6, 2019 at 9:19:07 AM UTC-6, Leonel Câmara wrote:
>>
>> We also got this bug when we tried to upgrade to the latest web2py and 
>> had to rollback. We were using the old 2.X pyredis and then tried with 3.X 
>> you get the same problem with both. Please report this issue in github, if 
>> no one fixes it we will probably end up fixing it as we also need this fix.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/82586ec8-7c71-4a91-86ad-ff314502e354%40googlegroups.com.