-
Notifications
You must be signed in to change notification settings - Fork 43
Running the web app locally
If you are developing the JWQL web app, any changes that you make won't appear on the development, test, or production versions of the web page until your changes are merged. In order to see your changes in real time, you need to start a local server session on your own machine to render your local web app files.
Follow these steps to get a local server session running:
-
Activate your
jwql
virtual environment:conda activate jwql-<version>
-
Navigate to the website directory:
cd jwql/website/
-
If you have not done so already, create appropriate symbolic links that point to static contents located in central storage:
ln -s <path_to_filesystem> apps/jwql/static/filesystem ln -s <path_to_thumbails> apps/jwql/static/thumbnails ln -s <path_to_preview_images> apps/jwql/static/preview_images ln -s <path_to_outputs> apps/jwql/static/outputs
You can ask a JWQL team member for the appropriate paths.
-
Make and apply new migrations for the jwql app to create Django model tables:
python manage.py makemigrations jwql python manage.py migrate
-
Populate the tables with the available static data:
python apps/jwql/archive_database_update.py
This will take some time to run.
-
Make yourself a superuser for your local databases:
python manage.py createsuperuser
Enter 'admin' for the user name, your email address, and a password.
-
Start a local server to run the web app:
python manage.py runserver
-
View the web app in your browser:
http://127.0.0.1:8000
.There should be thumbnails linked to proposal data and images, under the NIRCAM Archived Images link, for example.
-
View the admin interface at:
http://127.0.0.1:8000/admin
.The tables should be populated with the static data from central storage.
If you're not thrilled about having to do this every time you want to launch the website, you can add the following alias to your ~/.bash_profile
(be sure to update the version number and the path to your JWQL repo):
alias launch_jwql='conda activate jwql-<version>; python /path/to/repo/jwql/jwql/website/manage.py runserver'
Then, to launch the web app, just type launch_jwql
in any terminal window. Voilá!