Before starting to develop

Read up on techniques and styles used in MANTIS

MANTIS profitted a lot from the advice provided in Two Scoops of Django.

Unless you are an absolute Django expert (and maybe even then), please read Daniel Greenfield’s and Audrey Roy’s excellent Two Scoops of Django. Even though it provides best practices for Django 1.5, most of its advice is also valid for Django 1.6, and likely to be very relevant for quite a few minor revisions to come.

Understand how django-dingos works

The heart of MANTIS is the django-dingos Django application. Most aspects of modifying/adding to MANTIS will require a sound understanding of how django-dingos works. Please refer to the Django DINGOS developers’ guide

Find the right place to modify/add to

Writing your own Django application

If you are adding completely new functionality to Mantis, the best way may very well be to create a new Django application.

Keep django-dingos generic

Although DINGOS is likely to be used mainly in the context of the Django MANTIS Cyber Threat Intelligence Management application, DINGOS should stay a /generic/ application for managing structured information. So whenever you find yourself adding/modifying stuff in DINGOS that is specific to cyber threat intelligence management, the STIX, CybOX standards, etc., DINGOS is the wrong place to modify/add to. The same goes for customizations that are particular to your instance of running MANTIS.

Please consider the following places for development instead:

  • If you want to add Python code that is particular to cyber threat management, consider adding this in django-mantis-core
  • If you want to add Python code that is particular to a certain standard, consider adding it to the respective importer module, e.g., django-mantis-stix-importer or similar
  • If you want to make modifications to a DINGOS template that is required for your local instance of MANTIS (or whatever framework is using DINGOS), the right way is probably to override one of the DINGOS base templates. Have a look at how django-mantis overrides the templates/dingos/grappelli/base.html template; see also the Django documentation on overriding templates.
  • If you want to change the url paths of DINGOS views, do this in the url.py of your instance rather than dingos/url.py.