This project provides a Django REST Framework-based API for managing companies and employees. It allows CRUD operations on companies and employees, with a relationship between companies and their employees.
- CRUD operations on companies and employees
- Relationship management between companies and employees
- Django REST Framework-based for easy API development
- Supports SQLite or other databases
If your project is already in an existing Python3 virtual environment, first install Django and Django REST Framework by running:
$ pip install django djangorestframework
Then, clone the repository and follow the setup steps below:
$ git clone https://github.com/MuhammadZeeshan2/company-employee-crud-api.git
$ cd companyapi
This assumes that python3 is linked to a valid installation of Python 3 and that pip is installed.
If you don't have Django installed for Python 3, run:
$ pip3 install django djangorestframework
Clone the repository:
$ git clone https://github.com/MuhammadZeeshan2/company-employee-crud-api.git
$ cd companyapi
After that, install the local dependencies, run migrations, and start the server.Follow the commands given below for these previously mentioned actions.
-
Create the virtual environment:
python -m venv .env
-
Activate the virtual environment:
.env\Scripts\activate
-
Create the virtual environment:
python3 -m venv .env
-
Activate the virtual environment:
source .env/bin/activate
$ pip install -r requirements.txt
$ python manage.py makemigrations
$ python manage.py migrate
$ python manage.py runserver
You can now interact with the API at:
http://127.0.0.1:8000/api/v1/
