Add daily-stone page showing a different mineral each day
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
New dailystone app with 207 minerals scraped from Wikipedia. Each day displays a different mineral with photos, formula, properties, description, and history. Page theme color matches the mineral's typical appearance. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
22
dailystone/management/commands/export_minerals.py
Normal file
22
dailystone/management/commands/export_minerals.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
Export mineral data as a JSON fixture for loading on the production server.
|
||||
|
||||
Usage:
|
||||
python manage.py export_minerals > dailystone/fixtures/minerals.json
|
||||
python manage.py loaddata dailystone/fixtures/minerals.json
|
||||
"""
|
||||
import json
|
||||
import sys
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.core import serializers
|
||||
|
||||
from dailystone.models import Mineral
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Export mineral data as a Django fixture (JSON)'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
data = serializers.serialize('json', Mineral.objects.all(), indent=2)
|
||||
self.stdout.write(data)
|
||||
Reference in New Issue
Block a user