harvestconnect-api / api /seeding /practice_runner.py
Dayozoe's picture
feat: deploy HarvestConnect Django API with crash-proof persistent volume
a6be783 verified
Raw History Blame Contribute Delete
1.09 kB
from api.models import Product, BlogPost, Review
from .practice_cleanup import clear_practice_data
from .practice_users import create_practice_users, PASSWORD
from .practice_catalog import create_categories, create_practice_products
from .practice_content import create_articles, create_reviews
from .practice_artists import create_practice_artists
def run_practice_seed(command):
clear_practice_data(command)
categories = create_categories()
users, sellers, buyer = create_practice_users(command)
products = create_practice_products(command, users, categories)
create_articles(command, sellers)
create_reviews(products, buyer)
create_practice_artists(users)
command.stdout.write(command.style.SUCCESS('Successfully seeded practice database.'))
command.stdout.write(f'Marketplace: {Product.objects.count()} active listings')
command.stdout.write(f'Articles: {BlogPost.objects.count()} published posts')
command.stdout.write(f'Reviews: {Review.objects.count()} customer reviews')
command.stdout.write(f'Practice accounts password: {PASSWORD}')