Re: [web2py] SQLFORM button position

2020-03-23 Thread Maurice Waka
Solution found.
Regards

On Mon, Mar 23, 2020, 01:38 Maurice Waka  wrote:

> I came across this code
>
> model:
>
> def widget(**kwargs):
> return lambda field, value, kwargs=kwargs: SQLFORM.widgets[field.type
> ].widget(field, value, **kwargs)
>
>
> db.define_table('posting',
> Field('author', 'reference auth_user', default=auth.
> user_id, writable=False, readable=False),
> Field("message", 'string', length=512,  widget=widget(
> _placeholder='Type your message here', _style="border:1px solid #78E5E3;
> position:fixed; bottom:0px; left:0px;")),
> auth.signature
> )
>
>
> In view...post.load
>
>
> 
>  "form-horizontal" style="margin-bottom: 0px; align:center; align-items:
> stretch;">
> {{=form.custom.begin}}
> 
> 
> {{=form.custom.widget.message}}
> 
> 
> {{=form.custom.submit}}
> 
> {{=form.custom.end}}
> 
>
>
> My issue is that the submit button is positioned at the top of the page
> while the textarea at the button as shown in the code.
> How Can I position the button at the bottom, float-right position?
> Regards
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/3NwBhKSWkqU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/f09f0d62-5e8b-4ff7-9680-db14ce305255%40googlegroups.com
> 
> .
>

-- 
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/CALkNK54eZfk3M4dNBUW_JaQfjZm2txH4orR-xCCo0ZJAtU1mBA%40mail.gmail.com.


[web2py] Re: python3 + web2py + Lighttpd + fastcgi

2020-03-23 Thread Massimo Di Pierro
I guess we would have to replace calls to thread. to threading.

Why not use nginx which is kind of the standard today?

-- 
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/904fc08d-5ebf-4dfa-9bde-89a6f7796a9b%40googlegroups.com.


[web2py] Re: py4web in Google App Engine route app

2020-03-23 Thread Massimo Di Pierro
There are two problems here:
1) you cannot symlink in an action because it must be done once and only 
once.
2) You cannot have paths like /_default because they are absolute paths

Assuming this is a linux or OSX machine you should do from the shell

$ rm -rf apps/_default
$ ln -s apps/myapp apps/_default

You only need to do this once.

On Monday, 23 March 2020 05:01:41 UTC-7, Jacinto Parga wrote:
>
> Yes, but I get an error with symlink in __init.py__ of _default: 
>
> from py4web import action, __version__
> import os
>
> @action("index")
> @action.uses("index.html")
> def index():
> src = "/_default"
> dst = "/myapp"
> os.symlink(src, dst)
> return dict(version=__version__)
>
>
> Error Ticket: [Errno 13] Permission denied: '/_default' -> '/myapp'
>
> Traceback (most recent call last):
>   File "/home/jacinto/PROGRAMACION/py4web/py4web/core.py", line 554, in 
> wrapper
> ret = func(*func_args, **func_kwargs)
>   File "/home/jacinto/PROGRAMACION/py4web/py4web/core.py", line 515, in 
> wrapper
> ret = func(*args, **kwargs)
>   File "apps/_default/__init__.py", line 10, in index
> os.symlink(src, dst)
> PermissionError: [Errno 13] Permission denied: '/_default' -> '/myapp'
>
> id 48
> uuid 8b97b87a-7ec0-4158-bace-e414438f513a
> app_name _default
> method GET
> path /
> timestamp datetime.datetime(2020, 3, 23, 11, 48, 18)
> client_ip 127.0.0.1
> error [Errno 13] Permission denied: '/_default' -> '/myapp'
> snapshot 
> timestamp 2020-03-23T11:48:18.745672
> python_version 3.7.5 (default, Nov 20 2019, 09:21:52) 
>
>
>
>
>
>
> El sábado, 21 de marzo de 2020, 8:03:00 (UTC+1), Massimo Di Pierro 
> escribió:
>>
>> This is a good solution. One trick is to symlink _default to myapp
>>
>> On Monday, 16 March 2020 02:17:56 UTC-7, Jacinto Parga wrote:
>>>
>>> Finally solved.
>>>
>>>1. I add an entrypoint to the app.yaml . The app runs fine:
>>>runtime: python37
>>>entrypoint: gunicorn -b :8080 -w 2 main:app 
>>>
>>>
>>># Handlers define how to route requests to your application.
>>>handlers:
>>>
>>>- url: /.*
>>>  secure: always
>>>  redirect_http_response_code: 301
>>>  script: auto
>>>
>>>2. I get rid off all the apps but the default app and the app I want 
>>>to deploy in the .gcloudignore:
>>># This file specifies files that are *not* uploaded to Google Cloud 
>>>Platform
>>># using gcloud. It follows the same syntax as .gitignore, with the 
>>>addition of
>>># "#!include" directives (which insert the entries of the given 
>>>.gitignore-style
>>># file at that point).
>>>#
>>># For more information, run:
>>>#   $ gcloud topic gcloudignore
>>>#
>>>.gcloudignore
>>># If you would like to upload your .git directory, .gitignore file 
>>>or files
>>># from your .gitignore file, remove the corresponding line
>>># below:
>>>.git
>>>.gitignore
>>>
>>># Python pycache:
>>>__pycache__/
>>># Ignored by the build system
>>>/setup.cfg
>>>
>>>.travis.yml
>>>*.pyc
>>>*.pyo
>>>*~
>>>#*
>>>*.1
>>>*.bak
>>>*.bak2
>>>*.svn
>>>*.w2p
>>>*.class
>>>*.rej
>>>*.orig
>>>Thumbs.db
>>>.DS_Store
>>>./deposit
>>>./benchmark
>>>./build
>>>./dist
>>>./ssl
>>>./docs
>>>./logs
>>>./*.zip
>>># Only ignore the default app and the app we want to deploy
>>>env/*
>>>env/
>>>!apps/*
>>>apps/todo
>>>apps/todo/*
>>>apps/examples
>>>apps/examples/*
>>>apps/_dashboard
>>>apps/_dashboard/*
>>>apps/_scaffold
>>>apps/_scaffold/*
>>>apps/_minimal
>>>apps/_minimal/*
>>>!apps/_default
>>>!apps/_default/*
>>>!apps/myapp
>>>!apps/myapp/*
>>>apps/_documentation/*
>>>apps/superheroes
>>>apps/superheroes/*
>>>apps/myfeed
>>>apps/myfeed/*
>>>apps/*/databases/README*
>>>pps/*/databases/*
>>>apps/*/uploads/*
>>>apps/*/*.py[oc]
>>>packages/
>>>deployment_tools/*
>>>deployment_tools/
>>>tests/*
>>>tests/
>>>README.md
>>>test-requirements.txt
>>>source-context.json
>>>password.txt
>>>py4web-start.py
>>>setup.py
>>>Makefile
>>>So when it is deployed in GAE http://myapp.appspot.com/ goes to 
>>>_default/index.html url
>>>3. I modify the __init.py__ file of the _default app to redirect to 
>>>myapp folder:
>>>from py4web import action, __version__
>>>from bottle import redirect  #get redirect function from bottle
>>>
>>>@action("index")
>>>@action.uses("index.html")
>>>def index():
>>>  redirect("/myapp")  # The former code: return 
>>>dict(version=__version__)
>>>The result is that http://myapp.appspot.com/ serves 
>>>http://myapp.app.com/myapp
>>>
>>> Maybe there is a more elegant way to get it. Any suggestion would be 
>>> appreciated.
>>>
>>> Thanks
>>>
>>> El martes, 4 de febrero de 2020

[web2py] Re: py4web in Google App Engine route app

2020-03-23 Thread Jacinto Parga
Yes, but I get an error with symlink in __init.py__ of _default: 

from py4web import action, __version__
import os

@action("index")
@action.uses("index.html")
def index():
src = "/_default"
dst = "/myapp"
os.symlink(src, dst)
return dict(version=__version__)


Error Ticket: [Errno 13] Permission denied: '/_default' -> '/myapp'

Traceback (most recent call last):
  File "/home/jacinto/PROGRAMACION/py4web/py4web/core.py", line 554, in wrapper
ret = func(*func_args, **func_kwargs)
  File "/home/jacinto/PROGRAMACION/py4web/py4web/core.py", line 515, in wrapper
ret = func(*args, **kwargs)
  File "apps/_default/__init__.py", line 10, in index
os.symlink(src, dst)
PermissionError: [Errno 13] Permission denied: '/_default' -> '/myapp'

id 48
uuid 8b97b87a-7ec0-4158-bace-e414438f513a
app_name _default
method GET
path /
timestamp datetime.datetime(2020, 3, 23, 11, 48, 18)
client_ip 127.0.0.1
error [Errno 13] Permission denied: '/_default' -> '/myapp'
snapshot 
timestamp 2020-03-23T11:48:18.745672
python_version 3.7.5 (default, Nov 20 2019, 09:21:52) 






El sábado, 21 de marzo de 2020, 8:03:00 (UTC+1), Massimo Di Pierro escribió:
>
> This is a good solution. One trick is to symlink _default to myapp
>
> On Monday, 16 March 2020 02:17:56 UTC-7, Jacinto Parga wrote:
>>
>> Finally solved.
>>
>>1. I add an entrypoint to the app.yaml . The app runs fine:
>>runtime: python37
>>entrypoint: gunicorn -b :8080 -w 2 main:app 
>>
>>
>># Handlers define how to route requests to your application.
>>handlers:
>>
>>- url: /.*
>>  secure: always
>>  redirect_http_response_code: 301
>>  script: auto
>>
>>2. I get rid off all the apps but the default app and the app I want 
>>to deploy in the .gcloudignore:
>># This file specifies files that are *not* uploaded to Google Cloud 
>>Platform
>># using gcloud. It follows the same syntax as .gitignore, with the 
>>addition of
>># "#!include" directives (which insert the entries of the given 
>>.gitignore-style
>># file at that point).
>>#
>># For more information, run:
>>#   $ gcloud topic gcloudignore
>>#
>>.gcloudignore
>># If you would like to upload your .git directory, .gitignore file or 
>>files
>># from your .gitignore file, remove the corresponding line
>># below:
>>.git
>>.gitignore
>>
>># Python pycache:
>>__pycache__/
>># Ignored by the build system
>>/setup.cfg
>>
>>.travis.yml
>>*.pyc
>>*.pyo
>>*~
>>#*
>>*.1
>>*.bak
>>*.bak2
>>*.svn
>>*.w2p
>>*.class
>>*.rej
>>*.orig
>>Thumbs.db
>>.DS_Store
>>./deposit
>>./benchmark
>>./build
>>./dist
>>./ssl
>>./docs
>>./logs
>>./*.zip
>># Only ignore the default app and the app we want to deploy
>>env/*
>>env/
>>!apps/*
>>apps/todo
>>apps/todo/*
>>apps/examples
>>apps/examples/*
>>apps/_dashboard
>>apps/_dashboard/*
>>apps/_scaffold
>>apps/_scaffold/*
>>apps/_minimal
>>apps/_minimal/*
>>!apps/_default
>>!apps/_default/*
>>!apps/myapp
>>!apps/myapp/*
>>apps/_documentation/*
>>apps/superheroes
>>apps/superheroes/*
>>apps/myfeed
>>apps/myfeed/*
>>apps/*/databases/README*
>>pps/*/databases/*
>>apps/*/uploads/*
>>apps/*/*.py[oc]
>>packages/
>>deployment_tools/*
>>deployment_tools/
>>tests/*
>>tests/
>>README.md
>>test-requirements.txt
>>source-context.json
>>password.txt
>>py4web-start.py
>>setup.py
>>Makefile
>>So when it is deployed in GAE http://myapp.appspot.com/ goes to 
>>_default/index.html url
>>3. I modify the __init.py__ file of the _default app to redirect to 
>>myapp folder:
>>from py4web import action, __version__
>>from bottle import redirect  #get redirect function from bottle
>>
>>@action("index")
>>@action.uses("index.html")
>>def index():
>>  redirect("/myapp")  # The former code: return 
>>dict(version=__version__)
>>The result is that http://myapp.appspot.com/ serves 
>>http://myapp.app.com/myapp
>>
>> Maybe there is a more elegant way to get it. Any suggestion would be 
>> appreciated.
>>
>> Thanks
>>
>> El martes, 4 de febrero de 2020, 19:46:32 (UTC+1), Jacinto Parga escribió:
>>>
>>> I cannot properly deploy a simple py4web app in GAE. I think it's just a 
>>> .gcloudignore or a app.yaml configuration issue. The only thing I've got is 
>>> a not found page.
>>>
>>> [image: minimal-py4web.png]
>>>
>>> Some help about how to route the right app in the google app engine?
>>>
>>> Thanks
>>>
>>>
>>>
>>>

-- 
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 subscribe