Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
from django.shortcuts import render
from django.http import HttpResponse
from app.home.models import Posts
from django.views import View
from django.views.generic import DetailView
from django.shortcuts import get_object_or_404
class Home(View):
template_name = 'home/index.html'
def get(self, request, *args, **kwargs):
context = {}
context['title'] = 'Afya-connect'
context['objects'] = Posts.objects.filter(active=True)
return render(request, self.template_name, context)
class AboutUs(View):
template_name = 'home/about_us.html'
def get(self, request, *args, **kwargs):
context = {}
context['title'] = 'About Us'
return render(request, self.template_name, context)
class Team(View):
template_name = 'home/team.html'
def get(self, request, *args, **kwargs):
context = {}
context['title'] = 'Team'
return render(request, self.template_name, context)
class Blog(View):
template_name = 'home/blog.html'
def get(self, request, *args, **kwargs):
context = {}
context['title'] = 'Blog'
context['objects'] = Posts.objects.filter(active=True)
return render(request, self.template_name, context)
class ContactUs(View):
template_name = 'home/contact_us.html'
def get(self, request, *args, **kwargs):
context = {}
context['title'] = 'Contact Us'
return render(request, self.template_name, context)
class Artical(DetailView):
model = Posts
def get_object(self):
return get_object_or_404(Posts, pk=self.kwargs['pk'], active=True)
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['title'] = 'Post'
return context