No description
Find a file
2024-09-03 00:57:20 +02:00
templates Create placeany flask project 2024-09-03 00:52:43 +02:00
.gitignore Create placeany flask project 2024-09-03 00:52:43 +02:00
Caddyfile Provide sample Caddyfile 2024-09-03 00:53:28 +02:00
Containerfile Introduce container build files 2024-09-03 00:52:54 +02:00
Containerfile.aio Introduce container build files 2024-09-03 00:52:54 +02:00
LICENSE Create placeany flask project 2024-09-03 00:52:43 +02:00
README.md Add README 2024-09-03 00:57:20 +02:00
requirements.txt Create placeany flask project 2024-09-03 00:52:43 +02:00
wsgi.py Create placeany flask project 2024-09-03 00:52:43 +02:00

What is this?

A quick and simple service for getting pictures of whatever-you-want for use as placeholders in your designs or code. Just put your image size (width & height) after the URL and you'll get a placeholder.

Similar URL API as Placekitten.

There is also a bookmarklet service which works the same as Horse_ebookmarklet.

Installation

For local development builds, not suitable for production:

  1. Go to the code: cd path/to/holder
  2. Create and activate a virtualenv.
  3. Get dependencies in place: pip install -r requirements.txt
  4. Set up a collection of images. a. Create the directory ./images. b. Get some images, from Unsplash or similar. c. Place images in image directory.
  5. Start the app: flask run .
  6. Go to http://localhost:5000 in your web browser.
  7. Done!

Run as Container

The most easy and portable way to use this is to use Docker or Podman. In this build, waitress is used for production readyness. Port 5099 is instead used.

podman build .
podman run -it -p 5099:5099 -v ./images:/app/images <container id>

If you wish to embed images in container as well, use alternate Containerfile.

podman build -f Containerfile.aio --build-arg images=./images .
podman run -it -p 5099:5099 <container id>

Example calls

# generates an image, 200px wide and 300px tall
http://localhost:5000/200/300

# generates an image in grayscale, 200px wide and 300px tall
http://localhost:5000/g/200/300