Skip to content

The source code for a small website to compare pieces of printed filament.

License

Notifications You must be signed in to change notification settings

itsthejoker/filamentcolors.xyz

Repository files navigation

filamentcolors.xyz

The source code for a small website to compare pieces of printed filament.

Public API

Please give credit if you use my work for your project! Let me know if you do use this for something; I always love to see how this information is used!

https://filamentcolors.xyz/api/

If you use my API for a project, I politely request that you check out my patreon to help pay for server costs: https://www.patreon.com/filamentcolors. I also have a way to do one-time donations of any amount here: https://buy.stripe.com/8wMbKg8UT4k8fBKaEE

API notes:

Please don't hammer the API if you're just checking for a specific piece of information like color values; instead, please keep a cache of the information that's important to you. There's a quick endpoint that you can use to validate that the information you have cached and the server information are the same.

Send a GET request to https://filamentcolors.xyz/api/version/; you'll get the following response: {"db_version": 1, "db_last_modified": 1586021667}. The db_version will be incremented if the schema changes (which for right now, assume that it is stable), and the db_last_modified key is an ISO timestamp of the last time there was a swatch uploaded.

If you have any questions, please feel free to reach out to me via email at [email protected]!

Development

If you'd like to poke around the site and help me out, I'd love to have you! You will need to have poetry installed. Here's how you can get started:

  1. Clone the repository
  2. Create a file called local_settings.py in the root of the project (the same folder as manage.py) with the following contents:
from filamentcolors.settings.base import *

DEBUG = True
ALLOWED_HOSTS = ["*"]
INTERNAL_IPS = ["127.0.0.1", "localhost"]
POST_TO_SOCIAL_MEDIA = False
  1. Install the requirements: poetry install
  2. Seed the data: poetry run python manage.py seed_swatches (this may take a bit)
  3. Run the server: poetry run python manage.py runserver