This is a basic Django project that serves a app in which you can have user and post.
These instructions will help you set up and run the project on your local machine for development purposes.
- Clone this repository to your local machine:
git clone https://github.com/srinivaskstpl/backend-assignment.git
cd backend-assignment
Before you begin, make sure you have the following software installed on your system:
- Create a virtual environment to isolate project dependencies:
python -m venv /path/to/new/virtual/environment
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
-
Install project dependencies using pip:
pip install -r requirements.txt
Before running data base migration make sure
you have created backendassignment
project
in your postgres db.
- Apply initial database migrations:
python manage.py migrate
- You can create a superuser by below command:
python manage.py createsuperuser
- Start the development server:
python manage.py runserver
The development server should now be running at http://localhost:8000/
.
- Access the Django admin panel at
http://localhost:8000/admin/
and log in with the admin credentials.
To run the project using docker follow the following steps.
- Build the Docker image using the following command:
docker build -t django-app .
- Run the container using the following command:
docker run -p 8000 --net="host" django-app
Postman collection JSON is added in repository you can import the file in postman