peewee.ImproperlyConfigured: database attribute does not appear to be set on the model: <Model: Model>

1,353 views
Skip to first unread message

Leonardo Perrella

unread,
Feb 11, 2020, 6:43:54 AM2/11/20
to peewee-orm
Hello,

I'm having trouble trying to initialize the database with postgres.

Traceback (most recent call last):
 
File "init_db.py", line 4, in <module>
    db
.evolve()
 
File "/home/leonardo/zippy-gigs-api/.venv/lib/python3.6/site-packages/peeweedbevolve.py", line 721, in evolve
    to_run
= calc_changes(db, ignore_tables=ignore_tables)
 
File "/home/leonardo/zippy-gigs-api/.venv/lib/python3.6/site-packages/peeweedbevolve.py", line 628, in calc_changes
    to_run
+= create_table(table_names_to_models[tbl])
 
File "/home/leonardo/zippy-gigs-api/.venv/lib/python3.6/site-packages/peeweedbevolve.py", line 68, in create_table
    ctx
= manager._create_table()
 
File "/home/leonardo/zippy-gigs-api/.venv/lib/python3.6/site-packages/peewee.py", line 5481, in _create_table
    ctx
= self._create_context()
 
File "/home/leonardo/zippy-gigs-api/.venv/lib/python3.6/site-packages/peewee.py", line 5477, in _create_context
   
return self.database.get_sql_context(**self.context_options)
 
File "/home/leonardo/zippy-gigs-api/.venv/lib/python3.6/site-packages/peewee.py", line 5469, in database
   
'be set on the model: %s' % self.model)
peewee
.ImproperlyConfigured: database attribute does not appear to be set on the model: <Model: Model>

I still not get witch attribute it is.


Has everyone already been through it?

Thanks.


Charles Leifer

unread,
Feb 11, 2020, 8:34:28 AM2/11/20
to peewe...@googlegroups.com
Im not familiar with db evolve. It's not part of peewee and may be buggy

--
You received this message because you are subscribed to the Google Groups "peewee-orm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to peewee-orm+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/peewee-orm/3df1b5f8-9972-4906-a81b-5c78c5055883%40googlegroups.com.

Leonardo Perrella

unread,
Feb 12, 2020, 8:54:24 AM2/12/20
to peewee-orm
I found the solution on git : https://github.com/keredson/peewee-db-evolve/issues/40. Thanks man
Reply all
Reply to author
Forward
0 new messages