import socket from enum import Enum from bs4 import BeautifulSoup from django.db import models from ordered_model.models import OrderedModel class ServiceStatus(Enum): OK = 'ok' DOWN = 'down' UNKNOWN = 'unknown' class Service(OrderedModel): short_name = models.CharField(null=False, max_length=64) image = models.ImageField(null=True, blank=True, upload_to='services') description = models.TextField(null=True, blank=True) port = models.IntegerField(null=True, blank=True, help_text="Used for checking status") url = models.URLField() def __str__(self): return f"{self.short_name} ({self.url})"