Skip to content
Snippets Groups Projects
Commit 177181d1 authored by mowoe's avatar mowoe
Browse files

mysql support

parent fcfaeeb0
No related branches found
No related tags found
No related merge requests found
FROM tiangolo/uwsgi-nginx-flask:python3.6 FROM tiangolo/uwsgi-nginx-flask:python3.6
RUN pip install peewee RUN pip install peewee
RUN pip install mysql
RUN git clone https://gitlab.warpzone.ms/mowoe/chaos_familien_duell_frontend.git /zwisch RUN git clone https://gitlab.warpzone.ms/mowoe/chaos_familien_duell_frontend.git /zwisch
RUN mv /zwisch/* /app RUN mv /zwisch/* /app
from peewee import SqliteDatabase from peewee import SqliteDatabase
from peewee import Model from peewee import Model
from peewee import MySQLDatabase
import json
mysql_creds = json.load(open("./creds.json"))
#sqlite = SqliteDatabase("model/cfd.sqlite", pragmas={'foreign_keys': 1})
#sqlite.connect()
sqlite = MySQLDatabase(mysql_creds["db"], user=mysql_creds["user"], password=mysql_creds['password'],
host=mysql_creds['host'], port=int(mysql_creds['port']),)
sqlite = SqliteDatabase("model/cfd.sqlite", pragmas={'foreign_keys': 1})
sqlite.connect()
class BaseModel(Model): class BaseModel(Model):
......
{
"host":"","user":"","password":"","db":"","port":1337
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment