A Django app to migrate Vietnam address.
Project description
django-vi-address
This is a Django project about provinces/cities, districts, wards of Vietnam. The project provides a model to store data about provinces/cities, districts and wards of Vietnam.
Requirements
Python >= 3.6
Installation
-
Create a new project :: mkdir new_project && cd new_project
-
Create a new virtual environment for this project :: virtualenv venv source venv/bin/activate
-
Install using
pip
::(venv) $ pip install django-vi-address
Quick start
-
Add "rest_framework", "vi_address" to your INSTALLED_APPS setting like this:: ::
INSTALLED_APPS = [
... 'rest_framework', # new 'vi_address', # new ...
]
-
Include the "vi_address" URLconf in your project urls.py like this:: ::
your_project/urls.py
from django.urls import path, include # new
urlpatterns = [ ... path('api/address/', include('vi_address.urls')), # new ]
-
Create the models. :: python manage.py migrate
-
Insert data cities of Vietnam. :: python manage.py insert_data --datatype=city
-
Insert data districts of Vietnam. :: python manage.py insert_data --datatype=district
-
Insert data wards of Vietnam. :: python manage.py insert_data --datatype=ward
Endpoint
- Get cities list :: /api/address/cities
- Get districts list of a city :: /api/address/city/{city_id}
- Get wards list of a district :: /api/address/district/{district_id}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-vi-address-0.1.5.tar.gz
.
File metadata
- Download URL: django-vi-address-0.1.5.tar.gz
- Upload date:
- Size: 398.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4065099e5c755c6436c712bca0289db7df17353ec73030703fd5a310d910f49c |
|
MD5 | 3ebe317d16f4b66e3187e0be7668c96a |
|
BLAKE2b-256 | cf75b65b01d562fd74703759a48e6284f03865135ae55c32afcd2d6cf690f706 |
File details
Details for the file django_vi_address-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: django_vi_address-0.1.5-py3-none-any.whl
- Upload date:
- Size: 664.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f61bd96ece84ca7fc8cf5a80ef9bda8ef73a933fde8ff5bceb3266214d2a023e |
|
MD5 | 26b507cbf09ed950b57e777cecd69ae7 |
|
BLAKE2b-256 | 63e6075c4c69c255ee5c22afd99bb7ec86a937973115c7796df1becc518a3a70 |