This repository contains the source code that powers the RMG website, which runs at http://rmg.mit.edu/. The RMG website itself uses the Django web framework.
If you only wish to use the RMG website, no setup is required! Simply point your favorite web browser to http://rmg.mit.edu/ to get started. Some parts of the web site require that Javascript be enabled.
Running RMG-website requires a working installation of RMG-Py. Development of the website closely mirrors that of RMG-Py, and you will generally need to update the RMG-Py repository whenever you update this repository.
Clone the RMG-website
repo into your local folder.
The following command will update your rmg_env
environment and install the necessary packages for RMG-website
cd RMG-website
conda env update -f environment.yml
pip install git+https://github.com/bp-kelley/descriptastorus
In order to get the webserver running, you must first create a secretsettings.py
file.
This file is intended to hold settings that are specific to a particular installation.
An example file is provided in rmgweb/secretsettings.py.example
.
Make a copy of that file named secretsettings.py
.
Django uses a secret key for cryptographic signing, which is set in secretsettings.py
.
A dummy key is provided in the example file, which will work for basic use.
For production environments, it is strongly recommended to generate a custom key.
Instructions to generate a key using Python are provided in the example file, or you can use an online tool.
You also need to add '127.0.0.1'
to ALLOWED_HOSTS
in secretsettings.py
to run RMG-website locally.
If running the website for the first time, enter the commands
cd RMG-website
python manage.py migrate
python manage.py runserver
You may be prompted to create a superuser account, which you will need to access admin features on the website.
Now the website should appear on your localhost, you can visit it in any browser using the URL: http://127.0.0.1:8000/. The website may take some time to load, as the RMG database must be loaded from the disk every time the webserver is restarted.
When you rebuild any Model
class within a models.py file, you have to modify the sql tables via Django's migration model.
This can be done as follows:
-
In the
RMG-website
directory, run:python manage.py makemigrations python manage.py migrate python manage.py collectstatic --clear --noinput
-
If in a development environment, commit these migrations along with your other changes. This is not needed in production.
- Professor William H. Green's research group at the Massachusetts Institute of Technology
- Professor Richard H. West's research group at Northeastern University
Please post any issues you may have to the issues page or email rmg_dev@mit.edu if you have questions.