A simple REST API to manage postal addresses, written in Python/Django.

Related tags

Djangoaddress-book
Overview

Address Book

A simple REST API to manage postal addresses, written in Python/Django.

Table of Contents

Up and Running

Assuming you have Python 3 installed, you have to follow the below steps to get the application running.

First, make sure to install the required dependencies via pip:

pip install -r requirements.txt

Then, set up the database:

python manage.py migrate

Optionally, add a user to the database:

python manage.py createsuperuser

Now you're all set to fire up the server:

python manage.py runserver

Rock 'n' Roll! 🤘

Available Endpoints

The following endpoints are available:

  • Address
    • Create
    • Retrieve
    • Update and Partial Update
    • Delete and Batch Delete
    • List (filtered and paginated)
  • Token
    • Create Access and Refresh Token
    • Refresh Access Token
  • User
    • Get Current User

For details (such as request/response schemas), please refer to the OpenAPI documentation which is, by default, served at

Notes, Assumptions

Throughout the codebase you will find documentation comments detailing a few decisions (regarding the model, the URIs and such). Here I also provide notes and assumptions regarding things that might not have an exact codebase location.

Assumption: Address vs Postal Address

In the requirements, one can mostly find the term "address". However, "postal address" also makes an appearance. Is there any difference between these two, or they refer to the same domain concept?

I assumed they are the same.

Assumption: manage.py runserver

Since there was no need to deploy the code to a server, I assumed, it is enough that the application can be run via manage.py runserver.

Assumption: Practical retrieval of multiple entries

The requirements stated that users shall be able to retrieve a larege number of addresses in a practical way. I assumed pagination is one such practical way. I used simple page-number pagination with a page size of 10. By adding pagination to the application, clients can retrieve multiple addresses without placing too much load on the server.

Assumption: SQLite is fine

Since we're not deploying the application anywhere, I simply used SQLite. However, if we expect a large number of users and operations, of course, a standalone database backend would be necessary. Here, I opted for easy setup.

Assumption: Token-based authentication is fine

As clients can hold state, and we are expecting a variety of clients, I thought token-based authentication is best because of its flexibility. From CLIs to mobile apps, token-based authentication work well. I did not implement logout, as I did not want to bother with token blacklisting :(

Assumption: Default password constraints are fine

Usually, each site has its own constraints passwords must adhere to. In this case, I assumed, the default validation constraints are just fine.

Note: Package-by-feature

Not sure if this is idiomatic Python/Django, but I used a package-by-feature approach to separate my Address and User endpoints.

License

Address Book is available under The MIT License.

Owner
Attila Bagossy
Attila Bagossy
Modular search for Django

Haystack author: Daniel Lindsley date: 2013/07/28 Haystack provides modular search for Django. It features a unified, familiar API that allows you to

Daniel Lindsley 4 Dec 23, 2022
A simple djagno music website.

Mrock A simple djagno music website. I used this template and I translated it to eng. Also some changes commited. My Live Domo : https://mrock.pythona

Hesam N 1 Nov 30, 2021
A GitHub Action for checking Django migrations

🔍 Django migrations checker A GitHub Action for checking Django migrations About This repository contains a Github Action that checks Django migratio

Oda 5 Nov 15, 2022
A Django Webapp performing CRUD operations on Library Database.

CRUD operations - Django Library Database A Django Webapp performing CRUD operations on Library Database. Tools & Technologies used: Django MongoDB HT

1 Dec 05, 2021
A simple plugin to attach a debugger in Django on runserver command.

django-debugger A simple plugin to attach a debugger in Django during runserver Installation pip install django-debugger Usage Prepend django_debugger

Sajal Shrestha 11 Nov 15, 2021
Django REST Client API

Django REST Client API Client data provider API.

Ulysses Monteiro 1 Nov 08, 2021
A Django backed for PostgreSQL using Psycopg 3

A Django backend for PostgreSQL using Psycopg 2 The backend passes the entire Django test suite, but it needs a few modifications to Django and to i

Daniele Varrazzo 42 Dec 16, 2022
Django models and endpoints for working with large images -- tile serving

Django Large Image Models and endpoints for working with large images in Django -- specifically geared towards geospatial tile serving. DISCLAIMER: th

Resonant GeoData 42 Dec 17, 2022
A simple page with paypal payment and confiramtion in django

django-paypal a simple page with paypal payment and confiramtion in django Youtube Video : Paypal Smart Button : https://developer.paypal.com/demo/che

Mahmoud Ahmed 5 Feb 19, 2022
A debug/profiling overlay for Django

Django Debug Toolbar The Django Debug Toolbar is a configurable set of panels that display various debug information about the current request/respons

David Cramer 228 Oct 17, 2022
Ugly single sign-on for django projects only

django-usso Ugly single sign-on for django projects only. Do you have many django apps with different users? Do you want to use only one of those apps

Erwin Feser 1 Mar 01, 2022
Packs a bunch of smaller CSS files together from 1 folder.

Packs a bunch of smaller CSS files together from 1 folder.

1 Dec 09, 2021
PWA is a simple Django app to develope and deploy a Progressive Web Application.

PWA PWA is a simple Django app to develope and deploy a Progressive Web Application. Detailed documentation is in the "docs" directory. Quick start Ad

Nima 6 Dec 09, 2022
based official code from django channels, replace frontend with reactjs

django_channels_chat_official_tutorial demo project for django channels tutorial code from tutorial page: https://channels.readthedocs.io/en/stable/tu

lightsong 1 Oct 22, 2021
A Django app for managing robots.txt files following the robots exclusion protocol

Django Robots This is a basic Django application to manage robots.txt files following the robots exclusion protocol, complementing the Django Sitemap

Jazzband 406 Dec 26, 2022
django-idom allows Django to integrate with IDOM

django-idom allows Django to integrate with IDOM, a package inspired by ReactJS for creating responsive web interfaces in pure Python.

113 Jan 04, 2023
A Django application that provides country choices for use with forms, flag icons static files, and a country field for models.

Django Countries A Django application that provides country choices for use with forms, flag icons static files, and a country field for models. Insta

Chris Beaven 1.2k Jan 07, 2023
Django based webapp pulling in crypto news and price data via api

Deploy Django in Production FTA project implementing containerization of Django Web Framework into Docker to be placed into Azure Container Services a

0 Sep 21, 2022
Neighbourhood - A python-django web app to help the residence of a given neighborhood know their surrounding better

Neighbourhood A python-django web app to help the residence of a given neighborh

Levy Omolo 4 Aug 25, 2022
A simple app that provides django integration for RQ (Redis Queue)

Django-RQ Django integration with RQ, a Redis based Python queuing library. Django-RQ is a simple app that allows you to configure your queues in djan

RQ 1.6k Jan 06, 2023