[web2py] Things to do to secure server running purely web2py?

2017-02-16 Thread lyn2py
I am planning to go with DigitalOcean or Linode or Aliyun. What do you do or steps do you take to secure your server? Thank you, I am a noob at this. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.

[web2py] Re: Query on a field from a referenced field

2017-02-16 Thread Gael Princivalle
Thank you Leonel for this solution that works perfectly. I've to study more the complex queries. Il giorno mercoledì 15 febbraio 2017 00:39:16 UTC+1, Leonel Câmara ha scritto: > > One way to do it would be to use *belongs* > > user_event_ids = db(db.events_users.created_by == auth.user.id)._sele

[web2py] Re: Call functions from other applications without network requests

2017-02-16 Thread Brendan Barnwell
On Friday, January 13, 2017 at 8:21:48 AM UTC-8, Anthony wrote: > > > You can use the DAL from modules as well. As Niphlod suggested, you can >>> also use the scheduler to schedule and run a task in the context of another >>> app, though that might not be as fast as you'd like, as even setting >

[web2py] Re: Call functions from other applications without network requests

2017-02-16 Thread Anthony
> > In your example above, it's one model defining tables from another model. > But in my case, what I have is a controller function that needs access to > the db, which is defined in the model file. But I found the hard way (and > later also from an old thread: > https://groups.google.com/f

[web2py] Re: compile error : Exception: name 'session' is not defined in views

2017-02-16 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. Glad my code is not a problem. Kind regards, Annet > Your code is not a problem, as it is all Python code that gets executed at > run time. The problem is with Python code within the "include", "extend", > and "block" statements, which are part of the templ

[web2py] Changing admin password

2017-02-16 Thread Ian W. Scott
I seem to have forgotten the admin password for my web2py installation, so I need to change it. Looking at posts here, the recommendation was: 1 - stop apache server 2 - restart web2py 3 - enter new password 4 - restart apache server I'm getting stuck at 2. The only way I know how to "restart"

Re: [web2py] Changing admin password

2017-02-16 Thread Richard Vézina
Hello Ian, Not sure I understand your exact problem, but you can reset admin password like this : sudo -u www-data python -c "from gluon.main import save_password; save_password('123456',443)" Where 123456 is you pass phrase. 443 is the port for which the password apply This will create parame

[web2py] web2py & react

2017-02-16 Thread José Luis Redrejo
Inspired by https://medium.com/react-redux/introducci%C3%B3n-a-redux-js-8bdf4fe0751e#.iqodqn8cc I have created a small project, using web2py instead of Django: https://github.com/jredrejo/web2pyreactpoc As usual, it's much easier ;) I've created three different pages, with different degrees of i

[web2py] Re: web2py & react

2017-02-16 Thread José Luis Redrejo
Sorry, bad link in my previous email. The article that inspired me was https://hackernoon.com/ reconciling-djangos-mvc-templates-with-react-components-3aa986cf510a#. 5605vfe3r José L. 2017-02-16 19:04 GMT+01:00 José Luis Redrejo : > Inspired by https://medium.com/react-redux/introducci%C3%B3n-a-

Re: [web2py] Changing admin password

2017-02-16 Thread Ian W. Scott
Alright, thanks Richard. I'm still fuzzy about the last part where you say I should "restart the web2py instance." I thought that apache simply provided access to web2py. I've never had to do anything to start a "web2py instance." So what is the "web2py instance" and how do I restart it? Thanks

Re: [web2py] Changing admin password

2017-02-16 Thread Ian W. Scott
Also, in the command you give above, what is the "www-data" argument? Is that the path to the directory set up in apache to hold web content? I appreciate your help with these very basic questions. As you can tell, I'm stuck trying to run a server without any experience or training. So when thi

Re: [web2py] Changing admin password

2017-02-16 Thread Ian W. Scott
Never mind. I figured it out. "www-data" is the user name for the home/ directory holding my web2py data. I'm still not sure about "restarting a web2py instance" but I restarted apache and the new password worked. Thanks a lot for your help! Ian On Thursday, February 16, 2017 at 11:46:44 AM UT

Re: [web2py] Changing admin password

2017-02-16 Thread Richard Vézina
Yeah it depends how things are configured, for instance I need to start uwsgi service in order to allow web2py to work, just start/restart nginx is not controlling web2py instance... Also you mention about rocket server, so I am a bit puzzled on how your server is configured... But, replacing (wit

[web2py] Re: Call functions from other applications without network requests

2017-02-16 Thread Brendan Barnwell
On Thursday, February 16, 2017 at 6:39:37 AM UTC-8, Anthony wrote: > > In your example above, it's one model defining tables from another model. >> But in my case, what I have is a controller function that needs access to >> the db, which is defined in the model file. But I found the hard way (

[web2py] Smarthumb computed fields not computed after register

2017-02-16 Thread Gael Princivalle
Hello. I've add Smartthumb computed fields in auth_user. Smarthumb compute images: http://www.web2pyslices.com/slice/show/1522/generate-a-thumbnail-that-fits-in-a-box In the model: auth.settings.extra_fields['auth_user']= [ Field('image_user', 'upload', label=T('Profile user image'), requires

[web2py] 2 email configurations

2017-02-16 Thread Gael Princivalle
Hello. I use a mailgun smtp for large invoices. It works fine but the invoice could begin after a couple of minutes. I use registration requires verification: auth.settings.registration_requires_verification = True If the user wait for this email verification for 2 minutes he could think there'

[web2py] Re: Call functions from other applications without network requests

2017-02-16 Thread Anthony
> > What I don't like about this is that it means the DB-setup code is run >>> multiple times on a "normal" request. That is, if I have code to set up >>> the DB in my model file, and I visit my db-accessing controller, it runs >>> the code in the model file to set up the DB, then runs the cod

Re: [web2py] Re: web2py.component equivalent for =LOAD

2017-02-16 Thread Richard Vézina
{{=LOAD()}} = HTML web2py.component() = JS Signature should be similar, read the doc... Richard On Tue, Feb 14, 2017 at 4:26 PM, wrote: > just realized there are some typo... so is it > > web2py.component('{{=URL('default', 'test.load',args=['lspci'])}}', > target='component1') > > =LOAD is

[web2py] Re: Smarthumb computed fields not computed after register

2017-02-16 Thread Leonel Câmara
Yes. There are 2 web2py bugs here. The first one that is probably affecting you is that auth.user which is cached in the session is not being updated with the thumbnail values. The second one you can read about here: https://groups.google.com/forum/#!topic/web2py-developers/gwEr1cHQNAY Anyway, w

[web2py] Why doesn't web2py create a PostgreSQL database automatically (curiosity, not criticism)

2017-02-16 Thread Tom Campbell
As a database admin newb last year I had trouble deploying a PostgreSQL site because I forgot that "real" DBMSes require you create a database first, unlike SQLite. So I was trying to create tables in a nonexistent database. Is there some reason web2py doesn't just create a PostgreSQL database

[web2py] Re: Why doesn't web2py create a PostgreSQL database automatically (curiosity, not criticism)

2017-02-16 Thread 黄祥
pardon, not sure i got what u mean, when starting new project that use postgresql, i usually create the database from the terminal, ensure DAL migrate is true, then hit the web2py app admin once e.g. # create database /Applications/Postgres.app/Contents/Versions/9.4/bin/createdb -O users new_pro

[web2py] Re: Python Social Auth - example site working with downlevel version of PSA

2017-02-16 Thread Joe Barnhart
Hi Dan -- I've been playing with it awhile. It seems the Mozilla "persona" feature got permeated throughout the plug-in. Which is unfortunate since persona is now room-temperature, making all that code into bloat. I'm trying to prune through it, but confusingly much of the javascript stuff s

[web2py] Re: 2 email configurations

2017-02-16 Thread Gaurav Vichare
Yes , you can. from gluon.tools import Mail other_mail = Mail() other_mail.settings.server = 'smtp.example.com:25' other_mail.settings.sender = 'u...@example.com' other_mail.settings.login = 'username:password' And for sending emails other_mail.send('y...@example.com','Message subject',

[web2py] Re: Why doesn't web2py create a PostgreSQL database automatically (curiosity, not criticism)

2017-02-16 Thread Tom Campbell
Thanks, Stifan, you rock as always. I thought I had tried & failed with this but I trust you on these matters more than myself. Can't wait to get to my db machine to re-test -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code

[web2py] Re: Things to do to secure server running purely web2py?

2017-02-16 Thread Tom Campbell
As usual the web2py book has tons of great info in the Deployment chapter. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.co