Skip to content

gljooj/google-api-discovery

Repository files navigation

Customers with location using GoogleAPI

🚀 Checking data location by customer city 🚀

Important: FIRST OF ALL, PUT YOUR TOKEN GOOGLECLOUD IN .env

Preparing The environment:

Configuring environment
pip install virtualenv

virtualenv .venv

source .venv/bin/activate

pip install -r requirements.txt

How To Run:

If you don't have the make configured in your local, you can open the file make and execute the commands in your terminal 1 - make install 2 - make run 3 - make user (to creating a super user)

Access the http://localhost:8000/admin/customer/customer/ have no customers

In root of the project I put the 'customers.csv'
now, to import it, run the command:

make extract

It taking some seconds to extract all the customers, because I don't found a way to get a list in Api.
Then I take the list, make a get one by one and build a dict.
If you want to run another csv write 'docker-compose exec web bash -c 'python manage.py customers_bulkupsert --path'

Api

Endpoints: Get all customers (you can see in the browser too): http://127.0.0.1:8000/customers/

Get By id: http://127.0.0.1:8000/customers/{id}

Tests:

In 'customer/tests/management/command/tests_customer_bulkupsert.py' we have the tests to run the tests just run command

make test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published