project-travel-mate / server

Django server for Travel Mate (Project: nomad)
https://project-travel-mate.github.io
MIT License
47 stars 65 forks source link
django django-rest-framework python travel-mate

Travel Mate Server (Project: Nomad)

Build Status

Django 2.0 server for Travel Mate

Contribute

Local setup instructions

For Linux-

$ sudo -u postgres createuser nomad
$ sudo -u postgres createdb nomad

$ sudo -u postgres psql
psql=# alter user nomad with encrypted password 'pass';
psql=# grant all privileges on database nomad to nomad ;
psql=# ALTER USER nomad CREATEDB ;

For Windows-

The complete path>psql -U postgres -h localhost
Password:The one given during setup of postgres.
postgres=# create database nomad;
postgres=# create user nomad;
postgres=# alter user nomad with encrypted password 'pass';
postgres=# grant all privileges on database nomad to nomad ;
postgres=# ALTER USER nomad CREATEDB ;

Open localhost:8000

When prompted, type your username (lowercase, no spaces), email address, and password. For example, the output should look like this:

Username: nomadadmin
Email address: nomadadmin@nomad.com
Password:
Password (again):
Superuser created successfully.

Open localhost:8000/admin

Working with authenticated APIs

You would need to have a registered user, with which you can generate a authentication token. Follow the following steps to generate a token (You can download Postman client to make the following POST calls) Reference: TokenAuthentication API docs