AIforGoodSimulator / model-server

MIT License
11 stars 9 forks source link

temp database setup #158

Open kariso2000 opened 4 years ago

kariso2000 commented 4 years ago

export DATABASE_URL=sqlite:///app.db export SECRET_KEY=xxyyzz

export FLASK_ENV=development export FLASK_APP=ai4good/webapp/server:flask_app flask db init flask db migrate -m 'init' flask db upgrade

kariso2000 commented 4 years ago

pip3 install flask flask-sqlalchemy flask-login flask-migrate

kariso2000 commented 3 years ago

Login to Mysql server and create a new database if not already created. Replace database_name below with your db name:

export DATABASE_URL='mysql://username:password@0.0.0.0/database_name' export SECRET_KEY=xxyyzz export FLASK_ENV=development export FLASK_APP=ai4good/webapp/server:flask_app

flask db stamp head flask db migrate -m 'init' flask db upgrade

Check your database to see if you have the user table.

Your .env file should have the following:

DATABASE_URI = 'mysql://usernane:password@0.0.0.0/database_name'

kariso2000 commented 3 years ago

@pardf Try the above to set up mysql

kariso2000 commented 3 years ago

You may need a local mysql client if requirements.txt fails to install:

sudo apt-get install libmysqlclient-dev