Getting Started with the TOM Toolkit¶
So you’ve decided to run a Target Observation Manager. This article will help you get started.
The TOM Toolkit is a Django project. This means you’ll be running an application based on the Django framework when you run a TOM. If you decide to customize your TOM, you’ll be working in Django. You’ll likely need some basic understanding of python and we recommend all users work their way through the Django tutorial first before starting with the TOM Toolkit. It doesn’t take long, and you most likely won’t need to utilize any advanced features.
Ready to go? Let’s get started.
The TOM toolkit requires Python >= 3.7
If you are using Python 3.6 and cannot upgrade to 3.7, install the
pip install dataclasses
Installing the TOM Toolkit and Django¶
First, we recommend using a virtual environment for your project. This will keep your TOM python packages seperate from your system python packages.
python3 -m venv tom_env/
Now that we have created the virtual environment, we can activate it:
You should now see
(tom_env) prepended to your terminal prompt.
Now, install the TOM Toolkit:
pip install tomtoolkit
…and create a new project, just like in the tutorial:
django-admin startproject mytom
You should now have a fully functional standard Django installation
mytom folder, with the TOM dependencies installed as
Getting started with the
We need to add the
tom_setup app to our project’s
INSTALLED_APPS. Locate the
settings.py file inside your project
directory (usually in a subdirectory of the main folder,
i.e. mytom/mytom/settings.py) and edit it so that it looks like this:
INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'tom_setup', ]
Run the setup script¶
tom_setup app contains a script that will bootstrap a new TOM in
your current project. Run it:
The install script will ask you a few questions and then install your TOM.
Running the dev server¶
Now that the toolkit is installed, you’re ready to try it out!
First, run the necessary migrations:
Now, start the dev server:
Your new TOM should now be running on http://127.0.0.1:8000!