Completed this project in following steps:
- Established database by installing postgresql and then creating a app on heroku.
- Once account is made in heroku then visited adminer and entered heroku's Credentials info in it.
- Configured my SQLAlchemy database by running "export DATABASE_URL=postgres://ikflpanwhzokex:9b2153bb8624b9de3f9ead9c2c4abfb3ef791d5bad4431be22607332083dad7d@ec2-18-206-84-251.compute-1.amazonaws.com:5432/d9v3cc6jr7gg10" in the terminal window with active pyenv manmo_codes.
- Now every thing it up and runniing and all we need to do is create a code. Flask micro framework use application.py to do its thing. I created follloeing routes: a. index - "/" b. register- "/register" c. login - "/login" d. logout - "/logout" e. review - "/review/"
- Stated with importing login_required method from helper.py (which is a filed I took from github open source). Helper.py provided us with decorator login_required that is sticked with every route so as to make sure when ever a user hop from a page to another he is always logied in.
- Next step is to make register route. using post request method we get the form input of user's username and password form registed.html. Then we enterd the same into our data base using db.session.add. Also for browser to know how is logged in we updated our session['user_id']. once a user is registerd we redirect the user to login page.
Go check out my YOUTUBE video that will show working of this web application
Link for the video: https://www.youtube.com/watch?v=7-xl-usf27s