import peewee
import datetime
db = PostgresqlDatabase(
'database_name',
user='user_name',
password='password',
host='localhost',
port=5432
)
class PeeweeModel(peewee.Model):
class Meta:
database = db
class User(PeeweeModel):
username = peewee.CharField(unique=True)
email = peewee.CharField()
join_date = peewee.DateTimeField(
default=datetime.datetime.now
)
db.drop_tables([User], safe=True)
db.create_tables([User])