High-performance image storage service
This system is build over s3 storage which is scalable and reliable.
git clone https://github.com/vkmrishad/image-jinn.git
or
git clone git@github.com:vkmrishad/image-jinn.git
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
$ python manage.py runserver
or
$ ./manage.py runserver
$ celery -A image_jinn worker -l info
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
Access Admin: http://127.0.0.1:8000/admin/
Run collect static to update swagger templates
$ python manage.py collectstatic
or
$ ./manage.py collectstatic
Check Swagger/Redoc documantation after running server
Swagger: http://127.0.0.1:8000/api/
Redoc: http://127.0.0.1:8000/redoc/
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 to test admin feature
$ python manage.py createsuperuser
or
$ ./manage.py createsuperuser