So to use psycopg2 I just need to install postgres and use adaptor like:
db = DAL('postgres://storage', pool_size=1, check_reserved=['all'],
migrate=False)
If I create a db with the user and db name with "storage" would it work
like this?
Please advise because this is the first time I will be doing this.
Regards,
Shazia
On Fri, Aug 11, 2017 at 3:44 PM, Richard Vézina <[email protected]
> wrote:
> Use : psycopg2
>
> pg8000 has known issues...
>
> Richard
>
> On Fri, Aug 11, 2017 at 10:42 AM, <[email protected]> wrote:
>
>> Hi,
>>
>> I am new user to web2py and I copied repo from an existing project from
>> AWS. With following settings I need to make it work on local server so I
>> can make few changes but I am stuck at database error. Please guide me as I
>> have little knowledge about how to drop tables and make it work.
>>
>> if not request.env.web2py_runtime_gae:
>> # ---------------------------------------------------------------------
>> # if NOT running on Google App Engine use SQLite or other DB
>> # ---------------------------------------------------------------------
>> db = DAL(myconf.get('db.'+myconf.get('db.mode')+'_uri'),
>> pool_size=myconf.get('db.pool_size'),
>> migrate=myconf.get('db.migrate'),
>> migrate_enabled=myconf.get('db.migrate_enabled'),
>> fake_migrate_all=myconf.get('db.fake_migrate_all'),
>> check_reserved=['all'])
>> else:
>>
>> #db = DAL('google:datastore+ndb')
>> db = DAL('sqlite://storage.sqlite', pool_size=1, check_reserved=['all'],
>> migrate=False)
>> session.connect(request, response, db=db)
>>
>>
>> Error I get from these settings on local server is:
>>
>> <class 'gluon.contrib.pg8000.ProgrammingError'>(('ERROR', '42P07',
>> 'relation "auth_user" already exists'))
>>
>> Please advise.
>>
>> --
>> 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.
>>
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/OnLHyq52mBk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
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.