Skip to content

Setting up RMG website

Max Liu edited this page Jun 30, 2016 · 12 revisions

You should have RMG-Py already installed.

Clone the RMG-website repo into your local folder.

The following command will update your rmg_env environment with the necessary packages for RMG-website

source activate rmg_env
cd RMG-website
conda env update

You may need to update django to 1.8.5 manually because we only have 1.8.4 on the anaconda channel:

pip install django==1.8.5

If running the website for the first time, enter the commands

cd RMG-website
python manage.py syncdb
python manage.py runserver

Now the website should appear on your localhost, you can visit it in any browser using the url: http://127.0.0.1:8000/

When you rebuild any Model class within a models.py file, you have to recreate the sql tables. Which is a huge pain and a bigger pain now that we upgraded to django 1.8.5.

First rebuild the sql database for that module. For instance if you changed rmgweb/rmg/models.py, the module name is rmg.

  1. Generate sql commands for dropping the tables:

    python manage.py sqlclear rmg
    
  2. Copy the section starting with BEGIN and ending with COMMIT.

  3. Start the database shell:

    python manage.py dbshell
    
  4. Paste the copied commands, then use CRTL+D to exit.

  5. Regenerate the tables and start the server:

    python manage.py syncdb
    python manage.py runserver