Sorry, I meant a page for HTTP 400 errors, not 404 errors, e.g. when I call
raise
HTTP(404, 'bad values'), but the principle is the same.
On Sunday, 19 April 2020 22:28:12 UTC+1, Yan Wong wrote:
>
> I want to have a custom styled page for my 404 errors, so that when I do
> raise(404, 'bad valu
I want to have a custom styled page for my 404 errors, so that when I do
raise(404, 'bad values') it returns a nicely styled page. I have placed the
following line in my routes.py
routes_onerror = [('myapp/404', '/myapp/default/custom_404.html')]
but I don't know how to access the error message
I think I've worked out what I *want* to do, but I'm not sure if this is
easy in web2py. I want to use the onsubmit handler in a form to reload the
form from a .load view, but return false so that the *final* submit action
is not called. Then, if the reloaded form validates, I can set response.j
I have page containing a web2py form, and the page is meant to be viewed in
an iframe. However, if the form validates, I need to escape the iframe by
opening the action URL in a new tab, e.g. using target="_blank" (this is a
redirect to a PayPal payments page, which is why it will not work in an
I'm a bit disappointed that web2py by default sets `X-Powered-By: web2py`
in the http header, thus making it easier for web-scanning tools to detect
the software running behind a web site, and allow more targetted attacks.
Is there an easy config option to efficiently turn this off for all pages
I'm contemplating switching my web2py site to python3. However, when I do
so, the error messages logged to applications/myapp/errors, to which I'm
directed if I have made a web2py python coding error, seem a lot less
useful, for instance they don't seem to give sensible line numbers into my
cod
I'm using submit buttons on forms to submit post requests to new windows,
using . The problem is, web2py automatically changes
the button text to "Working..." on the original page, after the submit
button is clicked. There are some specific buttons where I don't want this
to happen. How can I d
A while ago I mentioned that running web2py with mySQL 5.7.7+ / pymysql
gives the following warning:
/usr/local/lib/python2.7/site-packages/pymysql/cursors.py:165: Warning:
(3090, u"Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be
removed in a future release.")
I have tracked
Anthony: I'm assuming that on my production server, which is run through
uwsgi, the 'args' argument is typically not used, so this won't interfere
with anything? I can't find much documentation
about request.env.cmd_options.args.
Cheers
Yan
On Thursday, 1 March 2018 12:23:44 UTC, Anthony wrot
Great, thanks both.
On Thursday, 1 March 2018 12:23:44 UTC, Anthony wrote:
>
> On Thursday, March 1, 2018 at 7:02:53 AM UTC-5, Leonel Câmara wrote:
>>
>> An easy way would be to simply check for the port where the request was
>> made and simply run rocket on a different port for testing e.g.
Thanks. I really need to modify this programmatically for a functional test
suite - it's not so much a dev vs prod thing. If I have a modified
appconfig, how do I set web2py to use it for a particular rocket instance,
but not normally?
On Thursday, 1 March 2018 11:33:15 UTC, 黄祥 wrote:
>
> i thi
For testing purposes, I would like to set up some functional tests that
check that web2py scripts work properly with different parameters set in
appconfig.ini. Is there any way to fire up rocketsever and point it to a
modified appconfig.ini file?
--
Resources:
- http://web2py.com
- http://web2
I have a non-default controller with a default function, index(), which
uses the index.html view, and which accepts arguments that begin with an @
sign. When I go to www.mysite.org/controller/index/@arg1 it rightly fires
off the index() function with args = ["@arg1"]. And when I go
to www.mysit
I have a LOAD() helper in a view, but that view itself gets loaded into my
main page using the jQuery load() function, after a user interaction. That
means the standard web2py events aren't attached to the LOAD() helper, and
it is just permanently displayed as "loading...". Is there some javascr
The following seems to work, by the way (modified from
https://groups.google.com/forum/#!topic/web2py/TZsLnytjqhA)
## allow mysql tinyint
from gluon.dal import SQLCustomType
boolean = SQLCustomType(
type ='boolean',
native='TINYINT(1)',
On Monday, 11 September 2017 00:08:00 UTC+1, Massimo Di Pierro wrote:
>
> what adapter are you using. What is your URI string (without passwords
> please)?
>
By the way, starting web2py using Rocket now says
/usr/local/lib/python2.7/site-packages/pymysql/cursors.py:166:
Warning: (3090, u"Chan
On Monday, 11 September 2017 00:08:00 UTC+1, Massimo Di Pierro wrote:
>
> what adapter are you using. What is your URI string (without passwords
> please)?
>
Apologies for the slow reply. Annoyingly, I've found that the solution
(without copy) doesn't work at the moment. I'm using the standard
With this code, I now find that with the latest version of web2py (2.15.4),
I get
File "applications/XXX/models/db.py", line 46, in
db._adapter.types = copy.copy(db._adapter.types)
AttributeError: can't set attribute
I have deleted the copy.copy line, so that I am modifying the adapter
st
When using the web2py TEXTAREA html helper, I was caught out when
displaying text that has an initial newline. This is incorrectly displayed
when setting e.g. TEXTAREA(value="\n\nhello"), since the HTML 4 spec
(http://www.w3.org/TR/WD-html40-970917/struct/text.html) says "A line break
occurring
The web2py Nginx setup page
(http://web2py.com/books/default/chapter/29/13/deployment-recipes#Nginx)
says to specify 'root' directory in two 'location' blocks, one for
/xxx/static and one for simply /
But this is "bad practice" according to the 2nd recommendation in the Nginx
docs
https://www
20 matches
Mail list logo