Smol fixes
This commit is contained in:
parent
8e52e543f9
commit
4608125fdf
7
main.py
7
main.py
@ -16,6 +16,10 @@ class Config:
|
|||||||
- host
|
- host
|
||||||
- port
|
- port
|
||||||
- dbname
|
- dbname
|
||||||
|
App:
|
||||||
|
- host
|
||||||
|
- port
|
||||||
|
- debug
|
||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""
|
"""
|
||||||
@ -28,9 +32,8 @@ class Config:
|
|||||||
print('DB not found, creating')
|
print('DB not found, creating')
|
||||||
database = mongoclient[self.dbname]
|
database = mongoclient[self.dbname]
|
||||||
|
|
||||||
# TODO: Create table if not exists
|
|
||||||
if 'posts' not in database.list_collection_names():
|
if 'posts' not in database.list_collection_names():
|
||||||
print('Table not fount, creating')
|
print('Table not found, creating')
|
||||||
posts = database['posts']
|
posts = database['posts']
|
||||||
self.posts = posts
|
self.posts = posts
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user