https://github.com/dylanbuchi/find-customers
A full-stack project that stores and displays user data and its location on a map, with a REST API endpoint that allows users to be listed or retrieved by id. Built with Python, Django, SQLite, CSS, HTML, and MapBox API.
https://github.com/dylanbuchi/find-customers
django django-rest-framework rest-api
Last synced: 2 months ago
JSON representation
A full-stack project that stores and displays user data and its location on a map, with a REST API endpoint that allows users to be listed or retrieved by id. Built with Python, Django, SQLite, CSS, HTML, and MapBox API.
- Host: GitHub
- URL: https://github.com/dylanbuchi/find-customers
- Owner: dylanbuchi
- License: mit
- Created: 2021-02-03T14:02:15.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-05T11:59:02.000Z (over 2 years ago)
- Last Synced: 2025-01-03T18:21:34.575Z (4 months ago)
- Topics: django, django-rest-framework, rest-api
- Language: Python
- Homepage:
- Size: 16.1 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Find Customers
A full-stack project that stores and displays user data and its location on a map, with a REST API endpoint that allows users to be listed or retrieved by id. Built with Python, Django, SQLite, CSS, HTML, and MapBox API.
---
## Demo:-------
This project uses the MapBox API, to get the customers's city latitude and longitude and the map images
- https://docs.mapbox.com/api/overview/The project has already everything set up so there is no need to create an API key, you can skip step **5** and **6**
## Running the Project Locally
**1**. Clone the repository to your local machine:
```bash
git clone https://github.com/dylanbuchi/find-customers.git
```
**2**. Go to the root directory of the project:```bash
cd find-customers/
```
**3**. Create a python virtual environment and activate it:```bash
python -m venv venv
source venv/bin/activate
```
**4**. Install the requirements file:
```bash
pip install -r requirements.txt
```**5**. Create the database:
```bash
python manage.py makemigrations
python manage.py migrate
```**6**. Load the customers file into the database:
```bash
python manage.py load_customers --path ./data/customers.csv
```**7**. Add a Django secret key to your current environment. You can generate one from this website:
- https://djecrety.ir/```bash
export DJANGO_KEY='Your_secret_key'
```**8**. Run the development server:
```bash
python manage.py runserver
```The project will be available at http://127.0.0.1:8000/
---
```bash
You can access a customer by id with the user interface at the home page or like this: http://127.0.0.1:8000/api/v1/customers/{id_number}/
```