I have done some debugging on this by creating a brand new app and trying
to use the same db.py file as my app that's not working. When doing so I
removed some pieces of code I thought might be causing the problem and it
looks like I've narrowed it down.
In the app that I have running in the old version of web2py, I have the
following code:
from gluon.tools import Auth
response.generic_patterns = ['*']
response.headers['Access-Control-Allow-Origin'] = '*'
auth = Auth(globals(), db)
auth.define_tables(username=True, fake_migrate=False, migrate=True)
auth.settings.allow_basic_login = True
auth.settings.create_user_groups = False
auth.settings.actions_disabled.extend(['change_password',
'request_reset_password', 'retrieve_username', 'register'])
db.define_table('auth_app',
Field('name','string',length=50,unique=True,notnull=True),
Field('description','string',length=255),
migrate='auth_app.table')
db.define_table('auth_app_group',
Field('app_id','integer',db.auth_app,notnull=True),
Field('group_id', 'integer',db.auth_group,notnull=True),
migrate='auth_app_group.table')
I have these tables defined AFTER I have auth create it's tables because I
want to use the reference to the default auth table auth_group.
While reading the documentation, I see that you can define your own tables
before you tell auth to define it's tables and it'll use those instead, but
I would rather not define my own as the one auth creates is fine, I just
need a couple of additional tables for my app. I know I can accomplish this
my defining my own auth_group table so I can use it as a foreign key in my
auth_app_group table and then do the auth.define_tables() call, however it
would be nice if I didn't have to. It's not a big deal, but any reason why
in the old version of web2py I could get away with this and now I can't?
Thanks,
M
On Friday, February 6, 2015 at 11:11:45 AM UTC-8, Maggs wrote:
>
> Hi Dave,
>
> The Web2py and python versions:
> web2py™ Version 2.9.11-stable+timestamp.2014.09.15.23.35.11
> Python Python 2.7.6: /usr/bin/python2.7 (prefix: /usr)
>
> The OS is Ubuntu 14.04.
> Web2py is a fresh install. No upgrades.
> Source installation.
>
> For some additional information, when I said this is running in
> production, it is running on a Ubuntu 10.04 instance with web2py version
> is Version 1.99.7 (2012-03-04 22:12:08) stable. So it might have something
> to do with the different version of web2py or the different version of
> Ubuntu. But this particular error doesn't make it obvious which one it is.
>
> Thanks,
> M
>
> On Thursday, February 5, 2015 at 8:33:27 PM UTC-8, Dave S wrote:
>>
>>
>>
>> On Thursday, February 5, 2015 at 5:57:59 PM UTC-8, Maggs wrote:
>>>
>>> I am having this issue right now and it's when trying to set my app up
>>> in a new dev environment. I'm not using apache or wsdi. Just web2py.
>>>
>>
>> Just to beat Massimo to the initial questions:
>>
>> - What version of web2py?
>> - What OS?
>> - Fresh install or update over previous version? (I know, you said "new
>> dev environment", but let's be explicit)
>> - source or binary install?
>>
>> /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 [email protected].
For more options, visit https://groups.google.com/d/optout.