-
Notifications
You must be signed in to change notification settings - Fork 1
How to apply InPython to Django applications
This document shows how to apply the InPython script to a Django application. We use github.com/aaryani/CoreTardis as an example of this process:
Step 1. CoreTardis/bin/django includes djangorecipe.manage.main(settings) which calls
Step 2. CoreTardis/eggs/Djangorecipe-0.99-py2.6.egg/djangorecipe/manage.py includes management.execute_manager(mod) which calls
Step 3. CoreTardis/eggs/Django-1.3-py2.6.egg/django/core/management/_init_.py.
Step 1. At this file we comment out two lines at def execute_manager(settings_mod, argv=None):
utility = ManagementUtility(argv)
utility.execute()
and add
from tardis.DEF_CALL import metamodelling
for DEF and CALL relations or add
from tardis.LOGS import metamodelling
to get the execution logs from dynamic analysis.
Step 2. Add the DEF_CALL, LOGS, echo_all.py to CoreTardis/tardis folder.
Step 1. Rename instrumentCoreTardis/LOGS/check_logs.py to instrumentCoreTardis/LOGS/test_logs.py
Step 2. Move the metamodeling.py outside the CoreTardis folder
Step 3. Rename [metamodeling for check.py] to metamodeling.py
Step 4. if in the Step 3 of the last section, you have change /core/management/_init_.py, please return back the file to the original version.
Step 1. Rename instrumentCoreTardis/LOGS/check_counting.py to instrumentCoreTardis/LOGS/test_counting.py
Step 2. if in the Step 3 of the last section, you have change /core/management/_init_.py, please return back the file to the original version.