How to Run any Django project with some dependencies.
I want to run a django Project Outcome Based Course on my local system and this blog is all about my error less path to run an django project.
OutcomeBasedCourse is an open-source project that helps educators and academic institutions to manage their courses and outcomes. In this blog post, we’ll go over the steps to run the OutcomeBasedCourse project on your localhost.
Prerequisites
Before we begin, make sure you have the following prerequisites installed on your machine:
- Python 3
- MySQL Server
- Git
Step 1: Clone the Project
First, open your terminal and clone the OutcomeBasedCourse project by running the following command:
Enter your MySQL root password when prompted. Once you’re logged in to MySQL, run the following command to create a new database:
git clone https://github.com/GreatDevelopers/OutcomeBasedCourse
This will download the project files to your current directory.
Step 2: Install Dependencies
Next, navigate to the project directory and install all the dependencies by running the following command:
cd OutcomeBasedCourse
Now you will find setup.sh in your current Directory.
sudo chmod +x setup.sh
./setup.sh
Step 3: Create a MySQL Database
We’ll now create a MySQL database for the project. Run the following command to log in to MySQL as root:
mysql -u root -p -A
Enter your MySQL root password when prompted. Once you’re logged in to MySQL, run the following command to create a new database:
create database outcomebasedcourse;
Step 4: Configure the Database Settings
Next, open the settings.py
file located at OutcomeBasedCourse/OutcomeBasedCourse/settings.py
in your favorite text editor. Scroll down to the DATABASES
section and replace the values for NAME
, HOST
, PORT
, USER
, and PASSWORD
with the details of your MySQL database. Here's an example:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "outcomebasedcourse",
"HOST": "localhost",
"PORT": "3306",
"USER": "root",
"PASSWORD": "your_password",
}
}
Step 5: Run Migrations
We’ll now run the migrations to create the necessary tables in the database. Run the following command in your terminal:
python manage.py makemigrations
python manage.py migrate
Step 6: Start the Server
We’re now ready to start the server. Run the following command:
python manage.py runserver 127.0.0.1:8090
This will start the server at http://127.0.0.1:8090/
. Open your web browser and navigate to this URL to see the OutcomeBasedCourse homepage.
Conclusion
In this blog post, we went over the steps to run the OutcomeBasedCourse project on your localhost. With these steps, you should now be able to run the project and start using it to manage your courses and outcomes. If you encounter any issues, feel free to refer to the project documentation or reach out to me for support.