View Demo Site http://itppy-user-demo.herokuapp.com
- register and login users.
- create database documents associated to a specific user.
- query database for documents by a user.
-
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
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.
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
- / - 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