Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Added setup command that calls data creation script

Artur Smętfee8959317f4
diff --git a/setup.py b/setup.py
index d77d27a2fd..dff980a148 100755
--- a/setup.py
+++ b/setup.py
@@ -11,6 +11,16 @@ class Command(Command):
finalize_options = lambda self: None
+class PopulateDatabase(Command):
+ description = "Populate database with test objects"
+
+ def run(self):
+ from django.core.management import call_command
+ from utils.create_random_data import create_items
+ call_command('syncdb', interactive=True, migrate_all=True)
+ create_items('/home/artur/placeholders/', 10)
+
+
setup(
name='saleor',
author='Mirumee Software',
@@ -38,4 +48,8 @@ setup(
tests_require=[
'mock==1.0.1',
'purl>=0.4.1'],
- test_suite='saleor.tests.suite')
+ test_suite='saleor.tests.suite',
+ cmdclass={
+ 'populatedb': PopulateDatabase
+ }
+)