- Ensure you have Python installed on your machine. If not, you can download it from here.
- Please ensure that the frontend server is already running. Follow the instructions in the frontend repository: blog-app-frontend.
First, clone the backend repository by running the following command in your terminal:
git clone https://github.com/trungnhanforwork/blog-app-api.gitNext, navigate into the backend directory using the following command:
cd blog-app-apiCreate a virtual environment using the following command:
python -m venv menvThis command will create a directory named menv containing the virtual environment in the blog-app-api directory.
Activate the virtual environment using the following command:
menv\Scripts\activateOnce the virtual environment is activated, install the required packages by running:
pip install -r requirements.txtNext, navigate into the project directory using the following command:
cd blogprojectMigrate the database by running the following command:
python manage.py makemigrations
python manage.py migrateCreate a superuser by running the following command and following the prompts:
python manage.py createsuperuserFinally, to run the backend server, execute the following command:
python manage.py runserver- The backend project will be running locally on port 8000 at http://localhost:8000/.
- The admin panel will be available at http://localhost:8000/admin.