Skip to main content

Simple image uploader

Project description

About

Microservice for uploading all insecure images to Imgur by url.

Use Redis as cache backend and metadata storage.

Installation

Install uwsgi and python3 plugin:

sudo apt-get install uwsgi uwsgi-plugin-python3

Make virtualenv:

cd /opt
pyvenv-3.4 img_service
source img_service/bin/activate

Install from PyPI:

pip install imgtohttps

Create config file for app:

[uwsgi]
plugins = python34
master = true
enable-threads = true
processes = 4
module = imgtohttps.application:app
virtualenv = /opt/img_service
chdir = /opt/img_service
touch-reload = /opt/img_service/reload
env=APP_SETTINGS=settings.Production

Connect to nginx:

server {
    listen          127.0.0.1:2100;
    access_log off;
    location / {
        uwsgi_pass  unix:/run/uwsgi/app/img_service/socket;
        include             uwsgi_params;
    }
}

Usage

Request:

curl -X POST -H "Content-Type: application/json" -d '{"url": "http://example.com/image.png"}' http://localhost:2100

Response:

{"url": "https://i.imgur.com/AxQwu0h.png"}

Error:

{"error": "Some error message"}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imgtohttps-0.4.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imgtohttps-0.4-py2.py3-none-any.whl (6.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file imgtohttps-0.4.tar.gz.

File metadata

  • Download URL: imgtohttps-0.4.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for imgtohttps-0.4.tar.gz
Algorithm Hash digest
SHA256 f1f7e9348f0b4f76fc372149e5fd19987adc443d19cfbb00ce6d522e05d364c0
MD5 554aeeac819dac076a57ed5bac2b1c56
BLAKE2b-256 ac849a40530210ea8074c3d246f3b70d8b3697f48e4d94b8d165269fd5c187b4

See more details on using hashes here.

File details

Details for the file imgtohttps-0.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for imgtohttps-0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3d5787a6bbed7fbf94c59ec66cb1d0b53e3506bbbdaf2c143215344a2c3c5dad
MD5 65878fa5ef57dd870133acefbbdeeac0
BLAKE2b-256 dbb0409ddd9efd195c568abb08b1ba6c501aebc9cc288b361fe0d69a97a1b968

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page