This project is a Django-based REST API for managing company-related data. It is structured as a Django project named companyapi with an api app that contains the main business logic, models, serializers, and views.
DjangoApis/
└── companyapi/
├── db.sqlite3 # SQLite database file
├── manage.py # Django management script
├── api/ # Main app for API logic
│ ├── models.py # Database models
│ ├── serializers.py # Serializers for API
│ ├── views.py # API views
│ ├── urls.py # API URL routes
│ ├── admin.py # Admin site configuration
│ ├── tests.py # Unit tests
│ └── migrations/ # Database migrations
└── companyapi/ # Project settings
├── settings.py # Django settings
├── urls.py # Project URL routes
├── wsgi.py # WSGI entry point
└── asgi.py # ASGI entry point
- Python 3.8+
- Django (recommended: latest stable version)
-
Clone the repository (if not already):
git clone <your-repo-url> cd DjangoApis/companyapi
-
Create a virtual environment (optional but recommended):
python -m venv venv .\venv\Scripts\activate -
Install dependencies:
pip install django
-
Apply migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
The API will be available at
http://127.0.0.1:8000/. -
Create a superuser (optional, for admin access):
python manage.py createsuperuser
- Access the API endpoints as defined in
api/urls.py. - Use the Django admin at
http://127.0.0.1:8000/admin/to manage data if you created a superuser.
To run tests:
python manage.py test- Modify
api/models.pyto change or add database models. - Update
api/serializers.pyandapi/views.pyto adjust API logic. - All configuration is in
companyapi/settings.py.
For more information, see the Django documentation.