--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
I reaaaaaaly would like to use an ORM with web3py, in my opinion ORMs are better for organization when apps grow big and I like a lot the fat models and thin controllers approach, and it is some messy with pydal right now (https://github.com/Medisur/journalmanagement/blob/master/models/citation.py). I have isoleted the weppy ORM some days ago (as hobby), it's not fully tested, and will need some refactoring, but if you are interested I can share it.
Greetings.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
Can you make it a module on pypi? Or should we include it in pydal?
rm -rf ~/learn/python/web3py
cd ~/learn/python
git clone https://github.com/web2py/web3py
source activate python3_test
cd ~/learn/python/web3py
pip install -r requirements.txt
python web3py.py applications/
open http://localhost:8000/todo/index
pip install -U -r requirements.txt
docker pull ubuntu
docker run -it --privileged ubuntu /bin/bash
apt update
apt install -y git python3-pip
git clone https://github.com/web2py/web3py
cd web3py
pip3 install -r requirements.txt
# ./web3py-start applications/
Traceback (most recent call last):
File "./web3py-start", line 5, in <module>
for filename in os.listdir('site-packages'):
FileNotFoundError: [Errno 2] No such file or directory: 'site-packages'
"""
import sys, os
for filename in os.listdir('site-packages'):
sys.path.insert(0, os.path.join('site-packages', filename))
"""
docker pull ubuntu
docker run -it --privileged ubuntu /bin/bash
apt update
apt install -y git python3-pip make
git clone https://github.com/web2py/web3py
cd web3py
make
make install
# ./web3py-start applications/
Traceback (most recent call last):
File "./web3py-start", line 3, in <module>
from web3py.core import main
File "/web3py/web3py/__init__.py", line 1, in <module>
from . core import render, DAL, Field, action, request, response, redirect, abort, HTTP, Session, Cache, user_in
File "/web3py/web3py/core.py", line 39, in <module>
import jwt # pip import PyJWT
ModuleNotFoundError: No module named 'jwt'
python3 setup.py install
# ./web3py-start applications/
Traceback (most recent call last):
File "./web3py-start", line 3, in <module>
from web3py.core import main
File "/web3py/web3py/__init__.py", line 1, in <module>
from . core import render, DAL, Field, action, request, response, redirect, abort, HTTP, Session, Cache, user_in
File "/web3py/web3py/core.py", line 39, in <module>
import jwt # pip import PyJWT
ModuleNotFoundError: No module named 'jwt'
install_requires=[
'bottle',
'gunicorn',
'gevent',
'pydal3',
'pyjwt',
'yatl',
'reloader',
],
git clone https://github.com/web2py/web3py
cd web3py/docker
docker build -t test/web3py_git .
docker run -d \
-p 8000:8000 \
--name web3py_git \
test/web3py_git
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4b7691de9843 test/web3py_git "web3py-start applic…" 13 seconds ago Exited (1) 11 seconds ago web3py_git
mkdir -p app/applications
cat << EOF > app/requirements.txt
pyjwt
bottle
gunicorn
gevent
reloader
pydal3
yatl
web3py
EOF
cat << EOF > Dockerfile
FROM python:3.7
ADD app /app
WORKDIR /app
RUN pip install -r requirements.txt
CMD ["web3py-start", "applications"]
EOF
docker build -t test/web3py_man .
docker run -d \
-p 8000:8000 \
--name web3py_man \
test/web3py_man
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
41a2fa82eed5 test/web3py_man "web3py-start applic…" 13 seconds ago Up 11 seconds 0.0.0.0:8000->8000/tcp web3py_man
cat << EOF > Dockerfile
FROM ubuntu:latest
RUN apt update && \
apt install -y git python3-pip && \
cd / && \
git clone https://github.com/web2py/web3py && \
cd web3py && \
pip3 install -r requirements.txt
WORKDIR /web3py
EXPOSE 8000
CMD python3 /web3py/web3py-start /web3py/applications/
EOF
docker build -t test/web3py_cook .
docker run -d \
-p 8000:8000 \
--name web3py_cook \
test/web3py_cook
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ad85f10d5767 test/web3py_cook "/bin/sh -c 'python3…" 15 seconds ago Up 13 seconds 0.0.0.0:8000->8000/tcp web3py_cook
docker run -it --privileged ubuntu /bin/bash
def start_server(args):
host, port = args.address.split(':')
if args.number_workers < 1:
bottle.run(host=host, port=int(port))
else:
if not gunicorn:
logging.error('gunicorn not installed')
elif not gunicorn:
# should be (not sure, untested)
#elif not gevent:
logging.error('gevent not installed')
else:
bottle.run(server='gunicorn', host=host, port=int(port),
workers=args.number_workers, worker_class='gevent', reloader=True,
certfile=args.ssl_cert_filename, keyfile=args.ssl_key_filename)
def helloworld(): return dict(name=request.forms.get('name', 'visitor'))
<h1>Hello Dear [[=name]]</h1>
docker
docker-compose up -d
$ docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------------
docker_postgres_1 docker-entrypoint.sh postgres Up 0.0.0.0:5432->5432/tcp
docker_web_1 web3py-start applications Exit 1
python3 /web3py/web3py-start /web3py/applications/ --address 0.0.0.0:8000
python3 /web3py/web3py-start /web3py/applications/ --address 0.0.0.0:8000
cat << EOF > Dockerfile
FROM ubuntu:latest
RUN apt update && \
apt install -y git python3-pip && \
cd / && \
git clone https://github.com/web2py/web3py && \
cd web3py && \
pip3 install -r requirements.txt
WORKDIR /
web3py
CMD python3 /web3py/web3py-start /web3py/applications/ --address 0.0.0.0:8000
EXPOSE 8000
EOF
docker build -t test/web3py_cook .
docker run -d \
-p 8000:8000 \
--name web3py_cook \
test/
web3py_cook
docker ps -a
--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Not working...
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.
pip3 install --upgrade pydal
Also do
python3 web3py.py applications
Not
python3 web3py.py applications/todo/
--
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+un...@googlegroups.com.
Worked for me...
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
I agree it's worthwhile to go for a different name eventually.
Hi Massimo, here is it: https://github.com/cccaballero/pydal-orm. I
think including something like this with pydal will be a really good
improvement.
Greetings.
As almost everything in our world ORMs has advantages and disadvantages. The main criticism about ORMs is that they are leaky abstractions, that means they leaks details that it is supposed to abstract away, because there are times when you just need to use, for example, SQL directly or work with raw rows when making complex queries or improving performance because that is one of the ORMs disadvantages, they include an extra logical layer that, depending on the implementation can affect performance more or less.
But there are lot of people out there using ORMs and this is
because they have advantages, compared with PyDAL, mostly when you
are using big models, for example, compare this PyDAL model:
def _get_somethig_plus_age(row, extra):
return row.person.age + extra
db.define_table('person',
Field('name')
Field('age', 'integer')
Field.Method('get_somethig_plus_age',
_get_somethig_plus_age)
)
against this ORM-style model:
class Person(Model):
name = Field()
age = Field('integer')
def get_somethig_plus_age(self, extra):
return self.age + extra
In an ORM, a model class represents a table, and when you query
the DB, you get the class instance objects representing rows.
Using this approach you can directly benefit from the advantages
of the OOP and the code readability and organization improves a
lot, mostly when models starts grow big.
Greetings.
--
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+un...@googlegroups.com.
As almost everything in our world ORMs has advantages and disadvantages. The main criticism about ORMs is that they are leaky abstractions, that means they leaks details that it is supposed to abstract away, because there are times when you just need to use, for example, SQL directly or work with raw rows when making complex queries or improving performance because that is one of the ORMs disadvantages, they include an extra logical layer that, depending on the implementation can affect performance more or less.
But there are lot of people out there using ORMs and this is because they have advantages, compared with PyDAL, mostly when you are using big models, for example, compare this PyDAL model:
def _get_somethig_plus_age(row, extra):
return row.person.age + extra
db.define_table('person',
Field('name')
Field('age', 'integer')
Field.Method('get_somethig_plus_age', _get_somethig_plus_age)
)against this ORM-style model:
class Person(Model):
name = Field()
age = Field('integer')
def get_somethig_plus_age(self, extra):
return self.age + extra
In an ORM, a model class represents a table, and when you query the DB, you get the class instance objects representing rows. Using this approach you can directly benefit from the advantages of the OOP and the code readability and organization improves a lot, mostly when models starts grow big.
Hi Massimo, here is it: https://github.com/cccaballero/pydal-orm. I
think including something like this with pydal will be a really good
improvement.
Yes, but that's not about the number of code lines, that's about the code organization and readability.
Greetings.
Well, that's a really fair concern, I was just mentioning, because I like ORMs and other popular projects like SQLAlchemy includes a DAL (they call it SQL abstraction toolkit) and an ORM on top of it, and if you look at popular web development full stack frameworks, almost all of them are relaying their models to ORMs.
Greetings
127.0.0.1 - - [20/Apr/2019 16:17:21] "GET /dashboard HTTP/1.1" 303 0
127.0.0.1 - - [20/Apr/2019 16:17:21] "GET /_dashboard/static/index.html HTTP/1.1" 404 460
127.0.0.1 - - [20/Apr/2019 16:17:26] "GET /_dashboard HTTP/1.1" 404 460
Yes, but that's not about the number of code lines, that's about the code organization and readability.
Well, that's a really fair concern, I was just mentioning, because I like ORMs and other popular projects like SQLAlchemy includes a DAL (they call it SQL abstraction toolkit) and an ORM on top of it, and if you look at popular web development full stack frameworks, almost all of them are relaying their models to ORMs.
--
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+un...@googlegroups.com.
Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 460, in import_apps
module = importlib.import_module(app_name)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/__init__.py", line 1, in <module>
from . import controllers
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/reloader.py", line 158, in _import
base = _baseimport(name, globals, locals, fromlist, level)
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 3, in <module>
from . import models
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/reloader.py", line 158, in _import
base = _baseimport(name, globals, locals, fromlist, level)
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/models.py", line 8, in <module>
pool_size=settings.DB_POOL_SIZE)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py", line 171, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py", line 477, in __init__
"Failure to connect, tried %d times:\n%s" % (attempts, tb)
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py", line 457, in __init__
self._adapter = adapter(**kwargs)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/__init__.py", line 39, in __call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/base.py", line 369, in __init__
super(SQLAdapter, self).__init__(*args, **kwargs)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/base.py", line 53, in __init__
self.reconnect()
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/connection.py", line 154, in reconnect
self.connection = self.connector()
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/sqlite.py", line 42, in connector
return self.driver.Connection(self.dbpath, **self.driver_args)
sqlite3.OperationalError: unable to open database file
Bottle v0.12.16 server starting up (using WSGIRefServer())...
Listening on http://127.0.0.1:8000/
Hit Ctrl-C to quit.
127.0.0.1 - - [22/Apr/2019 03:08:12] "GET /dashboard HTTP/1.1" 303 0
127.0.0.1 - - [22/Apr/2019 03:08:12] "GET /_dashboard/static/index.html HTTP/1.1" 404 459
127.0.0.1 - - [22/Apr/2019 03:08:56] "GET /_dashboard/ HTTP/1.1" 404 459
127.0.0.1 - - [22/Apr/2019 03:09:31] "GET /_dashboard/dashboard HTTP/1.1" 404 459
127.0.0.1 - - [22/Apr/2019 03:09:35] "GET /_dashboard/info HTTP/1.1" 200 1111
127.0.0.1 - - [22/Apr/2019 03:09:59] "GET /_dashboard/routes HTTP/1.1" 200 2711
127.0.0.1 - - [22/Apr/2019 03:10:21] "GET /_dashboard/apps HTTP/1.1" 200 3410
127.0.0.1 - - [22/Apr/2019 03:11:00] "GET /_scaffold HTTP/1.1" 404 457
127.0.0.1 - - [22/Apr/2019 03:11:33] "GET /_scaffold/index HTTP/1.1" 404 457
rm -rf ~/learn/python/web3py
cd ~/learn/python
git clone https://github.com/web2py/web3py
cd ~/learn/python/web3py
source activate python3_test
pip install -U -r requirements.txt
python web3py-start applications/
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
127.0.0.1 - - [22/Apr/2019 03:08:12] "GET /dashboard HTTP/1.1" 303 0
127.0.0.1 - - [22/Apr/2019 03:08:12] "GET /_dashboard/static/index.html HTTP/1.1" 404 459
127.0.0.1 - - [22/Apr/2019 03:08:56] "GET /_dashboard/ HTTP/1.1" 404 459
127.0.0.1 - - [22/Apr/2019 03:09:31] "GET /_dashboard/dashboard HTTP/1.1" 404 459
127.0.0.1 - - [22/Apr/2019 03:09:35] "GET /_dashboard/info HTTP/1.1" 200 1111</span
the web2py admin is different. The web3py one is much more spartan. But the functions that need to be ported to zip/unzip apps are indentical.
the web2py admin is different. The web3py one is much more spartan. But the functions that need to be ported to zip/unzip apps are indentical.not sure got the meaning of spartan
I git installed web3py and quite enjoy it. I see its updated regular too.For those who don't know and maybe this is common sense , not sure.once you git clone https://github.com/web2py/web3py.git do a git pull2. reinstall requirements.txt (pip3 install -r requirements.txt)- Changes: module "reloader" was added3. Launch web3py (should work just fine now)python3 web3py.py applications/todo/4. open browser and type: localhost:8000 or 127.0.0.1:8000/todo/index
git clone https://github.com/web2py/web3py
cd web3py
pip install -U -r requirements.txt
python web3py-start applications/
yeah you right, pls follow this step instead (for latest commit)
git clone https://github.com/web2py/web3py
cd web3py
pip install -U -r requirements.txt
python web3py-start applications/
I have been looking more into veutify. I have some reservations.I think a good CSS framework (for web3py) should be JS agnostic, even if the examples use vue.js.I think effects should be done in CSS only, not in JS. vuetify does not follow this rule.Also vuetify is really designed for use with the CLI and I would like web3py to remain CLI agnostic.Documentation is not good yet.I think I will stick to bulma for now for the simplest example apps and dashboard.For mobile app style, I like Framework7 a lot.Massimo
Worked for me...
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.
git clone https://github.com/web2py/web3py
cd web3py
$ pip3 install -r requirements.txt
Collecting pyjwt (from -r requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/87/8b/6a9f14b5f781697e51259d81657e6048fd31a113229cf346880bb7545565/PyJWT-1.7.1-py2.py3-none-any.whl
Collecting yat (from -r requirements.txt (line 2))
Could not find a version that satisfies the requirement yat (from -r requirements.txt (line 2)) (from versions: )
No matching distribution found for yat (from -r requirements.txt (line 2))
$ ./web3py-start applications/
Traceback (most recent call last):
File "./web3py-start", line 3, in <module>
from web3py.core import main
File "/Users/sugizo/learn/python/web3py/web3py/__init__.py", line 1, in <module>
from . core import render, DAL, Field, action, request, response, redirect, abort, HTTP, Session, Cache, user_in, Translator
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 39, in <module>
import jwt # pip import PyJWT
ModuleNotFoundError: No module named 'jwt'
git clone https://github.com/web2py/web3py
cd web3py
pip3 install -r requirements.txt
$ ./web3py-start applications/
Traceback (most recent call last):
File "./web3py-start", line 3, in <module>
from web3py.core import main
File "/Users/sugizo/learn/python/web3py/web3py/__init__.py", line 1, in <module>
from . core import (
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 40, in <module>
import jwt # pip import PyJWT
ModuleNotFoundError: No module named 'jwt'
$ pip -V
pip 19.0.3 from /Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pip (python 3.7)
$ pip3 -V
pip 19.0.3 from /Users/sugizo/miniconda3/lib/python3.6/site-packages/pip (python 3.6)
@action('index', method='GET') # the function below is exposed as index.html
@action.uses('generic.html', session, db, T) # it uses the generic.html template, a session, and the db
def index():
T.select('id')
session['counter'] = session.get('counter', 0) + 1
msg = T('Hello World from {name}')
return dict(message=msg.format(name=session['counter'] ) )
python-memcached
redis
ERROR:root:Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 353, in wrapper
ret = func(*func_args, **func_kwargs)
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 321, in wrapper
[obj.on_request() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 321, in <listcomp>
[obj.on_request() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 266, in on_request
self.load()
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 231, in load
json_data = self.storage.get(cookie_data)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 1264, in get
return self.execute_command('GET', name)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 775, in execute_command
return self.parse_response(connection, command_name, **options)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 789, in parse_response
response = connection.read_response()
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 642, in read_response
raise response
redis.exceptions.ResponseError: NOAUTH Authentication required.
id= 2
ERROR:root:Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in wrapper
[obj.on_success() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in <listcomp>
[obj.on_success() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 274, in on_success
self.save()
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>
conn.set = lambda key, value, expire, c=conn: (c.set(key,value), c.ttl(expiration))
TypeError: <lambda>() missing 1 required positional argument: 'expire'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 353, in wrapper
ret = func(*func_args, **func_kwargs)
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in wrapper
[obj.on_error() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in <listcomp>
[obj.on_error() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 270, in on_error
self.save()
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>
conn.set = lambda key, value, expire, c=conn: (c.set(key,value), c.ttl(expiration))
TypeError: <lambda>() missing 1 required positional argument: 'expire'
id= 3
ERROR:root:Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in wrapper
[obj.on_success() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in <listcomp>
[obj.on_success() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 274, in on_success
self.save()
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 727, in set
return self._set("set", key, val, time, min_compress_len, noreply)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1052, in _set
return _unsafe_set()
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1036, in _unsafe_set
headers = "%d %d %d" % (flags, time, len_val)
TypeError: %d format: a number is required, not NoneType
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 353, in wrapper
ret = func(*func_args, **func_kwargs)
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in wrapper
[obj.on_error() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in <listcomp>
[obj.on_error() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 270, in on_error
self.save()
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 727, in set
return self._set("set", key, val, time, min_compress_len, noreply)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1052, in _set
return _unsafe_set()
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1036, in _unsafe_set
headers = "%d %d %d" % (flags, time, len_val)
TypeError: %d format: a number is required, not NoneType
id= 4
save
self.storage.set(cookie_data, json.dumps(self.local<span style="color: #660;" class="styled-by-p
...
elif settings.SESSION_TYPE == 'redis':
import redis
host, port = settings.REDIS_SERVER.split(':')
conn = redis.Redis(host=host, port=int(port))
conn.set = lambda key, value, expire, cs=conn.set, ct=conn.ttl: (cs(key,value), ct(expiration))
session = Session(secret=settings.SESSION_SECRET_KEY, storage=conn)
...
ERROR:root:Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in wrapper
[obj.on_success() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in <listcomp>
[obj.on_success() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 274, in on_success
self.save()
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>
conn.set = lambda key, value, expire, cs=conn.set, ct=conn.ttl: (cs(key,value), ct(expiration))
NameError: name 'expiration' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 353, in wrapper
ret = func(*func_args, **func_kwargs)
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in wrapper
[obj.on_error() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in <listcomp>
[obj.on_error() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 270, in on_error
self.save()
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in
save
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>
conn.set = lambda key, value, expire, cs=conn.set, ct=conn.ttl: (cs(key,value), ct(expiration))
NameError: name 'expiration' is not defined
id= 6
ERROR:root:Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in wrapper
[obj.on_success() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in <listcomp>
[obj.on_success() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 274, in on_success
self.save()
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>
conn.set = lambda key, value, expire, cs=conn.set, ct=conn.ttl: (cs(key,value), ct(expiration))
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 1451, in set
return self.execute_command('SET', *pieces)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 775, in execute_command
return self.parse_response(connection, command_name, **options)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 789, in parse_response
response = connection.read_response()
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 642, in read_response
raise response
redis.exceptions.ResponseError: NOAUTH Authentication required.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 353, in wrapper
ret = func(*func_args, **func_kwargs)
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in wrapper
[obj.on_error() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in <listcomp>
[obj.on_error() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 270, in on_error
self.save()
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in
save
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>
conn.set = lambda key, value, expire, cs=conn.set, ct=conn.ttl: (cs(key,value), ct(expiration))
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 1451, in set
return self.execute_command('SET', *pieces)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 775, in execute_command
return self.parse_response(connection, command_name, **options)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 789, in parse_response
response = connection.read_response()
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 642, in read_response
raise response
redis.exceptions.ResponseError: NOAUTH Authentication required.
id= 7
conn.set = lambda key, value, expire, cs=<span style="color: #000;" clas
$ uname
Darwin
$ python -V
Python 3.7.3
$ pip list
Package Version
---------------- --------
redis 3.2.1
$ ./web3py-start applications/
ERROR:root:Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in wrapper
[obj.on_success() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in <listcomp>
[obj.on_success() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 274, in on_success
self.save()
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>
conn.set = lambda key, value, expiration, cs=conn.set, ct=conn.ttl: (cs(key, value), ct(expiration))
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 1511, in ttl
return self.execute_command('TTL', name)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 774, in execute_command
connection.send_command(*args)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 620, in send_command
self.send_packed_command(self.pack_command(*args))
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 663, in pack_command
for arg in imap(self.encoder.encode, args):
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 125, in encode
"byte, string or number first." % typename)
redis.exceptions.DataError: Invalid input of type: 'NoneType'. Convert to a byte, string or number first.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 353, in wrapper
ret = func(*func_args, **func_kwargs)
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in wrapper
[obj.on_error() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in <listcomp>
[obj.on_error() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 270, in on_error
self.save()
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>
conn.set = lambda key, value, expiration, cs=conn.set, ct=conn.ttl: (cs(key, value), ct(expiration))
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 1511, in ttl
return self.execute_command('TTL', name)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 774, in execute_command
connection.send_command(*args)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 620, in send_command
self.send_packed_command(self.pack_command(*args))
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 663, in pack_command
for arg in imap(self.encoder.encode, args):
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 125, in encode
"byte, string or number first." % typename)
redis.exceptions.DataError: Invalid input of type: 'NoneType'. Convert to a byte, string or number first.
docker pull ubuntu
docker run -it --privileged ubuntu /bin/bash
apt update
apt install -y git python3-pip
cd
git clone https://github.com/web2py/web3py
cd web3py
pip3 install -r requirements.
txt
pip3 install mechanize
cd web3py/tests
root@b41c0655fd23:~/web3py/web3py/tests# python3 test_action.py
Traceback (most recent call last):
File "test_action.py", line 9, in <module>
from web3py import action, DAL, Field, Session, Cache
ModuleNotFoundError: No module named 'web3py'
root@b41c0655fd23:~/web3py/web3py/tests# pip3 install web3py
Collecting web3py
Using cached https://files.pythonhosted.org/packages/ee/a2/f57e1fefb0c62b4423fd76ea359d58d2363982054050b8c0ab54ed4b84c5/web3py-0.1.20190426.tar.gz
Complete output from command python setup.py egg_info:
fatal: not a git repository (or any of the parent directories): .git
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-m4zx1t4i/web3py/setup.py", line 25, in <module>
long_description=__doc__ + ' (%s)' % get_hash(),
File "/tmp/pip-build-m4zx1t4i/web3py/setup.py", line 13, in get_hash
return subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip().decode('utf8')
File "/usr/lib/python3.6/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/usr/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'rev-parse', 'HEAD']' returned non-zero exit status 128.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-m4zx1t4i/web3py/
cd ../..
./web3py-start applications/ &
cd web3py/tests
root@b41c0655fd23:~/web3py/web3py/tests# python3 test_action.py
Traceback (most recent call last):
File "test_action.py", line 9, in <module>
from web3py import action, DAL, Field, Session, Cache
ModuleNotFoundError: No module named 'web3py'
git clone https://github.com/web2py/web3py
cd web3py
$ pip3 install -r requirements.txt
Collecting memcache (from -r requirements.txt (line 9))
Could not find a version that satisfies the requirement memcache (from -r requirements.txt (line 9)) (from versions: )
No matching distribution found for memcache (from -r requirements.txt (line 9))
python-memcached
ERROR:root:Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 327, in wrapper
[obj.on_success() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 327, in <listcomp>
[obj.on_success() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 276, in on_success
self.save()
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 727, in set
return self._set("set", key, val, time, min_compress_len, noreply)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1052, in _set
return _unsafe_set()
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1036, in _unsafe_set
headers = "%d %d %d" % (flags, time, len_val)
TypeError: %d format: a number is required, not NoneType
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 355, in wrapper
ret = func(*func_args, **func_kwargs)
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 330, in wrapper
[obj.on_error() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 330, in <listcomp>
[obj.on_error() for obj in fixtures]
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 272, in on_error
self.save()
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 727, in set
return self._set("set", key, val, time, min_compress_len, noreply)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1052, in _set
return _unsafe_set()
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1036, in _unsafe_set
headers = "%d %d %d" % (flags, time, len_val)
TypeError: %d format: a number is required, not NoneType
id= 13
web2.py existed before web2py and did not hurt us.web3py existed before web3.py and in fact I own the domain name. It will not hurt us either.I am more concerned by the confusion between web2py for python 3 vs web3py.I am thinking it should have two names "web3py XYZ" where XYZ is t.b.d.On Thursday, 18 April 2019 04:26:59 UTC-7, Kevin Keller wrote:Yeah saw that too.I agree it's worthwhile to go for a different name eventually.
My 2cYou could call it web2py3 with this logicweb2py was web for Python (at the time it was Python 2.x)web2py3 will the web for Python 3.
Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 560, in import_apps
module = importlib.machinery.SourceFileLoader(app_name, init).load_module()
File "<frozen importlib._bootstrap_external>", line 407, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 907, in load_module
File "<frozen importlib._bootstrap_external>", line 732, in load_module
File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
File "<frozen importlib._bootstrap>", line 696, in _load
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/sugizo/learn/python/web3py/applications/_dashboard/__init__.py", line 12, in <module>
T = Translator(T_FOLDER)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pluralize/__init__.py", line 60, in __init__
self.load(folder)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pluralize/__init__.py", line 65, in load
for filename in os.listdir(folder):
FileNotFoundError: [Errno 2] No such file or directory: '/Users/sugizo/learn/python/web3py/applications/_dashboard/translations'
Traceback (most recent call last):
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 560, in import_apps
module = importlib.machinery.SourceFileLoader(app_name, init).load_module()
File "<frozen importlib._bootstrap_external>", line 407, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 907, in load_module
File "<frozen importlib._bootstrap_external>", line 732, in load_module
File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
File "<frozen importlib._bootstrap>", line 696, in _load
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/sugizo/learn/python/web3py/applications/toys/__init__.py", line 5, in <module>
db = DAL('sqlite://storage.db', folder=os.path.join(os.path.dirname(__file__), 'databases'))
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py", line 171, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py", line 477, in __init__
"Failure to connect, tried %d times:\n%s" % (attempts, tb)
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py", line 457, in __init__
self._adapter = adapter(**kwargs)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/__init__.py", line 39, in __call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/base.py", line 369, in __init__
super(SQLAdapter, self).__init__(*args, **kwargs)
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/base.py", line 53, in __init__
self.reconnect()
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/connection.py", line 154, in reconnect
self.connection = self.connector()
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/sqlite.py", line 42, in connector
return self.driver.Connection(self.dbpath, **self.driver_args)
sqlite3.OperationalError: unable to open database file
127.0.0.1 - - [12/May/2019 08:44:49] "GET /_dashboard HTTP/1.1" 404 459
127.0.0.1 - - [12/May/2019 08:46:38] "GET /_dashboard/index HTTP/1.1" 404 459
mkdir applications/_dashboard/databases/
mkdir applications/_dashboard/translations/
127.0.0.1 - - [12/May/2019 08:44<span styl