peewee.OperationalError: unable to open database file 
I've edited your comment to include code formatting...please take the time to format your issues. It takes two seconds. Wontfix, peewee won't magically create directories for you. Thank you for fixing my post I will put more attention into the formatting in the future 😊
Dont know if this is a bug or not but reporting it anyway
this happens when i try to create a db without having the subdir where the file is placed
 ```
 File "/usr/home/user/project/todo.py", line 12, in __init__
    DB = todoDB()
  File "/usr/home/admin/ragnhild/models/todoDB.py", line 35, in __init__
    with db, dbfile:
  File "/usr/local/lib/python3.6/site-packages/peewee.py", line 2405, in __enter__
    self.connect()
  File "/usr/local/lib/python3.6/site-packages/peewee.py", line 2435, in connect
    self._initialize_connection(self._state.conn)
  File "/usr/local/lib/python3.6/site-packages/peewee.py", line 2287, in __exit__
    reraise(new_type, new_type(*exc_args), traceback)
  File "/usr/local/lib/python3.6/site-packages/peewee.py", line 170, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.6/site-packages/peewee.py", line 2434, in connect
    self._state.set_connection(self._connect())
  File "/usr/local/lib/python3.6/site-packages/peewee.py", line 2654, in _connect
    **self.connect_params)
peewee.OperationalError: unable to open database file
```
i made a quick and dirty workaround:
```
path = '/home/user/data/'
File = 'todo.db'
if os.path.isdir(path):
    pass
else:
    os.makedirs(path)
dbFile = path + File
db = SqliteDatabase(dbFile)
```