Skip to content

BRANYA43/boiler_shop_api

Repository files navigation

Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge


Boiler shop api

All Environment values

Django environment values

  • DJANGO_SECRET_KEY - secret key of django app.
  • DJANGO_SETTINGS_ENV - load production or development settings of django app. It's production, by default.
  • DJANGO_ALLOWED_HOSTS - list of allowed hosts for django app. Add needed your hosts to list django app allow you to enter on site by these hosts. It's localhost [::1] 127.0.0.1 0.0.0.0 by default.
  • DJANGO_SUPERUSER_USERNAME - username of superuser for django admin site. It's admin by default.
  • DJANGO_SUPERUSER_EMAIL - email of superuser for django admin site. It's admin@admin.com by default.
  • DJANGO_SUPERUSER_PASSWORD - password of superuser for django admin site. It's 123 by default.
  • DJANGO_GOOGLE_EMAIL_HOST_USER - your google email for shop.
  • DJANGO_GOOGLE_EMAIL_HOST_PASSWORD - password of google application.

Postgres environment values

  • POSTGRES_DB - database name for Postgres. It's postgres by default.
  • POSTGRES_USER - user to enter to database. It's postgres by default.
  • POSTGRES_PASSWORD - user password to enter to database. It's postgres by default.
  • POSTGRES_HOST - host for postgres. Host must be similarly name of docker compose service for Postgres.
  • POSTGRES_PORT - port for Postgres listening. It's 5432 by default.

Gunicorn environment values

  • GUNICORN_WORKERS - quantity workers for gunicorn. It's 2 by default.

CORS environment values

  • CORS_ALLOWED_ORIGINS - list of allowed site address with port.

Template of .env file with required environment values

DJANGO_SECRET_KEY=<secret key>
DJANGO_ALLOWED_HOSTS='localhost [::1] 127.0.0.1 0.0.0.0'
DJANGO_SUPERUSER_USERNAME=admin
DJANGO_SUPERUSER_EMAIL=admin@admin.com
DJANGO_SUPERUSER_PASSWORD=123
DJANGO_GOOGLE_EMAIL_HOST_USER=<email>
DJANGO_GOOGLE_EMAIL_HOST_PASSWORD=<password>

POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_HOST=<host>

Django admin site credential by default

  • Username: admin
  • Password: 123

Docker commands

Run steck of containers

docker compose up

Stop steck of container

ctrl + C

OR

docker compose stop

Delete steck of containers

docker compose down

with volumes

docker compose down -v

If you installed docker compose as application to your OS that command must start with docker-compose instead docker compose.


Product Filters

By name/s

The filter filters by a name or part of name and by multiple names or parts of names. It isn't сase sensitive. Example: single names=Name, multiple names=Name, Name.

By category

The filter filters by full name of category. It isn't сase sensitive. Example: cateogry=Category

By attribute/s

The filter filters by full name and value of attribute or multiple attributes. It's сase sensitive. Example: single attributes=Name:Value, multiple attributs=Name:Value, Name:Value.

By price range

The filter filters by price range. Example: min_range=1000&max_range=2000


Links

Api

Admin Site

Swagger

Redoc