I am doing a course for my bootcamp in which I am being introduced to sqlAlchemy. I have followed along, restarted 2 or 3 times, and checked every little thing but I cannot get the two to link up. Here are the steps I took:
- I make a folder
- Make a
venvand activate it - Install
psycopg,flask-sqlalchemy,ipython - Create an
app.pyfile - Contents of the file:
from flask import Flask, request, flash, session, redirect, render_template
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql:///dogs'
db = SQLAlchemy()
db.app = app
db.init_app(app)
app.config['SECRET_KEY'] = 'vdjndv'
- then I go into
ipython, run the file and typedb.
The video shows an object returned but all I get is <SQLAlchemy>. I have tried so many different things from other forums and nothing is working. Help is much appreciated as I cannot continue until I figure out this core step.