Skip to content

Getting Started

Paul Coen edited this page Mar 18, 2018 · 10 revisions

(commands are assuming Ubuntu. translate apt-get and systemctl to the equivalents for other distros)
(I likely forgot some things, please add on)

Requirements

Python 3.6 sudo apt-get install python3
MySQL: sudo apt-get install mysql-server * Will prompt for a root password while setting up, this is optional
Pip: sudo apt-get install python3-pip

Django my complain without these:
sudo apt-get install libmysqlclient-dev
pip3 install mysqlclient

Run sudo pip3 install -r requirements.txt in the root directory of the project to automatically install all required python libraries

Database

Enable and start mysql server:
sudo systemctl enable mysqld
sudo systemctl start mysqld

Run mysql: sudo mysql -u root -p
Create database in mysql: CREATE DATABASE BlueDawnAnalysis; Run migrations (initialize the database): ./manage.py migrate (May have to run sudo python3 manage.py migrate instead)

Database settings are contained in the file website/settings.py. Here you can change any information that is needed for you locally, like password for mysql. (Make sure you don't commit your password!)

Running the Server

./manage.py runserver: Run the server. Website can be accessed on 127.0.0.1:8000 or localhost:8000.
(Similar to above, you may need to run sudo python3 manage.py runserver) ./managepy createsuperuser: Create a superuser account on the website. (May also apply to this(sudo python3 manage.py createsuperuser), although that is untested)

Importing Data

You will need first login to the admin page (127.0.0.1:8000/admin) Then enter the credentials on the user you made and login Now you can upload data! 👍

Clone this wiki locally