{"id":36769200,"url":"https://github.com/thomas545/ecommerce_api","last_synced_at":"2026-01-12T13:03:24.748Z","repository":{"id":37947643,"uuid":"202149288","full_name":"thomas545/ecommerce_api","owner":"thomas545","description":"E-commerce by Django Rest Framework ","archived":false,"fork":false,"pushed_at":"2025-12-29T20:32:34.000Z","size":823,"stargazers_count":292,"open_issues_count":2,"forks_count":96,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-02T03:04:41.205Z","etag":null,"topics":["django","django-rest-framework","ecommerce","ecommerce-api","python","restful-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thomas545.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-08-13T13:20:53.000Z","updated_at":"2025-11-15T22:00:05.000Z","dependencies_parsed_at":"2023-12-25T21:42:02.350Z","dependency_job_id":"4a94c2d1-69a0-4291-b342-607c7c81f755","html_url":"https://github.com/thomas545/ecommerce_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thomas545/ecommerce_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomas545%2Fecommerce_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomas545%2Fecommerce_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomas545%2Fecommerce_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomas545%2Fecommerce_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomas545","download_url":"https://codeload.github.com/thomas545/ecommerce_api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomas545%2Fecommerce_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","django-rest-framework","ecommerce","ecommerce-api","python","restful-api"],"created_at":"2026-01-12T13:03:24.646Z","updated_at":"2026-01-12T13:03:24.724Z","avatar_url":"https://github.com/thomas545.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Python 3.6](https://img.shields.io/badge/python-3.6-yellow.svg)](https://www.python.org/downloads/release/python-360/)\n![Django 2.2](https://img.shields.io/badge/Django-2.2-green.svg)\n[![license](https://img.shields.io/github/license/DAVFoundation/captain-n3m0.svg?style=flat-square)](https://github.com/thomas545/ecommerce_api/blob/master/LICENSE)\n\u003c!-- ![Build](https://github.com/thomas545/ecommerce_api/workflows/Django CI/badge.svg?branch=master) --\u003e\n\n# Ecommerce API\n### Documentation:\n\n1. [Django](https://docs.djangoproject.com/en/2.0/releases/2.0/)\n2. [Django Rest Framework](https://www.django-rest-framework.org/)\n3. [API Translation](https://pypi.org/project/googletrans/)\n4. [Upload Package to Pypi](https://upload.pypi.org/legacy/)\n\n\n### Installation:\n\n##### -\u003e you must install Elastic Search on your computer (you can use brew)\n\n##### System Dependencies:\n\n1. Install git on Linux:  \n`sudo apt-get install -y git`\n2. Clone or download this repo.\n3. Install pip and vitualenv on Linux:  \n`sudo apt-get install -y virtualenv`  \n`sudo apt-get install -y python3-pip`\n4. Create a virtual environment on Linux or Mac:  \n`virtualenv -p python3 ~/.virtualenvs/ecommerce`\n5. Activate the virtual environment on Linux or Mac:  \n`source ~/.virtualenvs/ecommerce/bin/activate`\n6. Install requirements in the virtualenv:  \n`pip3 install -r requirements.txt`\n\n##### Relational database dependencies (PostgreSQL):\n1. Install components for Ubuntu:  \n`sudo apt-get update`  \n`sudo apt-get install python-dev libpq-dev postgresql postgresql-contrib`\n2. Switch to **postgres** (PostgreSQL administrative user):  \n`sudo su postgres`\n3. Log into a Postgres session:  \n`psql`\n4. Create database with name **ecommerce**:  \n`CREATE DATABASE ecommerce;`\n5. Create a database user which we will use to connect to the database:  \n`CREATE USER ecommerce_user WITH PASSWORD 'ecommerce_pass';`\n6. Modify a few of the connection parameters for the user we just created:  \n`ALTER ROLE ecommerce_user SET client_encoding TO 'utf8';`  \n`ALTER ROLE ecommerce_user SET default_transaction_isolation TO 'read committed';`  \n`ALTER ROLE ecommerce_user SET timezone TO 'UTC';` \n7. Give our database user access rights to the database we created:  \n`GRANT ALL PRIVILEGES ON DATABASE ecommerce TO ecommerce_user;`\n8. Exit the SQL prompt and the postgres user's shell session:  \n`\\q` then `exit`\n\n9. Activate the virtual environment:  \n`source ~/.virtualenvs/ecommerce/bin/activate`\n10. Make Django database migrations:\n`python manage.py makemigrations`  \nthen: `python manage.py migrate`\n\n##### Use admin interface:\n1. Create an admin user:  \n`python manage.py dosuperuser`\n2. Run the project locally:  \n`python manage.py runserver`\n3. Navigate to: `http://localhost:8000/admin/`\n \n##### Steps for install Celery and work it.\n1. pip install -r requirements.txt\n2. sudo apt-get install -y erlang\n3. sudo apt-get install rabbitmq-server\n4. sudo systemctl enable rabbitmq-server\n5. sudo systemctl start rabbitmq-server to check if rabbitmq is working run: systemctl status rabbitmq-server\n6. run local server for backend\n7. run this command in new terminal in project path with activating virtual env: celery -A ecommerce worker -l info\n\n\n## Setup for Django Channels \n1. [Django Channels Deploy](https://channels.readthedocs.io/en/latest/deploying.html)\n2. [Daphne](https://github.com/django/daphne)\n3. [Django Channels configration on server](https://github.com/django/channels/issues/972)\n\n#### - if you face any problems on server pleas run these commands on production\n1. sudo service supervisor stop\n2. sudo service supervisor start\n3. sudo supervisorctl reread\n4. sudo supervisorctl update\n5. sudo service nginx restart\n6. sudo service apache2 restart\n\n\n### API Endpoints\n##### Register\nMethod: `POST`  \nEndpoint: `/registration/`  \nPayload:  \n`{  \n    \"username\": \"USERNAME\",  \n    \"password1\": \"PASSWORD\",  \n    \"password2\": \"PASSWORD\",  \n    \"email\": \"OPTIONAL_EMAIL\"  \n}`\n##### Login\nMethod: `POST`  \nEndpoint: `/login/`  \nPayload:  \n`{  \n    \"username\": \"USERNAME\",  \n    \"password\": \"PASSWORD\"  \n}`\n\n##### Logout\nMethod: `POST`  \nEndpoint: `/logout/`  \nHeaders: `Authorization: JWT YOUR_TOKEN_HERE`  \n\n\n### Admin Credentials\n### Username: `admin`  \n### Password: `admin` \n\n## For Dump and Load data\n\n##### you should creating a folder to do this operations\n\n##### for dump data from database:\n\n###### python manage.py dumpdata products --format json --indent 4 \u003e products/fixures/products.json\n\n##### For loading data into database:\n###### python manage.py loaddata products/fixures/products.json\n\n## dump and restoredatabase:\n#### pg_dump dbname=ecommerce -f /tmp/ecommerce.psql\n#### pg_restore -v --host=\u003chost\u003e --port=5432 --username=\u003cusername\u003e --password --dbname=ecommerce /tmp/ecommerce.psql\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomas545%2Fecommerce_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomas545%2Fecommerce_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomas545%2Fecommerce_api/lists"}