In order to be able to run Labbi on you local computer, you will need to follow the steps below.
- Download the repository to a folder.
- Download and install Python 3.7.
- Download and install Django version 2.1.5+
- Download and install MySQL 8 and configure a root user.
- Download and install the following Python modules, for example using pip:
- django-tables2
- django-filter
- django-crispy-forms
- django-composite-fields
- django-registration
- django-recaptcha
-
Open the terminal and log in to MySQL as a root user using the following command:
mysql -u root -p
Within MySQL, create a user and database. Here are example commands for each1:
CREATE USER 'USER'@'localhost' IDENTIFIED BY 'PASSWORD'; GRANT ALL PRIVILEGES ON *.* TO 'USER'@'localhost' WITH GRANT OPTION;
Then exit MySQL.
-
Open the terminal and navigate to the folder where you downloaded the repository. Go into the lims_project folder which contains the manage.py file. From here, run the following commands:
python3 manage.py makemigrations python3 manage.py migrate python3 manage.py createsuperuser
The first two commands will migrate the database structure defined in the Django code to the MySQL server. The third command will create an admin account for the Labbi.
-
Create a file called database_config.py in the InfoManagementSystems/lims_project/labbyims folder and include the following code:
database_name="YOUR_DB_NAME" database_user="USER" database_password="PASSWORD" email = "YOUR_EMAIL email_password="YOUR_PASSWORD"
-
Finally, in order to start the server, run the followin command in the same directory:
python3 manage.py runserver
The website can then be accessed at localhost:8000
[1]: If the code above does not work, try this one instead:
create user USER@localhost identified by 'PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO USER@localhost WITH GRANT OPTION;