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
Django Phyton Web Apps template themes

Django Phyton Web Apps template themes Free download source code project for build a modern website using django phyton web apps. Documentation instal

Mesin Kasir 4 Dec 15, 2022
Notes-Django: an advanced project to save notes in Django. where users are able to Create, Read, Update and Delete their notes.

An advanced software to keep you notes. It allows users to perform CRUD operations on theirs Notes. Was implemented Authorization and Authentication

Edilson Pateguana 1 Feb 05, 2022
Updates redisearch instance with igdb data used for kimosabe

igdb-pdt Update RediSearch with IGDB games data in the following Format: { "game_slug": { "name": "game_name", "cover": "igdb_coverart_url",

6rotoms 0 Jul 30, 2021
Template for Django Project Using Docker

You want a Django project who use Docker and Docker-compose for Development and for Production ? It's for you !

1 Dec 17, 2021
📊📈 Serves up Pandas dataframes via the Django REST Framework for use in client-side (i.e. d3.js) visualizations and offline analysis (e.g. Excel)

Django REST Pandas Django REST Framework + pandas = A Model-driven Visualization API Django REST Pandas (DRP) provides a simple way to generate and se

wq framework 1.2k Jan 01, 2023
Simple web site for sharing your short stories and beautiful pictures

Story Contest Simple web site for sharing your short stories and beautiful pictures.(Cloud computing first assignment) Clouds The table below shows cl

Alireza Akhoundi 5 Jan 04, 2023
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
An insecure login and registration website with Django.

An insecure login and registration website with Django.

Luis Quiñones Requelme 1 Dec 05, 2021
open source online judge based on Vue, Django and Docker

An onlinejudge system based on Python and Vue

Qingdao University(青岛大学) 5.2k Jan 09, 2023
Service request portal on top of Ansible Tower

Squest - A service request portal based on Ansible Tower Squest is a Web portal that allow to expose Tower based automation as a service. If you want

Hewlett Packard Enterprise 183 Jan 04, 2023
This is a personal django website for forum posts

Django Web Forum This is a personal django website for forum posts It includes login, registration and forum posts with date time. Tech / Framework us

5 May 12, 2022
Twitter Bootstrap for Django Form - A simple Django template tag to work with Bootstrap

Twitter Bootstrap for Django Form - A simple Django template tag to work with Bootstrap

tzangms 557 Oct 19, 2022
A BitField extension for Django Models

django-bitfield Provides a BitField like class (using a BigIntegerField) for your Django models. (If you're upgrading from a version before 1.2 the AP

DISQUS 361 Dec 22, 2022
Use watchfiles in Django’s autoreloader.

django-watchfiles Use watchfiles in Django’s autoreloader. Requirements Python 3.7 to 3.10 supported. Django 2.2 to 4.0 supported. Installation Instal

Adam Johnson 43 Dec 14, 2022
Django query profiler - one profiler to rule them all. Shows queries, detects N+1 and gives recommendations on how to resolve them

Django Query Profiler This is a query profiler for Django applications, for helping developers answer the question "My Django code/page/API is slow, H

Django Query Profiler 116 Dec 15, 2022
Resolve form field arguments dynamically when a form is instantiated

django-forms-dynamic Resolve form field arguments dynamically when a form is instantiated, not when it's declared. Tested against Django 2.2, 3.2 and

DabApps 108 Jan 03, 2023
Pipeline is an asset packaging library for Django.

Pipeline Pipeline is an asset packaging library for Django, providing both CSS and JavaScript concatenation and compression, built-in JavaScript templ

Jazzband 1.4k Jan 03, 2023
A generic system for filtering Django QuerySets based on user selections

Django Filter Django-filter is a reusable Django application allowing users to declaratively add dynamic QuerySet filtering from URL parameters. Full

Carlton Gibson 3.9k Jan 03, 2023
This is a basic Todo Application API using Django Rest Framework

Todo Application This is a basic Todo Application API using Django Rest Framework. Todo Section - User can View his previously added todo items, creat

Atharva Parkhe 1 Aug 09, 2022
Vehicle registration using Python, Django and SQlite3

PythonCrud Cadastro de veículos utilizando Python, Django e SQlite3 Para acessar o deploy no Heroku:

Jorge Thiago 4 May 20, 2022