Skip to content

Latest commit

 

History

History
91 lines (61 loc) · 2.31 KB

README.md

File metadata and controls

91 lines (61 loc) · 2.31 KB

WebVirtBackend

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.

Getting Started

Prerequisites

  • Docker
  • Docker Compose

Installation

  1. Clone the repository
git clone https://github.com/webvirtcloud/webvirtbackend.git
  1. Change into the cloned directory:
cd webvirtbackend
  1. Build the Docker image:
docker compose build
  1. Run the Docker container:
docker compose up -d
  1. Run the database migrations:
docker compose exec backend python3 manage.py migrate
  1. Load the initial data:
docker compose exec backend python3 manage.py loaddata initial_data
  1. Load admin user:
docker compose exec backend python3 manage.py loaddata account/fixtures/admin.json
  1. Access the admin site: Open your web browser and go to http://localhost:8000/admin. You can log in with the following credentials:

Settings

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.

Development

Load the test user:

docker compose exec backend python3 manage.py loaddata account/fixtures/user.json

Swagger

The Swagger API documentation is available at http://localhost:8000/swagger/.

Credntials

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: [email protected]
  • Password: 1qaz2wsx
  • Token: fcc69bfad35527d087bf22a8a84a4f6c3b75387877c78ae3050e9e8036ef

Example API requests:

curl -H "Authorization: Bearer fcc69bfad35527d087bf22a8a84a4f6c3b75387877c78ae3050e9e8036ef" http://localhost:8000/api/v1/virtances/

Contributing

If you want to contribute to WebVirtBackend, please read the contributing guidelines first (Coming soon).

License

WebVirtBackend is released under the Apache 2.0 Licence.