Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blacklisting

An in-memory Blacklisting Service using Django framework.

Refer this website for API Usage [Site Under Construction]

Pre-requisites

Running In local

  • Python3

How to Start Server

Using Docker

docker build -t blacklisting .
docker run -p 8080:8080 blacklisting

The above commands start the server in port 8080

Without Docker

pip install -r requirements.txt
cd blacklisting
python manage.py runserver

How to use

API's

GET

Lists all the IPv4 address from DB

Request

curl -XGET 'localhost:8000/v1/blacklist'

Response

HTTP/1.1 200 OK
{"all_ip": ["192.168.97.10", "192.168.98.10", "192.168.08.58", "192.168.0.2", "192.168.0.25"]}
POST

Request

curl -XPOST 'localhost:8000/v1/blacklist' \
        --header 'Content-Type: application/json' \
        --data-raw '"{\"ip\" : \"192.168.0.3\"}"'

Response

HTTP/1.1 201 Created
DELETE

Request

curl -XDELETE 'localhost:8000/v1/blacklist' \
        --header 'Content-Type: application/json' \
        --data-raw '"{\"ip\" : \"192.168.0.3\"}"'

Response

HTTP/1.1 200 OK
DELETE
curl -XDELETE localhost:8000/v1/blacklist
        --body '{"ip":"192.168.92.68"}'

Copyrights

/**
 * 
 * @author Rakesh Kumar T
 * @github rakesht2499
 *
 */

About

A Django application for Blacklisting Service

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages