Skip to content

API's create for countries, states, addresses with Django Rest Framework

License

Notifications You must be signed in to change notification settings

yasminfarza/country-state-address-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Country-State-Address-Api

API’s create with Django Rest Framework and MySQL

Table of Contents

General Information

  • This project is simple api for country, state, address.
  • Use CircleCI for automate development process.
  • All APIs are authenticated.
  • Provide testCase for all APIs.

Technologies

  • Django
  • Django Rest Framework
  • MySQL

Features

In the project, you can find the API's:

  • List all countries, with the option to filter countries by name and code.
  • List all states by countries, with the option to filter states by name.
  • List addresses of states, with the option to filter addresses by house_number and road_number.
  • An api to fetch a detailed address that will return the address along with it’s respective state and country.

Setup

Requirements

  • Python - version 3.8
  • Python Virtualenv
  • Django - version 3.2.3
  • Django Rest Framework - version 3.12.4
  • MySQL - version 8.0.21

Note: Django and Django Rest Framework will be installed using virtualenv

Installation

# Clone this repository
$ git clone https://github.com/yasminfarza/country-state-address-api

# Go into the repository
$ cd country-state-address-api

# Create virtualenv
$ python -m venv env

# Activate virtualenv
$ source env/Scripts/activate

# Install packages
$ pip install -r requirements.txt

# Create a database
# Copy the contents of country_state_address/.env.example to country_state_address/.env and
  modify country_state_address/.env as necessary

# Migrate the database
$ python manage.py migrate

# Create new user
$ python manage.py createsuperuser

# Load dummy data (Optional)
$ python manage.py loaddata seeds/*

# Run all test cases
$ python manage.py test

# Run the project
$ python manage.py runserver

Usage

URL for checking the api in browser:

Releases

No releases published

Packages

No packages published