[web2py] Re: web2py gunicorn dockerfile

2018-01-06 Thread Alex Beskopilny
small fix 1 FROM python:2.7 RUN apt update && apt install -y unzip wget RUN /usr/local/bin/pip install gunicorn RUN groupadd -r web2py && useradd -m -r -g web2py web2py USER web2py WORKDIR /home/web2py RUN wget -c http://web2py.com/examples/static/web2py_src.zip && unzip -o web2py_src.zip && r

[web2py] Re: web2py gunicorn dockerfile

2018-01-06 Thread Alex Beskopilny
1 Dockerfile FROM python:2.7 RUN apt update && apt install -y unzip wget RUN /usr/local/bin/pip install gunicorn RUN groupadd -r web2py && useradd -m -r -g web2py web2py USER web2py RUN cd /home/web2py/ && wget -c http://web2py.com/examples/static/web2py_src.zip && unzip -o web2py_src.zip &&

[web2py] Re: web2py gunicorn dockerfile

2018-01-06 Thread 黄祥
after reread and relearn your dockerfile again it works with some modification with python image (installed gunicorn from pip install not from apt install, and port set into 8000, port 80 not work) docker run -p 80:80 imageid [2018-01-07 01:02:10 +] [8] [INFO] Starting gunicorn 19.7.1 [2018-0

[web2py] Re: web2py gunicorn dockerfile

2018-01-06 Thread 黄祥
yes, it works when using os base image (tested using ubuntu (like in the first post), centos, debian, fedora), the problem occured when using python base image. the point is when using os base image, it took longer (to install prerequisites package like python curl, git, dll) than using python b

[web2py] auto increment field that reset evry year

2018-01-06 Thread Andrea Santini
need to create an auto increamet Field that reset to 1 every Year. db.define_table('protocol',Field('n_protocol'),Field('year_protocol',type='datetime', writable = False, readable = False, default=request.now, requires=(IS_DATETIME(timezone=pytz.timezone("Europe/Gibraltar"),format=('%Y'

[web2py] custom user registration

2018-01-06 Thread Walter Okine
i have disable registration i have registered two admin. and added extra fields company_name and status I want these two admin to be able to register others and pass the company_name to each user they register Example Admin 1 company is xyz so when he register other users their company_name s

Re: [web2py] Re: horizontal scaling question

2018-01-06 Thread Anthony
Something like that -- it depends on what is easiest. If writing happens in only a few places, then you can maintain a list of the functions that do writes rather than those that only do reads. You could also take Dave's approach and use the HTTP method to determine the connection: READ_ONLY_UR

Re: [web2py] Re: horizontal scaling question

2018-01-06 Thread Chinh Dang
So given the example below from the book, I would add all the controller functions that does database read to read_only_actions list? I would have to continuously maintain this list as my application grows. Is this the right approach? if request.function in read_only_actions: db = DAL(sample(['

Re: [web2py] Re: horizontal scaling question

2018-01-06 Thread Dave S
On Friday, January 5, 2018 at 7:50:28 PM UTC-8, CDA wrote: > > How does web2py select a database to connect to based on the http request > content? Is it feasible to connect to different databases depending on > whether it is a read request or a write request? Can you provide example on > how