You may also want to consider the availability of your applications. By
having all your apps on a single server and if the server is down, all your
apps will also be impacted. Unless, you have high availability built in at
the server level, i.e. cluster.
On Sep 7, 2017 7:00 AM, "Najtsirk"
Thanks!
On Saturday, 2 September 2017 06:16:17 UTC+2, Massimo Di Pierro wrote:
>
> It is fine to have one web2py and as many domains as you need. It should
> not affect performance provided you take advantage of the cores you have.
> That means you want to make sure you use nginx+uwsgi or
It is fine to have one web2py and as many domains as you need. It should
not affect performance provided you take advantage of the cores you have.
That means you want to make sure you use nginx+uwsgi or gevent or gunicorn
and have about one process per core.
On Friday, 1 September 2017
yes, the new tables same for all which is base on detail_coa.
the idea is to separate it is base on the case
e.g.
user input data on chart_of_account table e.g. :
-cash
-bank a
-bank b
the same thing goes for account table that automatically create
chart_of_account table to maintain the data of
Is detail_coa the same or nearly the same for all of these tables? If so,
do you really need separate tables, rather than a single table that simply
includes an extra field on which to partition it?
On Tuesday, July 25, 2017 at 11:12:34 PM UTC-4, 黄祥 wrote:
>
> let say i have table that will
Thank you!
On Saturday, December 31, 2016 at 8:56:26 AM UTC-5, Anthony wrote:
>
> On Friday, December 30, 2016 at 8:26:08 PM UTC-5, LoveWeb2py wrote:
>>
>> Hi Stifan,
>>
>> Thank you for replying again.
>>
>> Is the best way to check for that in the controller? The book says it's
>> best to
On Friday, December 30, 2016 at 8:26:08 PM UTC-5, LoveWeb2py wrote:
>
> Hi Stifan,
>
> Thank you for replying again.
>
> Is the best way to check for that in the controller? The book says it's
> best to handle calls in the controller, but just confirming on the forum.
>
It is generally
Hi Stifan,
Thank you for replying again.
Is the best way to check for that in the controller? The book says it's
best to handle calls in the controller, but just confirming on the forum.
On Friday, December 30, 2016 at 7:27:00 PM UTC-5, LoveWeb2py wrote:
>
> Hello,
>
> I'm wondering if it's
why not use if condition to check args that meet with ur requirements?
e.g.
# if not sure about args value
if 'args' in request.args:
# bla bla
# if sure about args value
if request.args == 'args':
# bla bla
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book
that this function is also available from outside (ajax) and not just
within my controllers
def testfunction(dummy=None):
return dict()
in a controller can't be called as a function from a web request.
tl;dr: a function defined with any number of arguments isn't callable in a
web
perfect! This seems like a good solution. In most cases I have at least one
parameter anyway.
--
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
Il 13/05/15 12:52, Alex ha scritto:
perfect! This seems like a good solution. In most cases I have at
least one parameter anyway.
Another option is to put them inside a model sub-directory called with
the same name as the controller.
The content of this folder will be read only calling that
From the book http://Functions that take arguments or start with a double
underscore are not publicly exposed and can only be called by other
functions.:
*Functions that take arguments or start with a double underscore are not
publicly exposed and can only be called by other functions*.
So
hi carlos,
in production and staging environment, which is passed the development and
testing stage, pushed the web2py application folder to the path and set
ownership and permission using puppet.
for development and testing not using puppet, because it is use by
developer and system analyst
On Monday, February 10, 2014 6:30:47 PM UTC-8, 黄祥 wrote:
please use version control (git, mercury for your code) and then backup it
up to another media as well (nas, tape) or you could store it in online
backup like (dropbox, google drive) if it's your own project, i don't think
so in
Stifan - can you tell us more of how you use Puppet with web2py
applications?
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
I have used rsync to update models, controllers, views, modules and so on.
For database updates I create a separate script and test, test, test it. I
don't use the DAL. Sometimes I write SQL, sometimes python using the
database driver. Going forward it will probably just be SQL.
On a
I use git; I think the situation you describe is why version control
systems exist. git is nice for lots of reasons; one of them is that you
don't need any git 'server' software if your development is on the same
machine, and if you do need servers, there are great internet options which
you
I just started using mercurial with bookmarks, it's supposed to be very
much like git. It's something great! I work on the trunk head, but when I
spot a bug, I update to stable, fix it, then update to trunk and merge
it. The bug is fixed in both versions, but I only had to type once. It even
On Monday, February 10, 2014 2:24:14 PM UTC-8, pa...@cancamusa.net wrote:
I just started using mercurial with bookmarks, it's supposed to be very
much like git. It's something great! I work on the trunk head, but when I
spot a bug, I update to stable, fix it, then update to trunk and merge
please use version control (git, mercury for your code) and then backup it
up to another media as well (nas, tape) or you could store it in online
backup like (dropbox, google drive) if it's your own project, i don't think
so in your company allowed it to do so.
i'm usually make a folders
sorry forgot to tell, i'm use configuration management (e.g. puppet, etc)
for push the script to the machine (staging and production). so only the
developer and system analyst can commit it (development and testing), and
for promote to another environment is their own superior access.
best
I think you could modify rocket to return a 404 for a request with an etag
or if-not-modified request in that particular folder, that should probably
do it, to prevent downloads from the same device. for downloads from
different devices, the approach like niphlod said would work, set a
I need a way to make downloads private/one time for the user.
What is the best practice for this?
Some tools I'd use:
- File blob storage fields
- File group ownership list:reference auth_group field
You could check for empty group ownership in case of no authentication
needed. This
* Should I need a special download script? My guess is yes.
hm, not sure about the special one. what do you want to achieve using the
special download script?
* Should I have a special directory and how would I best do that?
if you want to store it on directory, you can check it on
On Sunday, November 10, 2013 7:49:00 AM UTC+1, Encompass solutions wrote:
I need a way to make downloads private/one time for the user.
What is the best practice for this?
* Should I need a special download script? My guess is yes.
* Should I have a special directory and how would I best do
Great input! I think I will try the following:
Create a special directory to store the data.
Setup a special controller with the needed permissions and conditions.
Have fun and do a little dance.
Does this sound sensible?
BR,
Jason
On Sun, Nov 10, 2013 at 2:43 PM, Niphlod niph...@gmail.com
Still climbing my initial learning curve, the databases/*wiki* files are
the web2py table definition files I believe. I will need to export the
wiki data as part of the migration process.
One option I'm evaluating is to export the wiki data in CSV format. I've
exposed the wiki tables to
form.vars.fieldname = 'fieldvalue'
-Jim
On Wednesday, October 31, 2012 6:13:20 PM UTC-5, MichaelF wrote:
I have a 'regular' form (i.e., FORM, not SQLFORM). I want to prepopulate
some of the fields, but I don't know the values to use for them when I
first create the form. What's the best
Jim,
Thanks. I had already tried that, and it doesn't work for me. I wrote a
little controller to test it:
@auth.requires_login()
def test_vars():
form = FORM(
FIELDSET('Subject: ', INPUT(_name='subject')),
FIELDSET('Other subject: ', INPUT(_name='otherSubject')),
You can do:
otherSubject = request.post_vars.otherSubject or 'whatever'
form = FORM(
FIELDSET('Subject: ', INPUT(_name='subject')),
FIELDSET('Other subject: ', INPUT(_name='otherSubject', value
= otherSubject)),
FIELDSET('Recipients: ', INPUT(_name='recips', )),
This is a nice solution, and clever, thanks!
The upside (compared to postgres locks, as discussed above) is this works
for any database. The downside is it creates a whole new table.
On Thursday, July 5, 2012 2:49:36 PM UTC-7, nick name wrote:
This might have been solved in this week, but in
This might have been solved in this week, but in case it wasn't:
You're tackling a general database problem, not a specific task queue or
web2py problem. So you need to solve it with the database: set up another
table to refer to you the task table, such as:
On Wednesday, June 27, 2012 5:02:26 PM UTC-7, ptressel wrote:
This won't solve your installation / setup issue, but I wonder if it would
help with the overrun and timeout problems... Instead of scheduling a
periodic task, what about having the task reschedule itself? When it's
done with
I don't know if continuing to give you fixes and alternative
implementations is to be considered as harassment at this point, stop me if
you're not interested into those.
There is a very biiig problem in your statements: if your vision is
Woohoo, this scheduler will *automatically handle
I'm totally interested in solutions! It's a big problem I need to solve.
The recurring maintenance task does not fix the initialization
problem—because now you need to initialize the recurring maintenance task.
This results in the same race condition. It does fine with the 40,000
records
The problem with terminating the processes is:
• sometimes they don't respond to control-c, and need a kill -9
• or sometimes that doesn't work, maybe the os is messed up
• or sometimes the developer might run two instances simultaneously,
forgetting that one was already running
You're
I don't find that this is a common scenario, anyway my idea was put the
insertion/update of the task at cron @reboot, wrap that code in a
try:except pass block and let the maintenance task to do the honours of
checking if other 3 functions are ok. maintenance will run let's say, with
a period
uhm. why not having them started with systemd or upstart or supervisord
?
Scheduler is by design allowed to run with multiple instances (to process
a longer queue you may want to start more of them), but if you're really
loosing money why didn't you rely on that services to be sure that
Michael --
Here's a common scenario. I'm looking for the best implementation using the
scheduler.
I want to support a set of background tasks (task1, task2...), where each
task:
• processes a queue of items
• waits a few seconds
It's safe to have task1 and task2 running in parallel,
:)
Because I'm a perfectionist, and I want other developers to be able to
install my system by just unzipping the code, running ./serve, and have it
just work. So I want to use the built-in webserver and scheduler. There's
no reason they shouldn't be able to manage these race conditions
well, after all the time you spent after it, it's quite a bold statement.
Current scheduler (in trunk there has been a problem, attached the correct
one) reassign RUNNING tasks if a worker is killed in action, but you may
want to check if in scheduler_worker table you have entries for dead
Michael, I intend to use the scheduler for infinite looping background tasks.
From what I have read in this thread, I see the issue is that you are most
concerned about race conditions.
I am yet to do this with web2py scheduler, but why not have something in cron
at reboot to insert and
Wouldn't lock-free mechanisms be more useful?
On Wed, Jun 27, 2012 at 4:10 AM, Andrew awillima...@gmail.com wrote:
Michael, I intend to use the scheduler for infinite looping background tasks.
From what I have read in this thread, I see the issue is that you are most
concerned about race
problem here started as I can't ensure my app to insert only one task per
function, that is not a scheduler problem per se: it's a common database
problem. Would have been the same if someone created a
db.define_table('mytable',
Field('name'),
Field('uniquecostraint')
)
and have to
All, thank you for the excellent discussion!
I should explain why I posted that recommendation. The vision of using
the scheduler for background tasks was:
Woohoo, this scheduler will *automatically handle locks*—so I don't need
to worry about stray background processes running in parallel
In case it is useful to someone, here is the full code I used with locking,
using postgresql advisory locks. The benefit of using postgresql's locks
are that:
• It locks on the database—works across multiple clients
• The locks are automatically released if a client disconnects from the db
This scenario is working out worse and worse.
Now I'm getting tasks stuck in the 'RUNNING' state... even when there
aren't any scheduler processes running behind them running! I'm guessing
the server got killed mid-process, and now it doesn't know how to recover.
Looks like a bug in the
Er, let me rephrase: I don't recommend using the scheduler for *infinitely
looping background tasks*.
On Monday, June 25, 2012 4:54:30 PM UTC-7, Michael Toomim wrote:
This scenario is working out worse and worse.
Now I'm getting tasks stuck in the 'RUNNING' state... even when there
aren't
I see Rails is adding some sort of queue:
http://news.ycombinator.com/item?id=3899080
--
I'll get back to you this evening, but for now, maybe it's a fix.
You're afraid that starting n web2py processes your code in initialize
will duplicate inserts. That is the common behaviour in db
transactions. if you're running three processes, and you're not lucky,
all three will see
Thanks for the response, niphlod! Let me explain:
The task can be marked FAILED or EXPIRED if:
• The code in the task throws an exception
• A run of the task exceeds the timeout
• The system clock goes past stop_time
And it will just not plain exist if:
• You have just set up the code
To respond to your last two points:
You're right that models only runs on every request... I figured if my
website isn't getting any usage then the tasks don't matter anyway. :P
Yes, I think there are design issues here, but I haven't found a better
solution. I'm very interested in hearing
Maybe I didn't get exactly what you need , but .. you have 3 tasks,
that needs to be unique.
Also, you want to be sure that if a task crashes doesn't remain hanged.
This should never happen with the scheduler the worst situation is
that if a worker crashes (here crashes is it
Hi Anthony, you understand my needs perfectly. I will try your
solution. Thanks
Spring
On Oct 29, 1:26 pm, Anthony abasta...@gmail.com wrote:
On Saturday, October 29, 2011 1:17:43 AM UTC-4, pbreit wrote:
Not the best urls but could you put them in static?
I assume he meant the main page
You could create a single function (maybe call it something like 'content')
and pass an argument in the URL to determine the view to display:
def content():
response.view = 'default/%s.%s' % (request.args(0), request.extension)
if request.args else 'default/index.html'
return dict()
Also, using the parameter-based router, you could make 'content' the
default function, so it would be hidden in the URL.
On Friday, October 28, 2011 9:58:58 PM UTC-4, Anthony wrote:
You could create a single function (maybe call it something like
'content') and pass an argument in the URL to
Not the best urls but could you put them in static?
Even if it's 20 or 50 pages, I would suggest just doing it the web2py way with
functions.
On Saturday, October 29, 2011 1:17:43 AM UTC-4, pbreit wrote:
Not the best urls but could you put them in static?
I assume he meant the main page content is static but the pages still need
to take advantage of web2py views for navigation, etc., so they aren't true
static files.
Be careful about using an 'except' without specifying specific exception
types -- that code will attempt an insert regardless of the reason for the
failure in the 'try' clause.
Anthony
On Saturday, July 2, 2011 6:05:46 PM UTC-4, Nick Arnett wrote:
Getting more comfortable with Web2Py and
On Sat, Jul 2, 2011 at 7:39 PM, Anthony abasta...@gmail.com wrote:
Be careful about using an 'except' without specifying specific exception
types -- that code will attempt an insert regardless of the reason for the
failure in the 'try' clause.
I was wondering if someone would mention that...
Do this instead
try:
urlID = db.web_page(url=url).id
except (KeyError,TyepError):
urlID = db.web_page.insert(url=url)
or better
row = db.web_page(url=url)
urlID = row and row.id or db.web_page.insert(url=url)
If db.web_page(url=url) fails with an OperationalError (database
I just ran into a problem with the Ebay API that does not accept image URL
lengths over 150 chars. Is the only immediate fix to make that edit to
gluon/sql.py? Maybe it should be even shorter of configurable? Is that much
entropy needed?
I don't know about web2py specific processes, but I believe py2exe can
install your python application as a Windows service.
On Apr 27, 1:04 pm, teemu teemu.kuulas...@gmail.com wrote:
Hi,
I would like to know what would be the best way to start background
process in production environment. I
This is a copy paste of something I wrote a month ago or so:
I was able to get background processes to work pretty well. I have an import
script that takes a minute or two to run and is started by an ajax call from
a button in one of my views, and the progress is reported back to the page
as
I tried the cron@reboot approach but couldn't figure out if my processes
were running or failing so I switched to per minute cron tasks.
At some point it would be nice to have something like Dealyed Jobs
(https://github.com/tobi/delayed_job) or Celery suport
(http://celeryproject.org).
I think that a simple system cron is the most reliable (per minute,
per hour, per day). Then use some type of locking mechanism in your
web2py script (either database or file). For example:
locked = db((db.report_queue.status=='SystemLock')).select().first()
if not locked:
locked =
Hi Dave
You should obtain experience with individual controllers and views.
The book is well ordered to take you through the learning curve. Try
to get to the point where you feel confident about what's going on
before moving down the list.
The Crud is ideal for fast prototyping and quick apps
David,
Thanks for the advice. Makes sense to me am working through the book at
present. Patience not my strongest point :-)
Dave
--
Dave Warnock: http://42.blogs.warnock.me.uk
Cycling Blog: http://42bikes.warnock.me.uk
weather you're looking to distribute or even just for your self, You
can always use Distribute. The learning curb isn't huge and has many
bultin features (i.e. find_packages() which you may find helpful
here).
ANyways, here a link.
http://packages.python.org/distribute/setuptools.html#id3
Mart
How can do for bytecode compile work in this case?
On Oct 22, 3:03 am, mdipierro mdipie...@cs.depaul.edu wrote:
Not sure this works. Does it?
{{extendvariable}} works as long as you do not bytecodecompile.
On Oct 21, 12:29 pm, cjrh caleb.hatti...@gmail.com wrote:
On Oct 21, 5:17 pm,
I cannot think of an easy way to do it.
On Nov 6, 3:52 am, toan75 toa...@gmail.com wrote:
How can do for bytecode compile work in this case?
On Oct 22, 3:03 am, mdipierro mdipie...@cs.depaul.edu wrote:
Not sure this works. Does it?
{{extendvariable}} works as long as you do not
Download a few of http://web2py.com/layouts and install them.
The look at views/plugin_layouts/layouts/*.html
Everything you downloaded is kept. TO re-instate
cp views/plugin_layouts/layouts/xxx.html views/layout.html
On Oct 21, 7:42 am, cjrh caleb.hatti...@gmail.com wrote:
Hi
I have a
On Oct 21, 3:15 pm, mdipierro mdipie...@cs.depaul.edu wrote:
cp views/plugin_layouts/layouts/xxx.html views/layout.html
Perhaps I am missing something, but surely if views/layout.html is
replaced, it is replaced for all users? I want to show different
users some pages that are generated using
I tried something like this in a mock cms application. Depending on
the logged in user I set the view in a conditional in the controller
or in the function.
if auth.has_membership(group_id=user_x):
response.view='user_x_view.html'
if auth.has_membership(group_id=user_y):
On Oct 21, 4:05 pm, annet annet.verm...@gmail.com wrote:
if auth.has_membership(group_id=user_x):
response.view='user_x_view.html'
if auth.has_membership(group_id=user_y):
response.view='user_y_view.html'
Ok, but then would do you just keep copies of your view files around,
save only
I needed different views extending the same layout, what you want is
different layouts extended with the same view, right?
In the view something like?
{{if user_x:}}
{{extend 'user_x_view.html'}}
{{elif user_y:}}
{{extend 'user_y_view.html'}}
{{else:}}
{{extend 'user_z_view.html'}}
On Oct 21, 10:03 pm, mdipierro mdipie...@cs.depaul.edu wrote:
Not sure this works. Does it?
{{extend variable}} works as long as you do not bytecode compile.
I'll give it a try in the next few days and keep you posted.
Interesting comment about bytecode compiling.
I think I understood most of that already. Maybe my explanation of
what I was looking for was lacking. Essentially, I am trying to
implement the concept discussed here:
http://css-tricks.com/pointer-events-current-nav/
but in html instead of css.
On Aug 4, 3:59 am, mdipierro
The ul.../ul code in Django in web2py translates with
{{=MENU(response.menu)}}
where (using the data in your example)
response.menu=[
('Home',request.function=='home',URL(r=request,f='home'),[]),
('Store Information',request.function=='info',URL(r=request,f=info'),
[]),
]
The latter code
Yes but that only works in the earlier welcome scaffold shipped with
web2py 1.79.x or so.
The latest web2py's welcome uses SuperFish menu (
http://users.tpg.com.au/j_birch/plugins/superfish/ ), which is
supposed to be capable for that too, but in fact the out-of-box
welcome/static/base.css losts
Any objection to make this 200?
Massimo
On Apr 19, 6:22 pm, Rowdy da...@fielden.com.au wrote:
mdipierro wrote:
I was not aware of this limit.
In gluon/sql.py you should replace:
newfilename = newfilename[:500] + '.' + extension
with something like
newfilename = newfilename[:120] +
mdipierro wrote:
Any objection to make this 200?
Massimo
The limit seems to be NTFS with a maximum of 226 characters.
I have accumulated nearly 60,000 files in a legacy application, and the
longest extension is 5 characters (.batch).
No objection from me.
Rowdy
--
Subscription settings:
Nice to hear that still works. :)
Actually yesterday I found it was broken in latest web2py windows
binary distribution, but that is not my fault, it is only because that
binary build is lack of standard module logging/*. Anyway, you can
bypass that by a try...except. Just for your information.
84 matches
Mail list logo