QAGPT-Backend-Django is a Django-based backend application, designed to provide robust and efficient backend services. This application is configured with PostgreSQL for database management and utilizes Python and Poetry for environment setup and package management.
Before setting up the project, ensure you have Python and make
installed on your system. This application requires Python 3.x.
-
Ubuntu/Debian:
sudo apt-get install make
-
macOS:
brew install make
-
Windows:
Installmake
via Chocolatey:choco install make
Install
make
via Scoop:scoop install make
Before running the project, you need to set the following environment variables:
ASSEMBLYAI_API_KEY
: Your AssemblyAI API key.GOOGLE_API_KEY
: Your GoogleGenAI API key.OPENAI_API_KEY
: Your OpenAI API key.
Poetry is used for managing dependencies in a more efficient way. Install it using the following commands:
Note: python - is the Python binary. Change python to whatever Python is called in your system.
-
Linux/Unix:
curl -sSL https://install.python-poetry.org | python -
-
Windows:
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
WeasyPrint is used for PDF generation. Install its dependencies, GTK and Pango, as described in the WeasyPrint documentation.
This application uses PostgreSQL as its database. Install PostgreSQL and configure the database credentials in autoqa/settings.py
.
Follow these steps to get the application running:
-
Install dependencies:
make install
-
Activate the poetry shell:
make shell
-
Setup database migrations:
make migrations
-
Run the server:
make run
Optionally, you can run the server on port 8000:
make run-exposed
-
Access the Django Admin Panel at
localhost:8000/admin
. If hosted, use[hostname]:[port]/admin
. -
For API documentation, visit:
- Swagger UI:
localhost/api/schema/docs
or[hostname]:[port]/api/schema/docs
- ReDoc:
localhost/api/schema/redoc
or[hostname]:[port]/api/schema/redoc
- Swagger UI:
-
Black is used as the autoformatting solution. Run it using:
make format
-
Flake8 is used for linting. Run it using:
make lint
- Implement 2FA with django-two-factor-auth
- Implement and configure unit tests.
This project was developed by Yudhajit Sinha. For more information or inquiries, please contact yudhajitsinha@outlook.com.