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.5.tar.gz
(16.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imgtohttps-0.5.tar.gz.
File metadata
- Download URL: imgtohttps-0.5.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae017a59f81d8d3e6ddc314aa431c725bf7a7ca6341024ac744055e0e0ee19c6
|
|
| MD5 |
6e9e5ef5f658d66567fd96f6fcbd478a
|
|
| BLAKE2b-256 |
1bab467f63b7cd5d24f5e456d47a0d53d933f8cbb5c709451e5f01811054a0e7
|
File details
Details for the file imgtohttps-0.5-py2.py3-none-any.whl.
File metadata
- Download URL: imgtohttps-0.5-py2.py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2528c441f48935e759274cf308937889543f13d0f7e4632876f0c87aefaa8b8
|
|
| MD5 |
1cd4c99f5d41daf7b6c7ba1093f17400
|
|
| BLAKE2b-256 |
47420f6a48c1e89fa80597832a08bc0dbab7f301d2efd7d77972232ed12e94bb
|