- Users can create an account
- Users can login
- Users can logout
Step 1
Create directory
$ mkdir alu-test
$ cd alu-test
Create and activate virtual environment
$ virtualenv env
$ source env/bin/activate
Clone the repository here
or
git clone git@bitbucket.org:lennymanyeki/alu-test.git
Install project dependencies
$ pip install -r requirements.txt
Step 2
Go to postgres terminal and create the following databases
Main database
# CREATE DATABASE database_name ;
Test database
# CREATE DATABASE test_database_name ;
Step 3
export FLASK_APP="run.py"
export APP_SETTINGS="development"
export DATABASE_URL="dbname='database_name' host='localhost' port='5432' user='postgres' password='root'"
export DATABASE_TEST_URL="dbname='test_database_name' host='localhost' port='5432' user='postgress' password='root'"
Step 4
$ python run.py
Step 5
$ nosetests app/tests
Method | Endpoint | Functionality |
---|---|---|
POST | /auth/signup | Create a user account |
POST | /auth/login | Sign in a user |
POST | /auth/logout | Sign out a user |