Adding models and creating database

  • Pip install Flask-SQLALchemy
  • Pip install Flask-migrate
  • pip install flask-login
  • pip install Werkzeug

Login Manager

(The most important part of an application that uses Flask-Login is the login manager class. You should create one for your application somewhere in your code, like this:)

login_manager = LoginManager()

__init__.py(social_friendly_application) –

Models.py

Open cmd –

(flask_example) C:\Users\neelm\flask_example\social_friendly_application>python

Give command:— from __init__ import db

db.create_all() (“data base created check your files”)

Open chat