Preceding backslash when using URL in ubuntu 16.04

60 views
Skip to first unread message

Ryan Herbert

unread,
Aug 28, 2016, 8:41:17 PM8/28/16
to web2py-users
Hi, I'm having an issue with generating url with the URL helper.

URL('default', 'home', scheme=True, host=True) will generate "\https://127.0.0.1/myapp/default/home"

I am using web2py from the python-web2py package from the ubuntu (or debian?) repos. Now I also have my app installed on a server running Ubuntu 14.04 and it works fine.
Does anyone know where this can come from ? I've been assuming I configured my app incorrectly after upgrading to 16.04, but I can't seem to find any issues with my configuration.

Any advice is much appreciated.
Cheers,

Ryan

Mirek Zvolský

unread,
Aug 29, 2016, 8:59:45 AM8/29/16
to web2py-users
Hi,
Web2py (I think) at this time has no pip/PyPI packaging and no Debian/Ubuntu packaging. All previous attempts are obsolete.

In Debian apt (Jessie testing) apt I see python-web2py version 2.12.3-1.
But we have 2.14.6 at web2py.com, Download.

I think you should switch to current version, using manual install (Download, Normal users, Source code).
Unzip to the web2py/ folder and run from it: python web2py.py

In my Web2py (2.14.5) when I run: python web2py.py -a "password" -M -S welcome
I will get:

In [1]: URL('default', 'home', scheme=True, host=True)
Out[1]: 'http://127.0.0.1:8000/codex2020/default/home'

In [2]: URL('default', 'home', scheme=True, host=False)
Out[2]: '/codex2020/default/home'

In [3]: URL('default', 'home', scheme=False, host=False)
Out[3]: '/codex2020/default/home'

In [4]: URL('default', 'home', scheme=False, host=True)
Out[4]: 'http://127.0.0.1:8000/codex2020/default/home'

So it looks like there is some issue with scheme= (has no efect), but not the issue that you describe.



Dne pondělí 29. srpna 2016 2:41:17 UTC+2 Ryan Herbert napsal(a):

Richard Vézina

unread,
Aug 29, 2016, 10:06:52 AM8/29/16
to web2py-users
You should consider using the script to properly install web2py : https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh

You can then work from this basic installation to secure it better and fine tune performance, configure proper database, etc.

Richard

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ryan Herbert

unread,
Sep 2, 2016, 9:22:56 AM9/2/16
to web...@googlegroups.com
Hello Mirek,

I installed the package via apt-get (Ubuntu) which is currently on version: 2.12.3-stable+timestamp.2015.08.19.00.18.03
So yes it is a little outdated, but the purpose for this is to package my app in a .deb, so this I believe is the cleanest solution for me.
Everything else seems to work fine, bar this URL, and this problem I already had when using the latest version from web2py.com

Richard: That script is the basis for my installation already, and since it is being used in production on a previous version of Ubuntu.

So I probably messed something up when reinstalling web2py after my upgrade to 16.04 :D.

I'm going to keep investigating to try to resolve this, and will keep the thread updated if I come up with a solution.

Ryan

Ryan Herbert

unread,
Sep 2, 2016, 10:15:17 AM9/2/16
to web2py-users
Hi,

I found the issue. $ signs were escaped in my nginx config. So this line was the offending line : uwsgi_param     UWSGI_SCHEME \$scheme; (amoung others).

That's what you get for copy/pasting from scripts I guess :/.

Ryan
Reply all
Reply to author
Forward
0 new messages