Thanksgiving Pymongo Fun Fun Fun!!

Ramit Malhotra

ramit@ischool.berkeley.edu

School of Information, UC Berkeley

The Game

"You have 1.5 hours to complete the following tasks. If you do, you get the lucky distinction of being the IOlab jedi, and shall join be in a special rendition of the GoT theme song - holiday version"

.... I'm sorry..WHAT?!
Just do the tasks, guys. I'm trying to make this fun :(

  1. Go to the IOLAB repository and pull the latest files.
  2. I have pushed the venv files too, so you *should* be able to get all the dependencies if you activate virtual env - . venv/bin/activate
  3. If not, I've 'pip installed' Flask, PyMongo, passlib, Flask-OAuthlib and some other stuff I can't remember right now. You'll figure it out
  4. Discalimer: Your flask and mongodb servers must be running in two different terminal windows for this app to work.
  5. Demo!

Mission

  • Your mission should you choose to accept (LOL, jk you have no choice): Right now the app has a sign in with Google, and sign up functionality. You have to add to this app.
    1. Sign In - Make a function in app.py for 'Sign In' which should take email and password, and check against the users stored in the collection - app.iolabUsers
    2. Logout* - I've already made the function for Google Sign in. Make one for regular sign in, and make a link in all the pages post login for logout.
    3. Forgot Password - Make a function in app.py for 'Forgot Password' which should take in email, show the user their secret question, and verify the answer before allowing a user to change their password
    4. Post Sign In* - Make a page that does something after a person sign in. Perhaps check another collection which stores "Friends", and allow a person to search by Name? (Make it pretty - All the bootstrap files are there for you!)
    5. Extra credit (will sing Britney Spears): Enable the 'Sign in with Facebook' button - Code must be written
    6. * You will need to use sessions here. Look at how I've used it for Google for hints!

    Your Weapons

    1. Flask Docs
    2. Flask-OAuthLib
    3. PassLib Cheats
    4. PyMongo API
    5. Mongo Manual

    HAPPY THANKSGIVING

    There will be 2 kinds of people at this code feast today