WebVirtBackend is an open-source Django-based backend for managing virtual machines in a KVM (Kernel-based Virtual Machine) environment. It is designed to be used with WebVirtCloud, a web interface for managing virtual machines. This project is packaged as a Docker Compose environment for easy deployment.
- Docker
- Docker Compose
- Clone the repository
git clone https://github.com/webvirtcloud/webvirtbackend.git
- Change into the cloned directory:
cd webvirtbackend
- Build the Docker image:
docker compose build
- Run the Docker container:
docker compose up -d
- Run the database migrations:
docker compose exec backend python3 manage.py migrate
- Load the initial data:
docker compose exec backend python3 manage.py loaddata initial_data
- Access the admin site:
Open your web browser and go to http://localhost:8000/admin
. You can log in with the following credentials:
- Username:
admin@webvirt.cloud
- Password:
admin
You can configure the backend by editing the webvirtcloud/settings/local.py
file for modifying the default settings. The default settings are defined in webvirtcloud/settings/base.py
.
Load the test user:
docker compose exec backend python3 manage.py loaddata account/fixtures/user.json
The Swagger API documentation is available at http://localhost:8000/swagger/
.
The API endpoints are available at http://localhost:8000/api/
. You can use them to create, delete, and manage virtual machines. You can log in with the following credentials:
- Username:
user@webvirt.cloud
- Password:
1qaz2wsx
- Token:
fcc69bfad35527d087bf22a8a84a4f6c3b75387877c78ae3050e9e8036ef
Example API requests:
curl -H "Authorization: Bearer fcc69bfad35527d087bf22a8a84a4f6c3b75387877c78ae3050e9e8036ef" http://localhost:8000/api/v1/virtances/
If you want to contribute to WebVirtBackend, please read the contributing guidelines first (Coming soon).
WebVirtBackend is released under the Apache 2.0 Licence.