This is a Django application for the Data Analysis tools of the Aditya-L1 Science Support Cell (website).
- LINUX or MacOS operating system with Git installed
- Python version >= 3.6 (i.e. often present by default on above systems and is accessible in terminal as
python3
) - MySQL v5.7 (follow installation guide in MySQL docs)
-
Clone the repository to your machine:
git clone https://github.com/aries-res/al1ssc-tools.git cd al1ssc-tools
-
Create a python virtual environment named
env
(since it's already gitignored), activate it, and install all dependencies of the project:python3 -m venv env source env/bin/activate pip install -r requirements.txt
-
Launch the MySQL command-line client in your terminal and create a new empty database that will be used with this project. Exit the MySQL client.
-
Setup environment variables necessary to run the project:
-
Copy the contents of
.env.example
in a.env
file at the root of project. -
In the
.env
file, set the value ofSECRET_KEY
to a random string. It's recommended to generate it by running following command in your terminal:python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
-
Set the
DATABASE_NAME
to the name of database you created earlier andDATABASE_USER
,DATABASE_PASSWORD
to username, password you used to create database respectively. -
(Optional) You can change the value of
DEBUG
andALLOWED_HOSTS
as per your needs.
-
-
Open the Django project directory
al1ssc_tools
and apply all of the database migrations:cd al1ssc_tools python manage.py migrate
-
Create an admin user (for 1st time only) who can acess the admin site:
python manage.py createsuperuser
You'll be prompted for a username, email id and password to create the account. Keep a note of them for future logins.
-
Run the development server of the project (with auto-reload enabled):
python manage.py runserver
This will start the server at http://localhost:8000 (unless you specified another port).
-
Go to http://127.0.0.1:8001/admin in your browser to open the admin site. Click on the "Bodies" model and add new bodies by filling all the input fields. Then you can make changes in Django views logic and open the associated URL to see the effect.
To learn about all the things you can do, visit Django documentation.