Skip to content

High-performance image storage service with Django and Django

Notifications You must be signed in to change notification settings

vkmrishad/image-jinn

Repository files navigation

image-jinn

High-performance image storage service

example workflow example workflow Code style: black

This system is build over s3 storage which is scalable and reliable.

Clone

git clone https://github.com/vkmrishad/image-jinn.git
or
git clone git@github.com:vkmrishad/image-jinn.git

System dependencies

Environment and Package Management

Install Poetry

$ pip install poetry
or
$ pip3 install poetry

Activate or Create Env

$ poetry shell

Install Packages from Poetry

$ poetry install

NB: When using virtualenv, install from requirements.txt using $ pip install -r requirements.txt. For environment variables follow sample.env

Runserver

$ python manage.py runserver
or
$ ./manage.py runserver

Run Celery

$ celery -A image_jinn  worker -l info

Runserver using docker

Check this documentation to run with docker, refer link Create .env file in project folder and copy all ENV vars without having export.

For initial db setup add, postgres ENV vars

POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres

You can use your own values, Please use DATABASE_HOST='postgres' for docker settings only

$ docker-compose build
$ docker-compose up

For shutting down use,

$ docker-compose down

Apply migration to database

$ docker-compose exec app python manage.py migrate

Collect static command for swagger

$ docker-compose exec app python manage.py collectstatic

Testing

$ docker-compose exec app moto_server &
$ docker-compose exec app python manage.py test apps

Access server: http://127.0.0.1:8000

API Endpoints

Run collect static to update swagger templates

$ python manage.py collectstatic
or
$ ./manage.py collectstatic

Check Swagger/Redoc documantation after running server

Test

For testing, moto_server need to be run in a new tab or background. For running moto_server, Flask is required and added in requirements.txt.

$ moto_server

moto_server will be running on http://127.0.0.1:5000, then run test

$ python manage.py test apps
or
$ ./manage.py test apps

Create superuser

Create superuser to test admin feature

$ python manage.py createsuperuser
or
$ ./manage.py createsuperuser

About

High-performance image storage service with Django and Django

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published