GithubHelp home page GithubHelp logo

imclab / dwd-flask-user-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matthewepler/dwd-flask-user-demo

0.0 2.0 0.0 878 KB

Demo site of Flask User Authentication and Management

Home Page: itppy-user-demo.herokuapp.com

dwd-flask-user-demo's Introduction

ITP DWD Fall 2012

Flask and User Management

Demo site to demonstrate how to

View Demo Site itppy-user-demo.herokuapp.com

  • register and login users.
  • create database documents associated to a specific user.
  • query database for documents by a user.

To get started

  • Download code

  • Create Git repo

      git init
      git add .
      git commit -am "init commit"
    
  • Create a virtual environment

      virtualenv venv
    
  • Install all requirements for app

      . runpip
    

    or

      . venv/bin/activate
      pip install -r requirements.txt
    
  • Create Heroku app

      heroku create
    
  • Add MongoLab Starter Addon to your app

  • Add MONGOLAB_URI from Heroku config to your .env file

      heroku config --shell | grep MONGOLAB_URI >> .env
    

Create a SECRET_KEY for your .env and Heroku Config

We need a SECRET_KEY for salting the user passwords.

  • Open your .env and add a new line

      SECRET_KEY=SOMETHINGSECRETANDRANDOMHERE
    
  • We need to add this secret key to Heroku config vars too

      heroku config:add SECRET_KEY=SOMETHINGSECRETANDRANDOMHERE
    

This will add a new key and value to the App on Heroku.

Run it

With your MONGOLAB_URI and SECRET_KEY configured in .env and on Heroku config you should be good to run the code.

Run,

. start

or

. venv/bin/activate
foreman start

The routes

  • / - main page - display all content and list of users
  • /users/<username>- display all content for a given user
  • /admin - must be logged in, create a new piece of content for a user
  • /register - create a new user
  • /login - login with registered email and password
  • /logout - logout user

dwd-flask-user-demo's People

Contributors

johnschimmel avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.