I run this line

trytond-admin -c ./trytond.conf -d tryton --all

Then I try to start Proteus like this

config = config.set_trytond(database='postgresql://tryton@/')

because I'd like to prod my methods with the same database tha I use when I' m 
in the client

But this is what I get

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-8-c8456c787960> in <module>()
----> 1 config = config.set_trytond(database='postgresql://tryton@/')

~/tributi/env/lib/python3.6/site-packages/proteus/config.py in 
set_trytond(database, user, config_file)
    272         config_file=None):
    273     'Set trytond package as backend'
--> 274     _CONFIG.current = TrytondConfig(database, user, 
config_file=config_file)
    275     return _CONFIG.current
    276 

~/tributi/env/lib/python3.6/site-packages/proteus/config.py in __init__(self, 
database, user, config_file)
    219             database_name = uri.path.strip('/')
    220         if not database_name:
--> 221             database_name = os.environ['DB_NAME']
    222         self.database_name = database_name
    223         self._user = user

~/tributi/env/lib64/python3.6/os.py in __getitem__(self, key)
    667         except KeyError:
    668             # raise KeyError with the original key value
--> 669             raise KeyError(key) from None
    670         return self.decodevalue(value)
    671 

KeyError: 'DB_NAME'


I thought I passed the db URI as an argument. Why does the db name get searched 
as a n env var ?

How can I use Proteus with the same Postgres db that I use in the client rather 
than a sqlite one ?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/03f779bb-1a75-4bb1-9451-ffc639dcb7dc%40googlegroups.com.

Reply via email to