Django server for Travel Mate (Project: nomad)

Overview

Travel Mate Server (Project: Nomad)

Build Status

Django 2.0 server for Travel Mate

Contribute

  • For new feature request in the app, open a new feature request on the main repository
  • For reporting bug in existing APIs, open a new issue on this repository

Local setup instructions

  • Clone the project from source
git clone https://github.com/project-travel-mate/server && cd server
  • Setup virtual environment
pip install virtualenv
virtualenv venv --python=python3.6

Now activate the environment shell with:

source venv/bin/activate  # On Linux

or

venv\Scripts\activate  & :: On Windows
  • Install all dependencies
pip install -r requirements.txt

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 ;
  • Database migrations
python manage.py makemigrations
python manage.py migrate
  • Run Tests
python manage.py test
  • Finally! Run server
python manage.py runserver

Open localhost:8000

  • To access Django Admin
python manage.py createsuperuser

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

Username: nomadadmin
Email address: [email protected]
Password:
Password (again):
Superuser created successfully.
  • Re-run the server
python manage.py runserver

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

  • Make a POST call to /api/sign-up with 4 form-data body objects: email, password, firstname, lastname. You should get "Successfully registered" response with 201 status code.
  • Make a POST call to /api/sign-in with 2 form-data body objects: username (which is your email Id you used for sign up), password. You will get a token in JSON response, store it somewhere.
  • For making any subsequent request, use the above token by sending it as an "Authorization HTTP Header", eg: Authorization: Token <your token>
Owner
Travel Mate
A must-have app for all the people who want to travel to a new city
Travel Mate
Corsair_scan is a security tool to test Cross-Origin Resource Sharing (CORS).

Welcome to Corsair_scan Corsair_scan is a security tool to test Cross-Origin Resource Sharing (CORS) misconfigurations. CORS is a mechanism that allow

Santander Security Research 116 Nov 09, 2022
Creation & manipulation of PyPI tokens

PyPIToken: Manipulate PyPI API tokens PyPIToken is an open-source Python 3.6+ library for generating and manipulating PyPI tokens. PyPI tokens are ver

Joachim Jablon 8 Nov 01, 2022
Graphical Password Authentication System.

Graphical Password Authentication System. This is used to increase the protection/security of a website. Our system is divided into further 4 layers of protection. Each layer is totally different and

Hassan Shahzad 12 Dec 16, 2022
FastAPI-Login tries to provide similar functionality as Flask-Login does.

FastAPI-Login FastAPI-Login tries to provide similar functionality as Flask-Login does. Installation $ pip install fastapi-login Usage To begin we hav

417 Jan 07, 2023
Python's simple login system concept - Advanced level

Simple login system with Python - For beginners Creating a simple login system using python for beginners this repository aims to provide a simple ove

Low_Scarlet 1 Dec 13, 2021
Django Auth Protection This package logout users from the system by changing the password in Simple JWT REST API.

Django Auth Protection Django Auth Protection This package logout users from the system by changing the password in REST API. Why Django Auth Protecti

Iman Karimi 5 Oct 26, 2022
CheckList-Api - Created with django rest framework and JWT(Json Web Tokens for Authentication)

CheckList Api created with django rest framework and JWT(Json Web Tokens for Aut

shantanu nimkar 1 Jan 24, 2022
Python module for generating and verifying JSON Web Tokens

python-jwt Module for generating and verifying JSON Web Tokens. Note: From version 2.0.1 the namespace has changed from jwt to python_jwt, in order to

David Halls 210 Dec 24, 2022
A JOSE implementation in Python

python-jose A JOSE implementation in Python Docs are available on ReadTheDocs. The JavaScript Object Signing and Encryption (JOSE) technologies - JSON

Michael Davis 1.2k Dec 28, 2022
API-key based security utilities for FastAPI, focused on simplicity of use

FastAPI simple security API key based security package for FastAPI, focused on simplicity of use: Full functionality out of the box, no configuration

Tolki 154 Jan 03, 2023
OpenConnect auth creditials collector.

OCSERV AUTH CREDS COLLECTOR V1.0 Зачем Изначально было написано чтобы мониторить какие данные вводятся в интерфейс ханипота в виде OpenConnect server.

0 Sep 23, 2022
Simple yet powerful authorization / authentication client library for Python web applications.

Authomatic Authomatic is a framework agnostic library for Python web applications with a minimalistic but powerful interface which simplifies authenti

1k Dec 28, 2022
Basic auth for Django.

Basic auth for Django.

bichanna 2 Mar 25, 2022
JWT authentication for Pyramid

JWT authentication for Pyramid This package implements an authentication policy for Pyramid that using JSON Web Tokens. This standard (RFC 7519) is of

Wichert Akkerman 73 Dec 03, 2021
Library - Recent and favorite documents

Thingy Thingy is used to quickly access recent and favorite documents. It's an XApp so it can work in any distribution and many desktop environments (

Linux Mint 23 Sep 11, 2022
Phishing Abusing Microsoft 365 OAuth Authorization Flow

Microsoft365_devicePhish Abusing Microsoft 365 OAuth Authorization Flow for Phishing Attack This is a simple proof-of-concept script that allows an at

bigb0ss 11 Dec 11, 2022
Crie seus tokens de autenticação com o AScrypt.

AScrypt tokens O AScrypt é uma forma de gerar tokens de autenticação para sua aplicação de forma rápida e segura. Todos os tokens que foram, mesmo que

Jaedson Silva 0 Jun 24, 2022
OAuthlib support for Python-Requests!

Requests-OAuthlib This project provides first-class OAuth library support for Requests. The OAuth 1 workflow OAuth 1 can seem overly complicated and i

1.6k Dec 28, 2022
A Python library for OAuth 1.0/a, 2.0, and Ofly.

Rauth A simple Python OAuth 1.0/a, OAuth 2.0, and Ofly consumer library built on top of Requests. Features Supports OAuth 1.0/a, 2.0 and Ofly Service

litl 1.6k Dec 08, 2022
Implementation of Supervised Contrastive Learning with AMP, EMA, SWA, and many other tricks

SupCon-Framework The repo is an implementation of Supervised Contrastive Learning. It's based on another implementation, but with several differencies

Ivan Panshin 132 Dec 14, 2022