- Clone repository
$ git clone https://github.com/xp-rodion/StoreApi.git
-
Configure environment:
- Copy example environment preset and open its:
$ cp .env.example .env && vim .env
- Configurate DB connection for local db or use default values for docker running(default already in env.example):
POSTGRES_USER= POSTGRES_PASSWORD= POSTGRES_HOST= POSTGRES_PORT= POSTGRES_DB=
I will write the keys for stripe and django here: 3.
SECRET_KEY=django-insecure-j+&f=#oewr%mh)r5c%p^*0nd695agi-_g4-k!$$)$r4bq$w_(j STRIPE_PUB_KEY=pk_test_51MUuvEJE4wc8vNIdQq2Da8zV04wmR3Wk5NAQiAAqen0oVbSr2vp7zlhHeeZg0Y9WmlWB5ZtvElNO2tCitjNjc36600NMHC2Soj STRIPE_SEC_KEY=sk_test_51MUuvEJE4wc8vNIdaD2yATDtrrZQGI7MsJNYVbUjayN6UeJOAGpdvKs8QMNAnleBclCwVe4lMZUehPJU7g9SLXYz00WnAn6JdS
- Default set for server:
SERVER_HOST=0.0.0.0 SERVER_PORT=8000
-
Run server: 1. Inside container:
$ docker-compose up -d --build
- Using the admin panel, you can set up models and test the api or upload fixture data:
$ sudo docker exec -it web python manage.py loaddata --format=json [Model] > [JSON fixture].json
- Using the admin panel, you can set up models and test the api or upload fixture data:
- http://45.8.248.105:8000/admin - admin panel for creating items, taxes, orders and discounts
- http://45.8.248.105:8000/api/item/<item_id> - getting the session_id of the item
- http://45.8.248.105:8000/api/buy/<item_id> - stripe page for payment of item
- http://45.8.248.105:8000/api/buy_order/<order_id> - getting the session_id of the order
- http://45.8.248.105:8000/api/order/<order_id> - stripe page for payment of order
login: admin password: 16082003
Taxes and discounts are checked by hanging their admin panel on order