*controlelrs/test.py*
from peewee import *
db = SqliteDatabase('peewee.sqlite')
class BaseModel(Model):
class Meta:
database = db
class Person(BaseModel):
name = CharField()
def peewee_create_tables():
with db:
db.create_tables([Person] )
def peewee_get():
table
*modules/database_pydal*
def database():
from pydal import DAL
DB_URI = "sqlite://test.sqlite"
db = DAL(DB_URI, pool_size = 1, migrate = True,
fake_migrate = False)
return db
def table_customer():
from pydal import Field
from pydal.validators import IS_NOT_EMP
def barcode():
req_vars = request.vars
#first_key = list(req_vars.keys() )[0]
first_key = next(iter(req_vars) )
reader = BarCodeReader()
results = reader.decode(first_key)
return results
"""
curl -X POST --user admin:password -d '@filename.png' -i
http://localhost:8000/te
*document/api.py*
def test():
import pandas as pd
from sqlalchemy import create_engine
data = {'Name': ['Alex', 'Ronald', 'Jane'], 'Age': [10, 18, 33] }
df = pd.DataFrame(data)
table = 'stifix'
#engine = create_engine('sqlite://', echo = False)
engine = create_engine
hello,
*test/api.py*def csv():
import pandas as pd
from io import StringIO
import datetime
today = datetime.date.today()
req_vars = request.vars
if len(req_vars) == 1 and '' in req_vars.values():
vars0 = "%s" % ",".join(["%s:%s" % (k,v) for k,v in
req_vars.item
is there any web2py app or example to create Learning Management System
(LMS) with the exam ?
thanks and best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list
trying to deploy web2py on vercel, but no succeed, any hints ?
*steps*
npm i vercel
wget -c http://web2py.com/examples/static/web2py_src.zip
unzip -o web2py_src.zip
cd web2py
cat << EOF > requirements.txt
EOF
*with web2py.py*
cat << EOF > vercel.json
{
"version": 0,
"builds": [
{
*modules function*
def report_vars_10(table_name, field_group, field_calc, query):
table_field_group = current.db[table_name][field_group]
table_field_calc = current.db[table_name][field_calc]
table_field_sum = table_field_calc.sum()
rows = current.db(query).select(table_field_group
nested_select = db(db.address.address.contains('boulevard') ).*_select*
(db.address.id)
*result in browser *
SELECT "address"."id" FROM "address" WHERE (LOWER("address"."address") LIKE
'%boulevard%' ESCAPE '\');
rows = db(db.customer.address.belongs(nested_select) ).select()
*result in browser*
n
*table*
db.define_table('address',
Field('address'),
format = lambda r: f'{r.address}' )
db.define_table('customer',
Field('name'),
Field('address', 'list:reference address'),
format = lambda r: f'{r.name}' )
*objective*
search customer address by type the words that contains
root cause is on translation, correct it on languages folder
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
hi,
html form field date in web2py form (2.21.1-stable version) is showing
format DD-MM- expected -MM-DD
tested using datetime is same, showing DD-MM- HH:MM:SS expected
-MM-DD HH:MM:SS
tested using SQLFORM() and SQLFORM.grid()
both tested using chrome and firefox
is there any w
*e.g.on tables employee*
id = 1
name = edy
position = staff
*on employee.csv*
name,position
erick,staff
edy,staff
jack,manager
*expected result on table employee*
id = 1
name = edy
position = staff
id = 2
name = erick
position = staff
id = 3
name = jack
position = manager
is there any way to
thanks need to convert the byte object into str object
e.g.
# download_csv
def download_csv():
stream = StringIO()
db.export_to_csv_file(stream,
delimiter = ',',
quotechar = '"',
write_colnames = True,
*step to reproduce*
1 create new app
2 edit db.py at the bottom :
db.define_table('mytable', Field('myfield'))
3 insert data on appadmin
4 export as csv file on appadmin
5 import the exported file
no data added and have flash error
unable to parse csv fileiterator should return strings, not bytes
is there any example web2py app for Linear regression with Machine Learning
Method ?
thanks and best regards,
stifan
--
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
perhaps can learn from book :
http://web2py.com/books/default/chapter/29/11/jquery-and-ajax#Voting-and-rating
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/
another way around
python path_to_web2py/web2py.py --no_gui --no-banner -a 'password'
best regards,
stifan
--
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)
--
same, but use requests.cookie instead
e.g.
import requests
import json
import os
import random, string
from bs4 import BeautifulSoup
from requests_toolbelt import MultipartEncoder
cookie = requests.cookies.RequestsCookieJar()
if os.path.exists('cookies'):
cookie.load(ignore_discard=True, ignor
>
> 3- How do I add a Persian translation to this framework?I used the T
> function according to the instructions, but unfortunately it did not work.
>
- take a look at languages folders, then copy en.py, paste and rename it
with persian langcode
- you can start to translate what inside that f
can use python module requests
*e.g.*
import requests
url = 'https://sugizo.pythonanywhere.com/music/api/no_cache/instrument/1'
requests.get(url).headers
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code
*video*
https://www.loom.com/share/9d2daf9ea7de41e1b8e18712f8bdcfa5
*code and discussion*
https://github.com/yashaka/selene/issues/287
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.g
*step*
1. create New simple application : test
2. then register it http://localhost:8000/test/default/user/register
with email : a...@a.com
password : password
3. close the tab
4. open new tab http://localhost:8000/test/default/user/login
with email : b...@b.com
password : b
this user does not exis
>
> can i delete sql.log?
>
*from book*
web2py logs all migrations and migration attempts in the file "sql.log".
*ref*
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=sql.log#Migrations
perhaps can try to rename it first not deleted, in case an error occured
*objective*
test logout on web2py app
*tried*
using selenium, splinter, behave and robot (Maximize Browser Window)
*result return an error*
element not interactable
*xpath of **logout on **default web2py welcome app*
/html/body/nav/div/div[2]/ul[1]/li/ul/li[4]/a
*question*
how to achieve it o
> Is it possible to write to session variables from Web2py modules?
>
yes, it is
ref:
http://web2py.com/books/default/chapter/29/04/the-core?search=current.#Accessing-the-API-from-Python-modules
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
*controllers/api.py*
@auth.requires_login()
def rows_as_json():
if not request.env.request_method == 'GET': raise HTTP(403)
table_name = request.args(0)
id = request.args(1)
if id.isdigit() and int(id) > 0:
query = (db[table_name]['id'] == id)
else:
query = (db[t
*problem with google group*
sometime the post is deleted automatically after posted
*alternative*
perhaps can use github discussion feature, some repo already use it to
discuss about their project (request feature, ideas, qna, dll), but not
found in web2py and py4web github repo
thanks and best
happy new year
\(^o^)/
--
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-
the default web server shipped with Rocket web server
its written on the right side of admin page :
Running on Rocket 1.2.6
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/
*views/form.html*
{{for row in rows:}}
{{
for r in db(table.pitch_class == row.pitch_class).select(cache = cache_db,
cacheable = True):
}}
{{=", ".join([row_name for row_name in r.name] ) }}
{{pass}}
{{pass}}
*{{selected_table_id = jQuery('#table_id').val() }}*
{{for i in range(1, *selected
http://web2py.com/books/default/chapter/29/11/jquery-and-ajax#The-ajax-function
how to achieve this in py4web ?
thx n best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py
developing app for learning music
https://sugizo.pythonanywhere.com/music
critic and suggestion welcome both music and programming side
thanks and best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- htt
run well on docker container : ubuntu and mac
best regards,
stifan
--
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
tested on ubuntu docker container (python 3.6) and mac (python 3.7), not
work with error
*question*
- is web3py-start myapps can start on background
e.g. web3py-start myapps &
consider when server is run on isolated env (i.e. docker) and must access
through tunnels (ssh or ngrok)
?
*steps on ub
already tried define the length on field constructor and change web server
because error above refer to rocket.py
*ref:*
https://groups.google.com/d/msg/web2py/2B9B9o151II/UyfREFmlBgAJ
*modules/table_test.py*
test = db.define_table('test',
Field('test', length = 255),
on_define = on_def
already tried define length on field constructor and change web server,
because error above refer to rocket.py, so try gevent an error occured too
*modules/table_test.py*
test = db.define_table('test',
Field('test', *length **= 255*),
on_define = on_define_test)
$ python ~/learn/python/
is there any difference to set variable on models or modules ?
*e.g.*
*models/db_connect.py*
db = DAL('sqlite://test.sqlite', pool_size = 1)
*modules/db_connect.py*
from gluon.dal import DAL
from gluon import current
db = DAL('sqlite://test.sqlite', pool_size = 1)
cache = current.cache
cache_time_
>
> 2.7 also not working .for dna apps .see error
>
unsupported pickle protocol 3
already discussed on this thread :
https://groups.google.com/forum/#!msg/web2py-developers/4W4I1FBlGgI/t2ulp1AICgAJ
another ref:
https://stackoverflow.com/questions/25843698/valueerror-unsupported-pickle-pr
>
> yes .my windows python 3.7.3 now ! what can i do for removing error ?
> suggest me where i should change for update python code .?
>
pls follow roberto advice to use python 2.7, because cstringio no longer
exist on python3
ref:
https://stackoverflow.com/questions/30377620/python-3-4-cstring
which python version did you use ?
perhaps you using python3 and the source code created in python2, so it'll
return an error according to the module cstringio path
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
>
> i try to install but not work .where should mathplotlib install ? on
> my pc or application folder or web2py folder? or others folder ?
>
pls ensure it's installed on the same python environment that been used
running web2py
best regards,
stifan
--
Resources:
- http://web2py.com
- ht
for capture.png 'requires matplotlib', perhaps you can install matplotlib
first on terminal, then restart web2py server
*e.g.*
pip install matplotlib
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
>
> web2py can import mathplotlib,bekeh ,sympy,numpy or any python library?
>
yes, can import all of python library
how we can import it?
>
just import it either it in models, controllers, modules or views
*e.g. *
import numpy
best regards,
stifan
--
Resources:
- http://web2py.com
- http:/
another way around if you want to stick with rocket, and want ssl, think
you can use another web server to serve it as reverse proxy (nginx, apache,
etc)
web2py also can be run with another server with anyserver.py, but not sure
if it's accept the certificate parameter when execute it
best rega
tested on ubuntu docker for pip3 install web3py with simple app (worked)
*steps*
apt install -y git python3-pip cython3
cd
git clone https://github.com/web2py/web3py
cd web3py
python3 setup.py install
pip3 install web3py
cd
mkdir -p ~/apps/test/databases
cat << EOF > ~/apps/test/__init__.py
impor
>
> Ideas about how to ship apps when pip installing web3py?
pardon, for current stage, can not, because you must:
- clone web3py repo
- run python3 setup.py install
- then successfull install pip3 install web3py
which imo inefficient
detail tested on previous messages
*ref (tests 5 works):*
ht
compared the lightweight between alpine, ubuntu n debian, results are :
*alpine (around 300mb) < ubuntu** (around 700mb)** < debian** (around
700mb)*
$ docker history alpine/web3py
IMAGE CREATED CREATED BY
SIZE COMMENT
55f
tested work Dockerfile alpine base image while execute 'make test', never
thought the service started itself after installed, checked using service
command in package openrc
cat << EOF > Dockerfile
FROM alpine:latest
RUN apk add --no-cache git py3-pip gcc python3-dev musl-dev memcached
openrc m
tested work Dockerfile with alpine base image
cat << EOF > Dockerfile
FROM alpine:latest
RUN apk add --no-cache git py3-pip gcc python3-dev musl-dev && \
addgroup -S web3py && \
adduser -D -G web3py web3py
USER web3py
RUN rm -rf /home/web3py/web3py && \
cd /home/web3py && \
export PATH="\$PA
as question on github, here another alternative works without using ubuntu
or debian image base file (which posted on prev msg)
docker pull alpine
docker run -it --privileged alpine /bin/sh
apk add --no-cache git py3-pip memcached gcc python3-dev musl-dev make
/usr/bin/memcached -u memcached &
c
>
> See
> http://web2py.com/books/default/chapter/29/04/the-core#Accessing-the-API-from-Python-modules.
>
> You can use current.T.
>
forgot about that one, thx Anthony, think the same code can work in web2py
n web3py just set the correct imported modules , seems the web2py
have a hidden fea
*controllers/api.py*
import table_test
def test():
return table_test.test
*modules/table_test.py*
from gluon.dal import *
from gluon.validators import *
from gluon import current
import field_constructor
db = DAL('sqlite://test.sqlite', pool_size = 1)
def on_define_test(table):
T = curren
web2py™ Version 2.18.5-stable
tryin to use T() in modules
Traceback (most recent call last):
File "/Users/sugizo/learn/python/web2py/gluon/restricted.py", line 219, in
restricted
exec(ccode, environment)
File
"/Users/sugizo/learn/python/web2py/applications/test/controllers/api.py",
line
still have an error, a bit different told about __iter__ and __len__
$ pip3 install -U -r requirements.txt
Successfully built yatl
Installing collected packages: yatl
Found existing installation: yatl 1.0.6
Uninstalling yatl-1.0.6:
Successfully uninstalled yatl-1.0.6
Successfully instal
*work in web2py*
def json_row_as_list():
if not request.env.request_method == 'GET': raise HTTP(403)
import json
table_name = request.args(0)
id = request.args(1)
if id.isdigit() and int(id) > 0:
query = (db[table_name]['id'] == id)
else:
query = (db[table_na
>
> Be careful that you can no longer change attributes everywhere you like as
> in:
>
> db.tablename.fieldname.readable = False
>
> In web2py this is ok. In web3py this is not safe. Attributes must be
> global. The state of fixtures must not be modified inside actions.
>
is it mean in controll
>
> *url* =
> http://localhost:8000/_dashboard/dbadmin?app=test&dbname=db&tablename=address
> *result* = { "__class__": "lazyT", "kwargs": {}, "text": "Field 0",
> "translator": { "__class__": "method" } }
> *expected result *= Field 0
> no error occured but the result is not expected
>
there's
cache on select not work, modify apps/todo/api, cacheable=True is work
without defining cache
*apps/todo/__init__.py*
@action('api') # a GET API function
@action.uses(db)# all before starting a db connection
def todo():
cache_time_expire = 10
cache_
represent doesn't show the content of the table field properly in
_dashboard (database)
- type of field is reference (show but the content just Ref.[id], e.g.
Ref.[4]
- type of field is list:string (doesn't show at all), yet the field is
filled, checked in database
attached : screen_shot.png
b
tryin to move define_tables from web2py to web3py, run well just a few note
about field constuctor, (related with ui, FORM and T) :
- comment : run well, but if you not use bootstrap, then it's should be
modified (e.g. _class or function modal in boostrap)
- represent : run well, but if you not
pls try (not tested)
> *1.* Change a already existing password of a user if I kow the username
> of the user (username or ID)
>
db(db.auth_user.id == 2).update(password =
db.auth_user.password.validate("password")[0] )
*2.* Create a new user if it's possible (with a username and a password o
*models/db_schema_1_address.py*
from web3py import Field
from .db import *
def on_define_address(table):
table.field0.label = T('Field 0')
db.define_table('address',
Field('field0'),
on_define = on_define_address,
migrate = 'address.table')
*test 1*
*url* =
http://localhost:80
>
> I will be moving a legacy application from my old shared host to a new
> VPS, and would like to upgrade web2py at the same time from 2.08 to the
> current version (2.18.5). How should I go about doing this?
>
since you said from shared host to a new host, perhaps can do it manually:
- ba
since cython3 is needed to successful run 'python3 setup.py install'
(detail in prev messages in this thread), just test it to run with cython3
in ubuntu docker, pls ignore, if not plan to support cython3 in the future
*steps*
apt install -y git python3-pip cython3
cd
git clone https://github.com
another way around perhaps can use onvalidation to insert the mode data at
the same time when the user click submit
ref:
http://web2py.com/books/default/chapter/29/07/forms-and-validators#onvalidation
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentatio
*http://localhost:8000/examples/dbform*
*error on browser*
500
INTERNAL SERVER ERROR
*error on terminal*
ERROR:root:Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 413, in
wrapper
ret = func(*func_args, **func_kwargs)
File "/Users/sugizo/le
test pip3 install web3py on ubuntu docker container, known work must
install cython3 to ensure gevent source can be build by gcc, and the
procedure must clone repo first then run python3 setup.py install, then you
can successful pip3 install web3py (inefficient i think), detail steps on
test 5
tested latest commit 151 on docker ubuntu
*problem*
dont have web3py/apps/__init__.py
*solution*
touch web3py/apps/__init__.py
*steps*
apt install -y git python3-pip
pip3 install git+https://github.com/web2py/web3py --upgrade
git clone https://github.com/web2py/web3py
python3 -c "from pydal.vali
>
> try a db.commit() after your define_table(s).
>
already tried, same result (tested on different os), reported on previous
message in this thread
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
>
> *steps*
> apt install -y git python3-pip
> pip3 install git+https://github.com/web2py/web3py --upgrade
> git clone https://github.com/web2py/web3py
> python3 -c "from pydal.validators import CRYPT;
> open('password.txt','w').write(str(CRYPT()('a' )[0] ) )"
> web3py-start -p ./password.txt -a
shell script not work ?
another way around perhaps can use conda 3 or miniconda 3, install it and
it automatically add variable PATH on your bash file, reload it, then, the
default of your python bash will refer to conda installed path
best regards,
stifan
--
Resources:
- http://web2py.com
- h
found https://pypi.org/project/web3py/ n test it on docker ubuntu return an
error
*steps*
apt install -y python3-pip
pip3 install web3py
*result*
Collecting web3py
Downloading https:
//files.pythonhosted.org/packages/ee/a2/f57e1fefb0c62b4423fd76ea359d58d2363982054050b8c0ab54ed4b84c5/web3py-0.1.
retest (commits 147) pip install from git repo on docker ubuntu, but got
different error traceback
*steps*
apt install -y git python3-pip
pip3 install git+https://github.com/web2py/web3py --upgrade
git clone https://github.com/web2py/web3py
python3 -c "from pydal.validators import CRYPT;
open('pa
perhaps can use readabe=False or show_if
ref:
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-constructor
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Conditional-fields
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2p
test latest commits (146)
*$ make test*
tests/test_auth.py::TestAuth::test_register FAILED
tests/test_auth.py::TestAuth::test_register_invalid FAILED
tests/test_cache.py::CacheTest::test_change_detection PASSED
tests/test_cache.py::CacheTest::test_different_keys PASSED
tests/test_cache.py::CacheTes
test another way around to installed web3py, seems can't work smoothly
using this way pip3 install directly from git repo (which installed
web3py-start on /usr/local/bin/), another problem is requirements.txt
package not same like on setup.py install_requires=[...]
*steps*
docker pull ubuntu
doc
dont mess with the /usr/bin/ by create the symbolic link, the safest way
perhaps you can create a shell script
e.g.
*start_web2py.sh*
python3 /path_to_web2py/web2py.py
then start your web2py server with
./start_web2py.sh
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.c
another way around perhaps can use response.delimiter
ref:
http://web2py.com/books/default/chapter/29/04/the-core?search=delimiter
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.googl
*first attempt*
Traceback (most recent call last):
File "/Users/sugizo/learn/python/web2py/gluon/restricted.py", line 219, in
restricted
exec(ccode, environment)
File
"/Users/sugizo/learn/python/web2py/applications/mutualfunds/controllers/install_demo.py"
, line 630, in
File "/Users/su
face same error too on mac python3.7
*steps*
./web3py-start -p password.txt -a 0.0.0.0:8000 apps
cat << EOF >> apps/_scaffold/models.py
db.define_table('thing', Field('name') )
db.commit()
db.define_table('think', Field('name') )
db.commit()
EOF
open http://localhost:8000/_dashboard
error tracebac
seems git haven't installed yet on your system, think first install the git
then follow the steps above (on your prev message)
ref:
https://git-scm.com/download/win
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
agree, flexible is no policy, long story short what i mean is, can user
define templates on it's own path in the app ?
*e.g. *
*apps/_scaffold/settings.py*
TMPLTS_FOLDER = os.path.join(APP_FOLDER, 'views')
btw, no worries, it's fine
test latest commit (142), error traceback about database folder
is it possible to have flexible folders pattern for templates and
translations folders ?
*e.g.*
mkdir apps/_scaffold/controllers
mkdir apps/_scaffold/models
mv apps/_scaffold/controllers.py apps/_scaffold/controllers/default.py
mv apps/_scaffold/models.py apps/_scaffold/models/db.py
then adjust s
just clarficiation, is it correct or it should be python3 setup.py sdist
*web3py/Makefile*
deploy: test
python setup.py sdist
*web3py/setup.py*
install_requires=[
...
],
is not same like *web3py/requirements.txt*
perhaps can create a reference that install_requires in web3py/setup.py is
refer
*Dockerfile*
# please change :
# password.txt with your desire filename
# password_admin with your desire password admin
# 8000 with your available port
FROM ubuntu:latest
RUN apt update && \
apt install -y git python3-pip python-pip memcached && \
service memcached restart
RUN groupadd -r web
*suggestion for apps/_scaffold:*
*- form validation not work during login and register*
** during register : *
form field password and password (again) allow mismatched input (this case
happen just in web form field, not in database table, when insert mismatch
database table remain empty)
** duri
test so far so good in latest commits (138) using docker (ubuntu n debian),
a few error during test auth which i know is still work in progress or
prefer to report the error traceback too ?
*steps*
docker pull ubuntu
docker run -it --privileged ubuntu /bin/bash
apt update
apt install -y git pyth
for download all tables at once
try:
import StringIO
except ImportError:
from io import StringIO
def download_csv():
stream = StringIO.StringIO()
db.export_to_csv_file(stream,
delimiter = ',',
quotechar = '"',
ref:
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Exporting-and-importing-data
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues
*problem*
can't run it on background because of password required
*e.g. *
./web3py-start apps -a 0.0.0.0: &
perhaps can add parameter for password like web2py during start web3py
*e.g.*
python web2py/web2py.py --nogui --no-banner -a a -i 0.0.0.0 -p 8000
test latest commit 128: can register bu
>
> I want to access the posting variable name not is value . Is there any way
> ?
>
there should be any way for those who seeks
*pls try (untested)*
dict_post_vars = request.post_vars
dict_post_vars.keys()
*ref:*
http://web2py.com/books/default/chapter/29/02/the-python-language#dict
best rega
>
> Is it possible uploading the project from my computer or using a github
> repo?
>
think there are uploaded service in http://localhost:8000/admin on the
right side said : 'Upload and install packed application'
you can upload *.w2p file or github repo link
or another way if you are in compu
>
> how to use it with postgresql ?
>
pls set the uri connection first
*e.g. private/appconfig.ini*
uri = postgres://postgres:password@localhost/database_name
*ref:*
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Connection-strings-the-uri-parameter-
best regard
>
> www.example.com/welcome/default/index?sum
>
> how to get "sum" in controller ??
>
did request.vars not work ?
ref:
http://web2py.com/books/default/chapter/29/04/the-core#request
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github
>
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 72:
> ordinal not in range(128)
>
> Any suggestions?
>
>
perhaps you need to set LANG environment system variables
*e.g. not tested*
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
seen many case error during run python 3 apps l
prev message, not scan recursively, tried to scan web2py take longer time,
n think it can ignore the result under apps folder since it's just a
scaffolding or examples, but can be a reminder when deploy in production
$ bandit ./web3py/ -r
[main] INFOprofile include tests: None
[main] INFO
pardon, not sure, this thread proper or not here, tested web2py and web3py
with bandit
*steps*
pip3 install bandit
cd
git clone https://github.com/web2py/web3py
git clone https://github.com/web2py/web2py
$ bandit web3py/*.py -r
[main] INFOprofile include tests: None
[main] INFOprofile e
tested commit (123), need to create folder databases on examples webapp
(mkdir apps/examples/databases)
*phase 1 ([FAILED] loading examples)*
rm -rf /tmp/*
rm -rf web3py
git clone https://github.com/web2py/web3py
cd web3py
pip3 install -U -r requirements.txt
$ ./web3py-start apps
___ ___
>
> I am thinking for something. I am thinking of a generic tagging api which
> wold allow you to tag any object using efficient many2many and use
> hierarchical tags.
> You would be able to tag users with group tags and efficiently search
> groups for users and users by group. I have a prototy
1 - 100 of 1988 matches
Mail list logo