A simple step by step guide to using postgresql with flask.
sudo -u postgres psql
CREATE DATABASE <replace_db_name_here>;
CREATE USER <replace_username_here> WITH PASSWORD '<replace_password_here>’;
ALTER USER user_name WITH PASSWORD 'new_password';
ALTER USER myuser RENAME TO newname;
GRANT ALL PRIVILEGES ON DATABASE "<replace_db_name_here>" to <replace_username_here>;
- Use “” instead of ‘’ for the GRANT <database_name>
- Always terminate the statement with a ; for it to be executed
python manage.py db init
python manage.py db migrate
python manage.py db upgrade