Eshop platform with elasticsearch,DRF,oauth2 provider
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
eshop first commit Dec 9, 2018
money Update tests.py Jan 14, 2019
README.md Update README.md Dec 28, 2018
manage.py first commit Dec 9, 2018

README.md

Eshop

The app designed as an eshop for argicultural products with python3.6 and Django 2.1.

That is why it has a quantity field in grammars.

It can be used as a eshop for other types of products as well.

The search field in the home page is using elasticsearch in order to find products based on description.

But you can adapt it in any producst you need it for with basic knowlegde of python and Django.

Requirements:

Download the Elasticsearch : https://www.elastic.co/downloads/elasticsearch

Run with bin/elasticsearch

pip install django-elasticsearch-dsl

After you build the documents.py run: $ ./manage.py search_index --rebuild

In this example i have the Products,Category models in the Elasticsearch

in order to make changes or create new products you have to activate Elasticsearch.

if you want to use the oauth2 authentication backend in rest framework:

pip install djangorestframework

pip install django-oauth-toolkit django-cors-middleware

and you may want to uncomment the authentication_classes,permission_classes.

You have to create an application in Admin:

Authorization grant type: Resource owner password based

Example with curl:

curl -X POST -d "grant_type=password&username=<user_name>&password=" -u"<client_id>:<client_secret>" http://localhost:8000/o/token/

curl -H "Authorization: Bearer <your_access_token>" http://localhost:8000/example/

curl -H "Authorization: Bearer <your_access_token>" -X POST -d"username=foo&password=bar" http://localhost:8000/example_login/

In order to use the CountryField:

pip install django-countries

The payments are execute with paypal.

The app originally runs with sandbox paypal.