Files
mealie/dev/scratch/write_settings.py
Hayden 25988836c0 Sqlite (#75)
* file structure

* auto-test

* take 2

* refactor ap scheduler and startup process

* fixed scraper error

* database abstraction

* database abstraction

* port recipes over to new schema

* meal migration

* start settings migration

* finale mongo port

* backup improvements

* migration imports to new DB structure

* unused import cleanup

* docs strings

* settings and theme import logic

* cleanup

* fixed tinydb error

* requirements

* fuzzy search

* remove scratch file

* sqlalchemy models

* improved search ui

* recipe models almost done

* sql modal population

* del scratch

* rewrite database model mixins

* mostly grabage

* recipe updates

* working sqllite

* remove old files and reorganize

* final cleanup

Co-authored-by: Hayden <hay-kot@pm.me>
2021-01-15 21:46:35 -09:00

40 lines
971 B
Python

import json
import requests
POST_URL = "http://localhost:9921/api/site-settings/themes/create/"
GET_URL = "http://localhost:9921/api/site-settings/themes/"
SITE_SETTINGS = [
{
"name": "default",
"colors": {
"primary": "#E58325",
"accent": "#00457A",
"secondary": "#973542",
"success": "#5AB1BB",
"info": "#FFFD99",
"warning": "#FF4081",
"error": "#EF5350",
},
},
{
"name": "purple",
"colors": {
"accent": "#4527A0",
"primary": "#FF4081",
"secondary": "#26C6DA",
"success": "#4CAF50",
"info": "#2196F3",
"warning": "#FB8C00",
"error": "#FF5252",
},
},
]
if __name__ == "__main__":
for theme in SITE_SETTINGS:
data = json.dumps(theme)
response = requests.post(POST_URL, data)
response = requests.get(GET_URL)