Add Project Files

This commit is contained in:
2022-06-20 13:41:51 +03:00
parent a5aecd6dda
commit 09e209b988
24 changed files with 388 additions and 51 deletions

23
hosts/views.py Normal file
View File

@@ -0,0 +1,23 @@
from django.urls import reverse_lazy
from django.views.generic import ListView, DetailView
from django.views.generic.edit import CreateView
from .models import Host
class Index(ListView):
model = Host
template_name = 'index.html'
paginate_by = 10
class HostCreate(CreateView):
model = Host
fields = ['host_name', 'port']
template_name = 'add_host.html'
success_url = reverse_lazy('index')
class HostDetail(DetailView):
model = Host
template_name = 'host_info.html'