[web2py] Re: Code changes on live server not showing up

2016-06-22 Thread Marty Jones
I see. Are there any web2py-specific caching settings I should check?

On Wednesday, June 22, 2016 at 11:18:50 AM UTC-4, Anthony wrote:
>
> On Wednesday, June 22, 2016 at 10:39:23 AM UTC-4, Marty Jones wrote:
>>
>> No. I was under the impression it doesn't need to be. Does it?
>>
>
> No, it doesn't need to be compiled, but it will run faster. Anyway, if 
> changes aren't showing up, either you are doing some caching, or the code 
> you're changing isn't the code that's actually running in production.
>
> Anthony
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Code changes on live server not showing up

2016-06-22 Thread Marty Jones
No. I was under the impression it doesn't need to be. Does it?

On Tuesday, June 21, 2016 at 10:46:33 PM UTC-4, Anthony wrote:
>
> Is your application compiled?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Code changes on live server not showing up

2016-06-21 Thread Marty Jones
I made a few changes on a DigitalOcean server running Web2py + uwsgi + 
nginx. The changes were to routes.py and to a couple of views. None of 
these are showing up on the webpage. I tried restarting uwsgi and nginx and 
even rebooting the VPS altogether, but still the changes don't show up. I 
also tried the 'reload routes' button but the desired change isn't showing. 
Is there some other step I'm missing?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: A bunch of strange database errors

2016-06-16 Thread Marty Jones
believe i did clone, but can't remember if i did recursive. should i?

i will get a new start and report back

On Thursday, June 16, 2016 at 12:42:43 PM UTC-4, Richard wrote:
>
> I would download and start fresh... How did you get 2.14.5? git clone? If 
> so did you clone --recursive?
>
> On Thu, Jun 16, 2016 at 12:41 PM, Richard Vézina <ml.richa...@gmail.com 
> > wrote:
>
>> Do they share the same Database, if not it make no sens that auth_user 
>> already exists... Did you modify the welcome app.ini db config? I ask 
>> because web2py use welcome as template for new app...
>>
>> On Thu, Jun 16, 2016 at 12:36 PM, Marty Jones <murtin...@gmail.com 
>> > wrote:
>>
>>> The reason I suspect a non-application-specific issue is that creating a 
>>> new simple app from the web2py admin console results in a similar database 
>>> issue. Visiting the default/index of the new app spits back:
>>>
>>> Traceback (most recent call last):
>>>   File "/home/murtyjones/app/gluon/restricted.py", line 227, in restricted
>>> exec ccode in environment
>>>   File "/home/murtyjones/app/applications/test_users/models/db.py" 
>>> <https://nolabills.com/admin/default/edit/test_users/models/db.py>, line 
>>> 93, in 
>>> auth.define_tables(username=False, signature=False)
>>>   File "/home/murtyjones/app/gluon/tools.py", line 2376, in define_tables
>>> format='%(first_name)s %(last_name)s (%(id)s)'))
>>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/base.py", line 576, 
>>> in define_table
>>> table = self.lazy_define_table(tablename,*fields,**args)
>>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/base.py", line 615, 
>>> in lazy_define_table
>>> polymodel=polymodel)
>>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/adapters/base.py", 
>>> line 768, in create_table
>>> return self.migrator.create_table(*args, **kwargs)
>>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/migrator.py", line 
>>> 269, in create_table
>>> self.adapter.create_sequence_and_triggers(query, table)
>>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/adapters/base.py", 
>>> line 820, in create_sequence_and_triggers
>>> self.execute(query)
>>>   File 
>>> "/home/murtyjones/app/gluon/packages/dal/pydal/adapters/__init__.py", line 
>>> 68, in wrap
>>> return f(*args, **kwargs)
>>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/adapters/base.py", 
>>> line 417, in execute
>>> rv = self.cursor.execute(command, *args[1:], **kwargs)
>>> OperationalError: table auth_user already exists
>>>
>>>
>>>
>>>
>>> On Thursday, June 16, 2016 at 12:28:35 PM UTC-4, Richard wrote:
>>>>
>>>> There shouldn't be issue specific to SQLite (I mean it should work 
>>>> properly), though there is maybe a specific unnoticed issue with it as 
>>>> there has been a big refactoring of pyDAL, I don't recall it the 
>>>> refactored 
>>>> pyDAL was present in 2.14.5
>>>>
>>>>
>>>>
>>>> On Thu, Jun 16, 2016 at 12:22 PM, Marty Jones <murtin...@gmail.com> 
>>>> wrote:
>>>>
>>>>> Done - no change.
>>>>>
>>>>> Is it possible that the issue is SQLite specific and I need to migrate 
>>>>> to MySQL or some other db?
>>>>>
>>>>> On Thursday, June 16, 2016 at 12:14:51 PM UTC-4, Richard wrote:
>>>>>>
>>>>>> Can you comment out the part of the scheduler, the db lock file may 
>>>>>> come from there...
>>>>>>
>>>>>> On Thu, Jun 16, 2016 at 12:05 PM, Marty Jones <murtin...@gmail.com> 
>>>>>> wrote:
>>>>>>
>>>>>>> Controller logic is below. Error 1 is occuring under the "dashboard" 
>>>>>>> function. Errors 2/3 under the user function.
>>>>>>>
>>>>>>> # -*- coding: utf-8 -*-
>>>>>>> # this file is released under public domain and you can use without 
>>>>>>> limitations
>>>>>>>
>>>>>>>
>>>>>>> ###
>>>>>>> ## Launch with all setti

Re: [web2py] Re: A bunch of strange database errors

2016-06-16 Thread Marty Jones
The reason I suspect a non-application-specific issue is that creating a 
new simple app from the web2py admin console results in a similar database 
issue. Visiting the default/index of the new app spits back:

Traceback (most recent call last):
  File "/home/murtyjones/app/gluon/restricted.py", line 227, in restricted
exec ccode in environment
  File "/home/murtyjones/app/applications/test_users/models/db.py" 
<https://nolabills.com/admin/default/edit/test_users/models/db.py>, line 93, in 

auth.define_tables(username=False, signature=False)
  File "/home/murtyjones/app/gluon/tools.py", line 2376, in define_tables
format='%(first_name)s %(last_name)s (%(id)s)'))
  File "/home/murtyjones/app/gluon/packages/dal/pydal/base.py", line 576, in 
define_table
table = self.lazy_define_table(tablename,*fields,**args)
  File "/home/murtyjones/app/gluon/packages/dal/pydal/base.py", line 615, in 
lazy_define_table
polymodel=polymodel)
  File "/home/murtyjones/app/gluon/packages/dal/pydal/adapters/base.py", line 
768, in create_table
return self.migrator.create_table(*args, **kwargs)
  File "/home/murtyjones/app/gluon/packages/dal/pydal/migrator.py", line 269, 
in create_table
self.adapter.create_sequence_and_triggers(query, table)
  File "/home/murtyjones/app/gluon/packages/dal/pydal/adapters/base.py", line 
820, in create_sequence_and_triggers
self.execute(query)
  File "/home/murtyjones/app/gluon/packages/dal/pydal/adapters/__init__.py", 
line 68, in wrap
return f(*args, **kwargs)
  File "/home/murtyjones/app/gluon/packages/dal/pydal/adapters/base.py", line 
417, in execute
rv = self.cursor.execute(command, *args[1:], **kwargs)
OperationalError: table auth_user already exists




On Thursday, June 16, 2016 at 12:28:35 PM UTC-4, Richard wrote:
>
> There shouldn't be issue specific to SQLite (I mean it should work 
> properly), though there is maybe a specific unnoticed issue with it as 
> there has been a big refactoring of pyDAL, I don't recall it the refactored 
> pyDAL was present in 2.14.5
>
>
>
> On Thu, Jun 16, 2016 at 12:22 PM, Marty Jones <murtin...@gmail.com 
> > wrote:
>
>> Done - no change.
>>
>> Is it possible that the issue is SQLite specific and I need to migrate to 
>> MySQL or some other db?
>>
>> On Thursday, June 16, 2016 at 12:14:51 PM UTC-4, Richard wrote:
>>>
>>> Can you comment out the part of the scheduler, the db lock file may come 
>>> from there...
>>>
>>> On Thu, Jun 16, 2016 at 12:05 PM, Marty Jones <murtin...@gmail.com> 
>>> wrote:
>>>
>>>> Controller logic is below. Error 1 is occuring under the "dashboard" 
>>>> function. Errors 2/3 under the user function.
>>>>
>>>> # -*- coding: utf-8 -*-
>>>> # this file is released under public domain and you can use without 
>>>> limitations
>>>>
>>>>
>>>> ###
>>>> ## Launch with all settings via "sudo python run_server.py"
>>>>
>>>> ###
>>>>
>>>> import operator # needed for manager_status variable
>>>>
>>>> response.title = 'nolabills'
>>>>
>>>> def jspage():
>>>> link = URL('static', 'main.js')
>>>> return dict(link=link)
>>>>
>>>> def index():
>>>> """
>>>> For registered users, redirects to the requests page
>>>> For unregistered users, displays intro message
>>>> """
>>>> 
>>>> signup = URL(a=request.application, c='default', f='user/register')
>>>> 
>>>> return dict(is_logged_in=auth.is_logged_in(), signup=signup)
>>>>
>>>> @auth.requires_membership('manager')
>>>> def manage():
>>>> """
>>>> This page, accessible by only managers, shows the current employees
>>>> of a company as well as any users who are registering themselves as
>>>> employees of the company.
>>>> From this page a manager can approve a pending user's membership,
>>>> as well as revoke the membership of a user on the current employee 
>>>> list.
>>>> """
>>>> pending_list = []
>>>> approved_list = []
>>>> if request.post_vars:
>>>> 

Re: [web2py] Re: A bunch of strange database errors

2016-06-16 Thread Marty Jones
Done - no change.

Is it possible that the issue is SQLite specific and I need to migrate to 
MySQL or some other db?

On Thursday, June 16, 2016 at 12:14:51 PM UTC-4, Richard wrote:
>
> Can you comment out the part of the scheduler, the db lock file may come 
> from there...
>
> On Thu, Jun 16, 2016 at 12:05 PM, Marty Jones <murtin...@gmail.com 
> > wrote:
>
>> Controller logic is below. Error 1 is occuring under the "dashboard" 
>> function. Errors 2/3 under the user function.
>>
>> # -*- coding: utf-8 -*-
>> # this file is released under public domain and you can use without 
>> limitations
>>
>>
>> ###
>> ## Launch with all settings via "sudo python run_server.py"
>>
>> ###
>>
>> import operator # needed for manager_status variable
>>
>> response.title = 'nolabills'
>>
>> def jspage():
>> link = URL('static', 'main.js')
>> return dict(link=link)
>>
>> def index():
>> """
>> For registered users, redirects to the requests page
>> For unregistered users, displays intro message
>> """
>> 
>> signup = URL(a=request.application, c='default', f='user/register')
>> 
>> return dict(is_logged_in=auth.is_logged_in(), signup=signup)
>>
>> @auth.requires_membership('manager')
>> def manage():
>> """
>> This page, accessible by only managers, shows the current employees
>> of a company as well as any users who are registering themselves as
>> employees of the company.
>> From this page a manager can approve a pending user's membership,
>> as well as revoke the membership of a user on the current employee 
>> list.
>> """
>> pending_list = []
>> approved_list = []
>> if request.post_vars:
>> for each in request.post_vars:
>> key = request.post_vars.keys()[0]
>> underscore = key.find('_')
>> id = key[0:underscore]
>> change = key[underscore+1:len(key)]
>> change = None if change == "approve" else "unapproved"
>> # modify db accordingly
>> record = db(db.auth_user.id==id).select().first()
>> record.registration_key=change
>> record.update_record()
>>
>> for row in db().select():
>> #for row in db(db.auth_user.company==auth.user.company).select():
>> if row.registration_key: # if pending approval by manager
>> 
>> pending_list.append({row.id:{"first":row.first_name,"last":row.last_name}})
>> else:
>> manager_status = auth.has_membership('manager', row.id)
>> 
>> approved_list.append({row.id:{"first":row.first_name,"last":row.last_name,"manager_status":manager_status}})
>> return dict(pending_list=pending_list, approved_list=approved_list)
>>
>> @auth.requires_login()
>> def dashboard():
>> """
>> This page allows a user to send an email to
>> a potential customer, requesting access to bill data
>> """
>> i = 0
>> already_submitted = False # default is false; can only be changed if 
>> request.post_vars == True
>> 
>> # SQLFORM version
>> data_requests = 
>> SQLFORM.grid(db(db.data_requests.company==auth.user.company),
>>  fields=[db.data_requests.last_name, \
>>  db.data_requests.first_name, \
>>  db.data_requests.email, \
>>  db.data_requests.status, \
>>  db.data_requests.bill_1,
>>  ],
>>  headers={'data_requests.bill_1':'Most 
>> Recent Bill'},
>>  sortable=False,
>>  create=False,
>>  editable=False,
>>  deletable=True,
>>  details=False,
>>  maxtextlength=30,
>>  csv=False,
>>  upload=URL

[web2py] Re: A bunch of strange database errors

2016-06-16 Thread Marty Jones
   task_name = 'request',
 group_name = 'email',
 function_name = 'send_request',
 args = '["{0}", "{1}", "{2}", 
"{3}"]'.format( \
 request.post_vars.first, 
request.post_vars.last, request.post_vars.email, token),
 vars = '{}',
 enabled = True,
 start_time = request.now,
 timeout = 500, # should take less than 
500 secs
 )
# update data_requests to show that the task is 
AWAITING_CUSTOMER
db.data_requests.insert(first_name = 
request.post_vars.first_name,
last_name = request.post_vars.last_name,
email = request.post_vars.email,
company = auth.user.company,
status = 'AWAITING_CUSTOMER',
)


return dict(already_submitted=already_submitted, 
data_requests=data_requests, pending_list=pending_list)

def approve_request():
"""
Allows a customer to approve a data request
"""
submitted = 'submitted'
valid_token = 'valid_token'
invalid_token = 'invalid_token'


# if the user has submitted their data and it's not already in the 
database, let them know we'll get their data
if request.post_vars:
status = submitted

token_submitted = True if db(db.data_requests.email == 
request.post_vars.email).select(db.tokens.submitted).first() else False

if token_submitted == False:
# download data
db.data_requests.insert(first_name = 
request.post_vars.first_name,
last_name = request.post_vars.last_name,
email = request.post_vars.email,
company = auth.user.company,
energy_username = 
request.post_vars.energy_username,
energy_password = 
request.post_vars.energy_password,
)

# if no submission of info, try to give them the option to do so
else:
try:
status = valid_token
token = request.get_vars.token
token_row = db(db.tokens.token == token).select().first()
first_name = token_row.first_name
last_name = token_row.last_name
email = token_row.email
except:
status = invalid_token

if status == submitted or status == invalid_token:
return dict(status=status, submitted=submitted, 
invalid_token=invalid_token, token_submitted=token_submitted)
else:
return dict(status=status, first_name=first_name, 
last_name=last_name, email=email, submitted=False, invalid_token=False, 
token_submitted=False)

def user():
"""
exposes:
http:///[app]/default/user/login
http:///[app]/default/user/logout
http:///[app]/default/user/register
http:///[app]/default/user/profile
http:///[app]/default/user/retrieve_password
http:///[app]/default/user/change_password
http:///[app]/default/user/bulk_register
use @auth.requires_login()
@auth.requires_membership('group name')
@auth.requires_permission('read','table name',record_id)
to decorate functions that need access control
also notice there is http:///[app]/appadmin/manage/auth to allow 
administrator to manage users
"""
return dict(form=auth())

@cache.action()
def download():
"""
allows downloading of uploaded files
http:///[app]/default/download/[filename]
"""
return response.download(request, db)

def call():
"""
exposes services. for example:
http:///[app]/default/call/jsonrpc
decorate with @services.jsonrpc the functions to expose
supports xml, json, xmlrpc, jsonrpc, amfrpc, rss, csv
"""
return service()



On Thursday, June 16, 2016 at 9:36:18 AM UTC-4, Marty Jones wrote:
>
> I uploaded a local application to my DigitalOcean droplet and have been 
> having a nightmare of a time with the databases. I get this variety of 
> errors on various pages:
>
> *Error 1:*
>
> Traceback (most recent call last):
>   File "/home/murtyjones/app/gluon/restricted.py", line 227, in restricted
> exec ccode in environment
>   File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
> <https://nolabills.com/admin/default/edit/nolabills/controllers/de

[web2py] Re: A bunch of strange database errors

2016-06-16 Thread Marty Jones
The user is logged in when the error occurs, yes. And yes to the second 
question as well. I'm logged in as a regular user and am attempting to 
logout.

On Thursday, June 16, 2016 at 11:51:09 AM UTC-4, Anthony wrote:
>
> *Error 1:*
>>
>> Traceback (most recent call last):
>>   File "/home/murtyjones/app/gluon/restricted.py", line 227, in restricted
>> exec ccode in environment
>>   File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
>> , 
>> line 230, in 
>>   File "/home/murtyjones/app/gluon/globals.py", line 417, in 
>> self._caller = lambda f: f()
>>   File "/home/murtyjones/app/gluon/tools.py", line 4241, in f
>> return action(*a, **b)
>>   File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
>> , 
>> line 73, in dashboard
>> data_requests = 
>> SQLFORM.grid(db(db.data_requests.company==auth.user.company),
>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/objects.py", line 91, 
>> in __getattr__
>> raise AttributeError
>> AttributeError
>>
>>
> Is the user logged in when the above occurs? If not, auth.user will be 
> None, and you therefore cannot do auth.user.company.
>  
>
>> *Error 3 (trying to logout as a user):*
>>
>
> What do you mean by "logout *as* a user"? Do you just mean you are logged 
> in and doing a regular logout, or something different?
>
> Anthony
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] A bunch of strange database errors

2016-06-16 Thread Marty Jones
I added "type='string'" but otherwise don't understand the issue with the 
extra field. it's not intended to be a reference to another table. will 
post the controller logic in a separate comment

On Thursday, June 16, 2016 at 11:47:01 AM UTC-4, Richard wrote:
>
> This seems uncompleted field model definition, no type, no reference
>
> auth.settings.extra_fields['auth_user']= [
>   Field('company'),
>   ]
>
> I would define company referenced table before the auth_user extra field 
> definition...
>
> For the other 2 errors, I think controller defaut about ~200+ lines would 
> be informative of what going on...
>
> Richard
>
> On Thu, Jun 16, 2016 at 11:31 AM, Marty Jones <murtin...@gmail.com 
> > wrote:
>
>> See version info below:
>>
>> 2.14.5-stable+timestamp.2016.04.13.22.22.13
>> (Running on Unknown, Python 2.7.6)
>>
>>
>>
>> On Thursday, June 16, 2016 at 9:59:58 AM UTC-4, Richard wrote:
>>>
>>> How did you upgrade ? Which version of web2py (2.14.6)?
>>>
>>> Richard
>>>
>>> On Thu, Jun 16, 2016 at 9:36 AM, Marty Jones <murtin...@gmail.com> 
>>> wrote:
>>>
>>>> I uploaded a local application to my DigitalOcean droplet and have been 
>>>> having a nightmare of a time with the databases. I get this variety of 
>>>> errors on various pages:
>>>>
>>>> *Error 1:*
>>>>
>>>> Traceback (most recent call last):
>>>>   File "/home/murtyjones/app/gluon/restricted.py", line 227, in restricted
>>>> exec ccode in environment
>>>>   File 
>>>> "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
>>>> <https://nolabills.com/admin/default/edit/nolabills/controllers/default.py>,
>>>>  line 230, in 
>>>>   File "/home/murtyjones/app/gluon/globals.py", line 417, in 
>>>> self._caller = lambda f: f()
>>>>   File "/home/murtyjones/app/gluon/tools.py", line 4241, in f
>>>> return action(*a, **b)
>>>>   File 
>>>> "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
>>>> <https://nolabills.com/admin/default/edit/nolabills/controllers/default.py>,
>>>>  line 73, in dashboard
>>>> data_requests = 
>>>> SQLFORM.grid(db(db.data_requests.company==auth.user.company),
>>>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/objects.py", line 
>>>> 91, in __getattr__
>>>> raise AttributeError
>>>> AttributeError
>>>>
>>>>
>>>> *Error 2 (trying to apply changes as a user to own profile):*
>>>>
>>>> Traceback (most recent call last):
>>>>   File "/home/murtyjones/app/gluon/restricted.py", line 227, in restricted
>>>> exec ccode in environment
>>>>   File 
>>>> "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
>>>> <https://nolabills.com/admin/default/edit/nolabills/controllers/default.py>,
>>>>  line 230, in 
>>>>   File "/home/murtyjones/app/gluon/globals.py", line 417, in 
>>>> self._caller = lambda f: f()
>>>>   File 
>>>> "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
>>>> <https://nolabills.com/admin/default/edit/nolabills/controllers/default.py>,
>>>>  line 211, in user
>>>> return dict(form=auth())
>>>>   File "/home/murtyjones/app/gluon/tools.py", line 1941, in __call__
>>>> return getattr(self, args[0])()
>>>>   File "/home/murtyjones/app/gluon/tools.py", line 4026, in profile
>>>> hideerror=self.settings.hideerror):
>>>>   File "/home/murtyjones/app/gluon/sqlhtml.py", line 1744, in accepts
>>>> self.id_field_name]).update(**fields)
>>>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/objects.py", line 
>>>> 2041, in update
>>>> ret = db._adapter.update("%s" % table._tablename, self.query, fields)
>>>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/adapters/base.py", 
>>>> line 519, in update
>>>> raise e
>>>> OperationalError: attempt to write a readonly database
>>>>
>>>>
>>>> *Error 3 (trying to logout as a user):*
>>>>
>>>> Traceback (most recent call last):

Re: [web2py] A bunch of strange database errors

2016-06-16 Thread Marty Jones
See version info below:

2.14.5-stable+timestamp.2016.04.13.22.22.13
(Running on Unknown, Python 2.7.6)



On Thursday, June 16, 2016 at 9:59:58 AM UTC-4, Richard wrote:
>
> How did you upgrade ? Which version of web2py (2.14.6)?
>
> Richard
>
> On Thu, Jun 16, 2016 at 9:36 AM, Marty Jones <murtin...@gmail.com 
> > wrote:
>
>> I uploaded a local application to my DigitalOcean droplet and have been 
>> having a nightmare of a time with the databases. I get this variety of 
>> errors on various pages:
>>
>> *Error 1:*
>>
>> Traceback (most recent call last):
>>   File "/home/murtyjones/app/gluon/restricted.py", line 227, in restricted
>> exec ccode in environment
>>   File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
>> <https://nolabills.com/admin/default/edit/nolabills/controllers/default.py>, 
>> line 230, in 
>>   File "/home/murtyjones/app/gluon/globals.py", line 417, in 
>> self._caller = lambda f: f()
>>   File "/home/murtyjones/app/gluon/tools.py", line 4241, in f
>> return action(*a, **b)
>>   File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
>> <https://nolabills.com/admin/default/edit/nolabills/controllers/default.py>, 
>> line 73, in dashboard
>> data_requests = 
>> SQLFORM.grid(db(db.data_requests.company==auth.user.company),
>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/objects.py", line 91, 
>> in __getattr__
>> raise AttributeError
>> AttributeError
>>
>>
>> *Error 2 (trying to apply changes as a user to own profile):*
>>
>> Traceback (most recent call last):
>>   File "/home/murtyjones/app/gluon/restricted.py", line 227, in restricted
>> exec ccode in environment
>>   File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
>> <https://nolabills.com/admin/default/edit/nolabills/controllers/default.py>, 
>> line 230, in 
>>   File "/home/murtyjones/app/gluon/globals.py", line 417, in 
>> self._caller = lambda f: f()
>>   File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
>> <https://nolabills.com/admin/default/edit/nolabills/controllers/default.py>, 
>> line 211, in user
>> return dict(form=auth())
>>   File "/home/murtyjones/app/gluon/tools.py", line 1941, in __call__
>> return getattr(self, args[0])()
>>   File "/home/murtyjones/app/gluon/tools.py", line 4026, in profile
>> hideerror=self.settings.hideerror):
>>   File "/home/murtyjones/app/gluon/sqlhtml.py", line 1744, in accepts
>> self.id_field_name]).update(**fields)
>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/objects.py", line 
>> 2041, in update
>> ret = db._adapter.update("%s" % table._tablename, self.query, fields)
>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/adapters/base.py", 
>> line 519, in update
>> raise e
>> OperationalError: attempt to write a readonly database
>>
>>
>> *Error 3 (trying to logout as a user):*
>>
>> Traceback (most recent call last):
>>   File "/home/murtyjones/app/gluon/restricted.py", line 227, in restricted
>> exec ccode in environment
>>   File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
>> <https://nolabills.com/admin/default/edit/nolabills/controllers/default.py>, 
>> line 230, in 
>>   File "/home/murtyjones/app/gluon/globals.py", line 417, in 
>> self._caller = lambda f: f()
>>   File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
>> <https://nolabills.com/admin/default/edit/nolabills/controllers/default.py>, 
>> line 211, in user
>> return dict(form=auth())
>>   File "/home/murtyjones/app/gluon/tools.py", line 1941, in __call__
>> return getattr(self, args[0])()
>>   File "/home/murtyjones/app/gluon/tools.py", line 3235, in logout
>> self.log_event(log, self.user)
>>   File "/home/murtyjones/app/gluon/tools.py", line 2530, in log_event
>> self.table_event().insert(description=str(description % vars), 
>> origin=origin, user_id=user_id)
>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/objects.py", line 740, 
>> in insert
>> ret = self._db._adapter.insert(self, self._listify(fields))
>>   File "/home/murtyjones/app/gluon/packages/dal/pydal/adapters/base

[web2py] A bunch of strange database errors

2016-06-16 Thread Marty Jones
I uploaded a local application to my DigitalOcean droplet and have been 
having a nightmare of a time with the databases. I get this variety of 
errors on various pages:

*Error 1:*

Traceback (most recent call last):
  File "/home/murtyjones/app/gluon/restricted.py", line 227, in restricted
exec ccode in environment
  File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
, 
line 230, in 
  File "/home/murtyjones/app/gluon/globals.py", line 417, in 
self._caller = lambda f: f()
  File "/home/murtyjones/app/gluon/tools.py", line 4241, in f
return action(*a, **b)
  File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
, 
line 73, in dashboard
data_requests = 
SQLFORM.grid(db(db.data_requests.company==auth.user.company),
  File "/home/murtyjones/app/gluon/packages/dal/pydal/objects.py", line 91, in 
__getattr__
raise AttributeError
AttributeError


*Error 2 (trying to apply changes as a user to own profile):*

Traceback (most recent call last):
  File "/home/murtyjones/app/gluon/restricted.py", line 227, in restricted
exec ccode in environment
  File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
, 
line 230, in 
  File "/home/murtyjones/app/gluon/globals.py", line 417, in 
self._caller = lambda f: f()
  File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
, 
line 211, in user
return dict(form=auth())
  File "/home/murtyjones/app/gluon/tools.py", line 1941, in __call__
return getattr(self, args[0])()
  File "/home/murtyjones/app/gluon/tools.py", line 4026, in profile
hideerror=self.settings.hideerror):
  File "/home/murtyjones/app/gluon/sqlhtml.py", line 1744, in accepts
self.id_field_name]).update(**fields)
  File "/home/murtyjones/app/gluon/packages/dal/pydal/objects.py", line 2041, 
in update
ret = db._adapter.update("%s" % table._tablename, self.query, fields)
  File "/home/murtyjones/app/gluon/packages/dal/pydal/adapters/base.py", line 
519, in update
raise e
OperationalError: attempt to write a readonly database


*Error 3 (trying to logout as a user):*

Traceback (most recent call last):
  File "/home/murtyjones/app/gluon/restricted.py", line 227, in restricted
exec ccode in environment
  File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
, 
line 230, in 
  File "/home/murtyjones/app/gluon/globals.py", line 417, in 
self._caller = lambda f: f()
  File "/home/murtyjones/app/applications/nolabills/controllers/default.py" 
, 
line 211, in user
return dict(form=auth())
  File "/home/murtyjones/app/gluon/tools.py", line 1941, in __call__
return getattr(self, args[0])()
  File "/home/murtyjones/app/gluon/tools.py", line 3235, in logout
self.log_event(log, self.user)
  File "/home/murtyjones/app/gluon/tools.py", line 2530, in log_event
self.table_event().insert(description=str(description % vars), 
origin=origin, user_id=user_id)
  File "/home/murtyjones/app/gluon/packages/dal/pydal/objects.py", line 740, in 
insert
ret = self._db._adapter.insert(self, self._listify(fields))
  File "/home/murtyjones/app/gluon/packages/dal/pydal/adapters/base.py", line 
482, in insert
raise e
IntegrityError: FOREIGN KEY constraint failed


*db.py*
## app configuration made easy. Look inside private/appconfig.ini
from gluon.contrib.appconfig import AppConfig
## import current for current.db = db line
from gluon import current

## once in production, remove reload=True to gain full speed
myconf = AppConfig(reload=True)

## if NOT running on Google App Engine use SQLite or other DB
db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', 
cast=int), migrate_enabled = myconf.get('db.migrate'), 
check_reserved=['all'])

## define current.db for module usage
current.db = db

## by default give a view/generic.extension to all actions from localhost
## none otherwise. a pattern can be 'controller/function.extension'
response.generic_patterns = ['*'] if request.is_local else []
## choose a style for forms
response.formstyle = myconf.take('forms.formstyle')  # or 
'bootstrap3_stacked' or 'bootstrap2' or other
response.form_label_separator = myconf.take('forms.separator')

from gluon.tools import Auth, Service, PluginManager

auth = Auth(db)
service = Service()
plugins = PluginManager()

auth.settings.extra_fields['auth_user']= [
  Field('company'),
  ]

## create all tables needed by auth if not custom tables
auth.define_tables(username=False, signature=False, 

[web2py] Are my permissions okay?

2016-06-16 Thread Marty Jones
I have ownership of my web2py folder set to www-data group and for 
permissions I've used "sudo chmod 777 - R "~/path/to/web2py". Is this 
correct? Seems to be the only way to write to databases, etc.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: OperationalError: no such column

2016-06-13 Thread Marty Jones
Resolved it - the line that was triggering the error:

company = db.auth_user.company)

should have been:

company = auth.user.company)

:P

On Monday, June 13, 2016 at 9:03:39 PM UTC-4, Dave S wrote:
>
>
>
> On Monday, June 13, 2016 at 5:49:35 PM UTC-7, Marty Jones wrote:
>>
>> OK - I reverted to auth.settings.extra_fields and expanded the code shown 
>> below. The same error is persisting.
>>
>
>
> What do the entries in yourapp/databases/sql.log say about the table 
> schema?
>
> /dps
>  
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: OperationalError: no such column

2016-06-13 Thread Marty Jones
OK - I reverted to auth.settings.extra_fields and expanded the code shown 
below. The same error is persisting.

db.py
# -*- coding: utf-8 -*-

#
## This scaffolding model makes your app work on Google App Engine too
## File is released under public domain and you can use without limitations
#

## if SSL/HTTPS is properly configured and you want all HTTP requests to
## be redirected to HTTPS, uncomment the line below:
# request.requires_https()

## app configuration made easy. Look inside private/appconfig.ini
from gluon.contrib.appconfig import AppConfig
## import current for current.db = db line
from gluon import current

## once in production, remove reload=True to gain full speed
myconf = AppConfig(reload=True)

if not request.env.web2py_runtime_gae:
## if NOT running on Google App Engine use SQLite or other DB
db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', 
cast=int), check_reserved=['all'], migrate=True)
else:
## connect to Google BigTable (optional 'google:datastore://namespace')
db = DAL('google:datastore+ndb')
## store sessions and tickets there
session.connect(request, response, db=db)
## or store session in Memcache, Redis, etc.
## from gluon.contrib.memdb import MEMDB
## from google.appengine.api.memcache import Client
## session.connect(request, response, db = MEMDB(Client()))


## define current.db for module usage
current.db = db

## by default give a view/generic.extension to all actions from localhost
## none otherwise. a pattern can be 'controller/function.extension'
response.generic_patterns = ['*'] if request.is_local else []
## choose a style for forms
response.formstyle = myconf.take('forms.formstyle')  # or 
'bootstrap3_stacked' or 'bootstrap2' or other
response.form_label_separator = myconf.take('forms.separator')

from gluon.tools import Auth, Service, PluginManager

auth = Auth(db)
service = Service()
plugins = PluginManager()

auth.settings.extra_fields['auth_user']= [
  Field('company'),
  ]
  

## create all tables needed by auth if not custom tables
auth.define_tables(username=False, signature=False)

## configure email
mail = auth.settings.mailer
mail.settings.server = 'logging' if request.is_local else 'smtp.gmail.com'
mail.settings.sender = 'em...@gmail.com'
mail.settings.login = 'em...@gmail.com:password'

## configure auth policy
auth.settings.registration_requires_verification = True
auth.settings.registration_requires_approval = True
auth.settings.reset_password_requires_verification = True


On Monday, June 13, 2016 at 7:53:45 PM UTC-4, Dave S wrote:
>
>
>
> On Monday, June 13, 2016 at 1:57:38 PM UTC-7, Marty Jones wrote:
>>
>> Hi -
>>
>> I created a custom auth_user table with a new field ('company') and am 
>> having trouble accessing it in my controller:
>>
>
>
> The book recommends using auth.settings.extra_fields
>  http://web2py.com/books/default/chapter/29/09/access-control#Customizing-Auth
> >
> unless you really have to define a custom table.
>
> In either case, the customization goes somewhere between the "auth = 
> Auth(db)" and "auth.define_tables()".
>
> You may need to show us more code.
>
> /dps
>
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] OperationalError: no such column

2016-06-13 Thread Marty Jones
Hi -

I created a custom auth_user table with a new field ('company') and am 
having trouble accessing it in my controller:

db.py

db.define_table(
auth.settings.table_user_name,
Field('first_name', length=128, default=''),
Field('last_name', length=128, default=''),
Field('email', length=128, default='', unique=True, 
label='Company Email'),
Field('password', 'password', length=512, readable=False),
Field('company', length=128, label='Company Name'),
Field('registration_key', length=512, default='', 
writable=False, readable=False),
Field('reset_password_key', length=512, default='', 
writable=False, readable=False),
Field('first_name', length=128, default=''),
Field('registration_id', length=512, writable=False, 
readable=False, default=''), format='%(first_name)s %(last_name)s',
)


default.py
db.tokens.insert(token = token,
 first_name = request.post_vars.first,
 last_name = request.post_vars.last,
 email = request.post_vars.email,
 company = db.auth_user.company)

Produces an error:

Traceback (most recent call last):
  File "/media/sf_VBoxWeb2py/web2py/gluon/restricted.py", line 227, in 
restricted
exec ccode in environment
  File 
"/media/sf_VBoxWeb2py/web2py/applications/nolabills/controllers/default.py" 
,
 line 239, in 
  File "/media/sf_VBoxWeb2py/web2py/gluon/globals.py", line 417, in 
self._caller = lambda f: f()
  File "/media/sf_VBoxWeb2py/web2py/gluon/tools.py", line 4250, in f
return action(*a, **b)
  File 
"/media/sf_VBoxWeb2py/web2py/applications/nolabills/controllers/default.py" 
,
 line 119, in dashboard
company = db.auth_user.company)
  File "/media/sf_VBoxWeb2py/web2py/gluon/packages/dal/pydal/objects.py", line 
726, in insert
ret = self._db._adapter.insert(self, self._listify(fields))
  File "/media/sf_VBoxWeb2py/web2py/gluon/packages/dal/pydal/adapters/base.py", 
line 746, in insert
raise e
OperationalError: no such column: auth_user.company


I'm new to web2py and struggling to understand how to remedy it. I gather 
it's something to do with migrations, but simply setting migrate = True in 
define_table is not solving the issue.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Installing custom modules on a Web2py-friendly VPS (e.g. DigitalOcean, Linode)?

2016-05-08 Thread Marty Jones
Thanks. I went with DigitalOcean and am having the experience you've 
described.

On Saturday, May 7, 2016 at 12:59:47 PM UTC-4, Kenneth wrote:
>
> You can treat DigitalOcean or Linode as complete linux server to play 
> around with.
>
> You can install any Python modules with PIP install module_name.
>
> On Saturday, May 7, 2016 at 11:50:12 AM UTC-4, Marty Jones wrote:
>>
>> I know this isn't a Web2py specific question but hope some of you will 
>> have had experience with this.
>>
>> I have a Web2py app that relies on a number of 3rd party Python modules 
>> (Selenium, BeautifulSoup, PyVirtualDisplay, and various dependencies). 
>> Before I pay for a VPS, I want to be sure I understand how easy or hard it 
>> is to install these packages. With DigitalOcean, Linode, and the other more 
>> popular options out there, is it pretty easy to install custom packages?
>>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Installing custom modules on a Web2py-friendly VPS (e.g. DigitalOcean, Linode)?

2016-05-07 Thread Marty Jones
I know this isn't a Web2py specific question but hope some of you will have 
had experience with this.

I have a Web2py app that relies on a number of 3rd party Python modules 
(Selenium, BeautifulSoup, PyVirtualDisplay, and various dependencies). 
Before I pay for a VPS, I want to be sure I understand how easy or hard it 
is to install these packages. With DigitalOcean, Linode, and the other more 
popular options out there, is it pretty easy to install custom packages?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Can't access scheduler_task table ['DAL' object has no attribute 'scheduler_task']

2016-05-01 Thread Marty Jones
how would I import the scheduler into a module to do that?

On Sunday, May 1, 2016 at 12:00:44 PM UTC-4, Niphlod wrote:
>
> why don't you use queue_task() ?
>
> On Friday, April 29, 2016 at 9:17:37 PM UTC+2, Marty Jones wrote:
>>
>> I seem to have resolved it by switching "db = current.db" to "db = 
>> current.globalenv['db']"
>>
>> On Friday, April 29, 2016 at 12:05:34 PM UTC-4, Marty Jones wrote:
>>>
>>> I'm defining some functions in the modules folder that need to access 
>>> and insert rows into the db. in the controller, I define "current.db = db" 
>>> then in the module I import the db as seen below.
>>>
>>> I define the function below and attempt to import it and queue it up 
>>> using Scheduler, but receive "'DAL' object has no attribute 
>>> 'scheduler_task'". What am I missing?
>>>
>>> #!/usr/bin/env python
>>> # -*- coding: utf-8 -*-
>>> from gluon import *
>>> from gluon import current
>>>
>>> def insert_task():
>>> db = current.db
>>> db.scheduler_task.insert(status = 'QUEUED',
>>>  application_name = 'my_application/default',
>>>  task_name = 'download',
>>>  group_name = 'scrape',
>>>  function_name = 'download',
>>>  args = '[]',
>>>  vars = '{}',
>>>  enabled = True,
>>>  start_time = request.now,
>>>  timeout = 500,
>>>  )
>>>
>>>
>>>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Can't access scheduler_task table ['DAL' object has no attribute 'scheduler_task']

2016-04-29 Thread Marty Jones
I seem to have resolved it by switching "db = current.db" to "db = 
current.globalenv['db']"

On Friday, April 29, 2016 at 12:05:34 PM UTC-4, Marty Jones wrote:
>
> I'm defining some functions in the modules folder that need to access and 
> insert rows into the db. in the controller, I define "current.db = db" then 
> in the module I import the db as seen below.
>
> I define the function below and attempt to import it and queue it up using 
> Scheduler, but receive "'DAL' object has no attribute 'scheduler_task'". 
> What am I missing?
>
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
> from gluon import *
> from gluon import current
>
> def insert_task():
> db = current.db
> db.scheduler_task.insert(status = 'QUEUED',
>  application_name = 'my_application/default',
>  task_name = 'download',
>  group_name = 'scrape',
>  function_name = 'download',
>  args = '[]',
>  vars = '{}',
>  enabled = True,
>  start_time = request.now,
>  timeout = 500,
>  )
>
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Can't access scheduler_task table ['DAL' object has no attribute 'scheduler_task']

2016-04-29 Thread Marty Jones
I'm defining some functions in the modules folder that need to access and 
insert rows into the db. in the controller, I define "current.db = db" then 
in the module I import the db as seen below.

I define the function below and attempt to import it and queue it up using 
Scheduler, but receive "'DAL' object has no attribute 'scheduler_task'". 
What am I missing?

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gluon import *
from gluon import current

def insert_task():
db = current.db
db.scheduler_task.insert(status = 'QUEUED',
 application_name = 'my_application/default',
 task_name = 'download',
 group_name = 'scrape',
 function_name = 'download',
 args = '[]',
 vars = '{}',
 enabled = True,
 start_time = request.now,
 timeout = 500,
 )


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Deploying with a lot of modules

2016-03-07 Thread Marty Jones
I'm working on developing a web2py application that uses a scraper. In 
order to accomplish what I need I'm using a lot of modules... Selenium, 
BeautifulSoup, possibly AutoIT, and all the dependencies of those modules...

How do I begin to think about including those during deployment? I'm 
admittedly a noob so I want to make sure I'm not using tools that can't be 
deployed in a production environment.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] [Scheduler] Scraping javascript pages

2016-03-01 Thread Marty Jones
I'm working to create a web2py app that can scrape pages containing a 
decent amount of javascript data, as a background process. I'm unsure what 
module is best to use. I was considering Dryscrape but it seems to have a 
lot of dependencies that wouldn't translate to deployment well (eg Qt).

Can anyone recommend modules that will work well in deployment?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Sending email through gmail account: no SSL support

2016-03-01 Thread Marty Jones
That works fine as well.

On Tuesday, March 1, 2016 at 3:32:43 AM UTC-6, Niphlod wrote:
>
> what if you just
>
> import ssl 
>
> ?
>
> which environment are you in (os details) ?
>
> On Tuesday, March 1, 2016 at 12:36:16 AM UTC+1, Marty Jones wrote:
>>
>> I can't recall at this point, but just ran:
>>
>> >>> import socket
>> >>> hasattr(socket, "ssl")
>>
>> which returned True
>>
>> On Monday, February 29, 2016 at 4:15:53 PM UTC-6, Niphlod wrote:
>>>
>>> with or without ssl support ? did you compile it yourself ?
>>>
>>> On Monday, February 29, 2016 at 10:57:58 PM UTC+1, Marty Jones wrote:
>>>>
>>>> 2.7.11
>>>>
>>>> On Monday, February 29, 2016 at 2:20:00 PM UTC-6, Niphlod wrote:
>>>>>
>>>>> what python are you using ?
>>>>>
>>>>> On Monday, February 29, 2016 at 4:39:45 PM UTC+1, Marty Jones wrote:
>>>>>>
>>>>>> I'm trying to send an email using web2py's auth mailer. I've set an 
>>>>>> application specific password and am using that and my gmail info in the 
>>>>>> code below:
>>>>>> mail = auth.settings.mailer
>>>>>> mail.settings.server = 'smtp.gmail.com:587'
>>>>>> mail.settings.sender = 'em...@gmail.com'
>>>>>> mail.settings.login = 'em...@gmail.com:password'
>>>>>>
>>>>>>
>>>>>> I'm getting an error back when trying to send an email:
>>>>>> 2016-02-29 09:33:42,082 - web2py - WARNING - Mail.send failure:No 
>>>>>> SSL support included in this Python
>>>>>>
>>>>>> Anyone experienced this and know how to work around it?
>>>>>>
>>>>>> Using port 465 instead results in this error:
>>>>>> 2016-02-29 09:32:17,565 - web2py - WARNING - Mail.send failure:
>>>>>> Connection unexpectedly closed: timed out
>>>>>>
>>>>>>
>>>>>>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Sending email through gmail account: no SSL support

2016-02-29 Thread Marty Jones
I can't recall at this point, but just ran:

>>> import socket
>>> hasattr(socket, "ssl")

which returned True

On Monday, February 29, 2016 at 4:15:53 PM UTC-6, Niphlod wrote:
>
> with or without ssl support ? did you compile it yourself ?
>
> On Monday, February 29, 2016 at 10:57:58 PM UTC+1, Marty Jones wrote:
>>
>> 2.7.11
>>
>> On Monday, February 29, 2016 at 2:20:00 PM UTC-6, Niphlod wrote:
>>>
>>> what python are you using ?
>>>
>>> On Monday, February 29, 2016 at 4:39:45 PM UTC+1, Marty Jones wrote:
>>>>
>>>> I'm trying to send an email using web2py's auth mailer. I've set an 
>>>> application specific password and am using that and my gmail info in the 
>>>> code below:
>>>> mail = auth.settings.mailer
>>>> mail.settings.server = 'smtp.gmail.com:587'
>>>> mail.settings.sender = 'em...@gmail.com'
>>>> mail.settings.login = 'em...@gmail.com:password'
>>>>
>>>>
>>>> I'm getting an error back when trying to send an email:
>>>> 2016-02-29 09:33:42,082 - web2py - WARNING - Mail.send failure:No SSL 
>>>> support included in this Python
>>>>
>>>> Anyone experienced this and know how to work around it?
>>>>
>>>> Using port 465 instead results in this error:
>>>> 2016-02-29 09:32:17,565 - web2py - WARNING - Mail.send failure:
>>>> Connection unexpectedly closed: timed out
>>>>
>>>>
>>>>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Sending email through gmail account: no SSL support

2016-02-29 Thread Marty Jones
2.7.11

On Monday, February 29, 2016 at 2:20:00 PM UTC-6, Niphlod wrote:
>
> what python are you using ?
>
> On Monday, February 29, 2016 at 4:39:45 PM UTC+1, Marty Jones wrote:
>>
>> I'm trying to send an email using web2py's auth mailer. I've set an 
>> application specific password and am using that and my gmail info in the 
>> code below:
>> mail = auth.settings.mailer
>> mail.settings.server = 'smtp.gmail.com:587'
>> mail.settings.sender = 'em...@gmail.com'
>> mail.settings.login = 'em...@gmail.com:password'
>>
>>
>> I'm getting an error back when trying to send an email:
>> 2016-02-29 09:33:42,082 - web2py - WARNING - Mail.send failure:No SSL 
>> support included in this Python
>>
>> Anyone experienced this and know how to work around it?
>>
>> Using port 465 instead results in this error:
>> 2016-02-29 09:32:17,565 - web2py - WARNING - Mail.send failure:Connection 
>> unexpectedly closed: timed out
>>
>>
>>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Sending email through gmail account: no SSL support

2016-02-29 Thread Marty Jones
I'm trying to send an email using web2py's auth mailer. I've set an 
application specific password and am using that and my gmail info in the 
code below:
mail = auth.settings.mailer
mail.settings.server = 'smtp.gmail.com:587'
mail.settings.sender = 'em...@gmail.com'
mail.settings.login = 'em...@gmail.com:password'


I'm getting an error back when trying to send an email:
2016-02-29 09:33:42,082 - web2py - WARNING - Mail.send failure:No SSL 
support included in this Python

Anyone experienced this and know how to work around it?

Using port 465 instead results in this error:
2016-02-29 09:32:17,565 - web2py - WARNING - Mail.send failure:Connection 
unexpectedly closed: timed out


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Basic syntax question

2016-02-26 Thread Marty Jones
Thank you. That works, although using "for" rather than "foreach".

On Friday, February 26, 2016 at 1:35:10 PM UTC-6, Niphlod wrote:
>
> the correct syntax would be
>
> {{foreach element in elements:}}
> {{=each}}
> {{pass}}
>
>
> please read the book (especially the part about views (
> http://web2py.com/books/default/chapter/29/05/the-views))
>
> On Friday, February 26, 2016 at 7:49:07 PM UTC+1, Marty Jones wrote:
>>
>> I'm just getting started with web2py and I'm struggling to figure out how 
>> to call variables passed from the controller to the view, without using the 
>> {{=variable}} method.
>>
>> For example, I have the following code in my controller:
>>
>> def manage():
>> list = []
>> for row in db(db.auth_user.registration_key[0]=='p').select():
>> if row.company=='Chosen company':
>> list.append({row.last_name:{"first":row.first_name}})
>> return dict(list=list)
>>
>> And the following code in my view:
>>
>> {{for each in =list}}
>> {{print each}}
>> {{pass}}
>>
>> Which generates an error... How do I call the list variable without using 
>> the = syntax?
>>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Basic syntax question

2016-02-26 Thread Marty Jones
I'm just getting started with web2py and I'm struggling to figure out how 
to call variables passed from the controller to the view, without using the 
{{=variable}} method.

For example, I have the following code in my controller:

def manage():
list = []
for row in db(db.auth_user.registration_key[0]=='p').select():
if row.company=='Chosen company':
list.append({row.last_name:{"first":row.first_name}})
return dict(list=list)

And the following code in my view:

{{for each in =list}}
{{print each}}
{{pass}}

Which generates an error... How do I call the list variable without using 
the = syntax?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Want to build a web scraper that runs as web2py app. Where to start?

2016-02-26 Thread Marty Jones
I have some familiarity with scraping but only from my local machine, not 
from a server. I'd like to set up a basic scraping app as a web2py app that 
I can eventually run on a server. Anybody seen any tutorials for anything 
along these lines or know of a good module for doing this?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.