Skip to content

Xpshnik/Django-Images-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django-Images-API

Quick setup:

First of all, open your terminal in the project folder you've just cloned. Make sure your Docker is running, is up-to-date and added to PATH, otherwise after running the next command you're likely to get a not very helpful error message like:

pywintypes.error: (2, 'CreateFile', 'The system cannot find the file specified.')

To build the project run:

docker-compose up --build

With dockerized postgres things sometimes go wrong. If you get the following error:

django.db.utils.OperationalError: connection to server at "db" (*some_ip*), port 5432 failed: Connection refused
app_1     |     Is the server running on that host and accepting TCP/IP connections?

then just run:

docker-compose down -v

to get rid of the volume created after the first command run and then rerun the initial compose command once more.

Create a superuser:

docker-compose run app sh -c "python manage.py createsuperuser"

Then you can go to http://localhost:8000/admin/ and authenticate. Inside admin panel you can create a user with account tier assigned:

image

and create/modify account tiers:

image *note that expiring links haven't been implemented yet

Now you're good to make GET requests to http://localhost:8000/api/images if you want to get urls to user's original sized images (depending on user's tier) and thumbnails:

image

To add new images and thumbnails, send POST requests to the same address and get a similar response:

image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published