Test a standalone script to use Django ORM without running webserver

The API server needs to be an optional component. It must not be
required to run ARA. This is just a proof of concept of the internal
Django client.

Change-Id: Icf76e0d8cf65401536f858e29236ee913f25b4b1
This commit is contained in:
Guillaume Vincent 2018-02-27 13:34:29 +01:00 committed by David Moreau Simard
parent a889a71bcd
commit 42b04c5674
No known key found for this signature in database
GPG Key ID: 33A07694CBB71ECC
1 changed files with 13 additions and 0 deletions

13
standalone/test.py Normal file
View File

@ -0,0 +1,13 @@
import os
import sys
import django
parent_directory = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(parent_directory)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ara.settings")
django.setup()
from api import models
print(models.Playbook.objects.all())