import sys
from datetime import datetime
from django.core.management.base import NoArgsCommand
from django.contrib.auth.models import User
from ws_app.reg.events import create_user, create_event
def seed_db():
""" a method to seed the database with random data """
user = create_user('admin@fossee.in', 'Fossee321Python', 'Admin', 'Fossee')
user.is_active = True
user.is_staff = True
user.is_superuser = True
user.save()
"""
for i in range(20):
user = create_user('user'+str(i)+'@example.com','123456', 'User', str(i))
for i in range(5):
create_event("workshop"+str(i), "This is workshop"+str(i), datetime(2010, 4, i+4), datetime(2010, 4, i+6), user)
"""
class Command(NoArgsCommand):
def handle_noargs(self, **options):
""" Just copied the code from seed_db.py """
seed_db()