Skip to content
Mathieu Rampant edited this page Aug 19, 2022 · 18 revisions

For Windows Users, it is recommended to install all the programs as Administrator

Download and Install Python

  1. Check if you have Python (3.6+) installed by running python --version
  2. If you don't have python on your system, download the latest version on Python's Website
  3. Install it. Make sure to check "Add Python to PATH" on Windows

Download and Install Git

  1. Check if you have git installed by running git --version
  2. If you don't have it already, install Git using apt-get install git, dnf install git or yum install git. If you are running MacOS, simply run git --version and it should prompt you to install it If you are running Windows, I recommend installing git bash

Download and Install Pycharm

  1. Go to Pycharm Download Page
  2. Download the right version of Pycharm for your system
  3. Install it

Checkout NEMO github

  1. Start Pycharm and select "Checkout from Version Control", then select "Git"
  2. Use the following parameters:
  • URL: https://github.com/usnistgov/NEMO.git
  • Directory: <the directory where you want NEMO's code to be>
  1. The code should now be downloaded and the project should be available in Pycharm

Add Python Interpreter for NEMO

  1. Go to "File -> Settings" (windows) or "Pycharm -> Preferences" on MacOS
  2. Go to "Project: NEMO -> Project Interpreter"
  3. Click on "No Interpreter" then "Show All..."
  4. Click on "+" to create a new interpreter.
  5. Select "Virtualenv Environment". Base Interpreter should be already selected as the version you installed in step 1
  6. Click "Ok"

Create Settings for NEMO

  1. In the left side panel, right click on the second NEMO folder (NEMO -> NEMO) and select "New -> Python File"
  2. Enter the name settings and confirm.
  3. In the settings.py file, if you see a notification to install package requirements, do it.
  4. In settings.py, paste the settings from Settings
  5. Make sure you have in settings.py:
    • import os
    • BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    • DEBUG = True
    • 'NEMO.middleware.RemoteUserAuthenticationMiddleware' is in middleware
    • Uncomment AUTHENTICATION_BACKENDS = ['NEMO.views.authentication.RemoteUserAuthenticationBackend']
    • ALLOWED_HOSTS = ['localhost']
    • use file email backend with EMAIL_FILE_PATH = os.path.join(BASE_DIR, 'email_sink/')
    • database with name 'NAME': os.path.join(BASE_DIR, 'nemo.db'),
    • STATIC_ROOT = os.path.join(BASE_DIR, 'static')
    • MEDIA_ROOT = os.path.join(BASE_DIR, 'resources/icons')
    • for file logging, use "filename": os.path.join(BASE_DIR, "nemo.log"),
    • for error_file logging, use "filename": os.path.join(BASE_DIR, "nemo_error.log"),

Initialize NEMO and populate database

  1. in the bottom of the Pycharm IDE, click "Terminal"
  2. execute pip install . (this step can take several minutes)
  3. execute cd NEMO then python manage.py migrate
  4. execute python manage.py loaddata ../resources/fixtures/splash_pad.json

Start NEMO

  1. In the top right corner of Pycharm, click "Add Configuration..."
  2. Click "+" and select "Python", then enter the following:
  • "Name": start nemo
  • "Script Path": manage.py
  • "Parameters": runserver localhost:8000
  1. In "Environment Variables", add REMOTE_USER key and value captain
  2. In "working directory", select the second NEMO folder (NEMO/NEMO)
  3. Click "Apply"

You can now run your saved configuration and access NEMO at http://localhost:8000

If you want to login as someone else, simply change the REMOTE_USER environment variable to another username (like "ned" or "professor")