Skip to content

Instantly share code, notes, and snippets.

@zakariaboualaid
Created August 10, 2016 23:16
Show Gist options
  • Save zakariaboualaid/fc5c79c21928ae26a53ed9c5701f9451 to your computer and use it in GitHub Desktop.
Save zakariaboualaid/fc5c79c21928ae26a53ed9c5701f9451 to your computer and use it in GitHub Desktop.
from django.core import management
from django.core.management.base import BaseCommand
import os
import test_data
class Command(BaseCommand):
args = 'Arguments email and is paginated needed'
help = 'Django populate DB with test data.'
def handle(self, *args, **options):
if os.environ.get('DJANGO_ENV') != "production":
management.call_command('reset_db', interactive=False)
management.call_command('migrate', '--no-input')
test_data.load_test_data()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment