index.community/scraper/management/commands/build_graph.py
Tao Bror Bojlén 93932c5196
add graph (#1)
* add initial graph

* add graph
2018-09-01 15:32:04 +02:00

23 lines
664 B
Python

import subprocess
from django.core.management.base import BaseCommand
from django.conf import settings
class Command(BaseCommand):
help = "Takes what's in the database and calls Gephi to create and layout a graph"
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def handle(self, *args, **options):
database_config = settings.DATABASES['default']
subprocess.call([
'java',
'-Xmx4g',
'-jar',
'gephi/build/libs/graphBuilder.jar',
database_config['NAME'],
database_config['USER'],
database_config['PASSWORD'],
])