35 lines
955 B
Python
35 lines
955 B
Python
import json
|
|
|
|
from django.http import HttpResponse, Http404, FileResponse
|
|
from django.template import loader, RequestContext
|
|
from django.contrib.auth.decorators import login_required
|
|
from .models import *
|
|
from django.conf import settings
|
|
from GeneralApp.funcs import get_inter_http_respose
|
|
|
|
def section_view(request, url):
|
|
|
|
try:
|
|
page = Section.objects.get(url=url)
|
|
|
|
|
|
# from ArticlesApp.models import ArticleModel
|
|
# arts = ArticleModel.objects.filter(enable=True).order_by('-createDT')[:4]
|
|
|
|
Dict = {
|
|
'page': page,
|
|
# 'articles': arts,
|
|
}
|
|
|
|
# breadcrumbs_Dict = {
|
|
# }
|
|
# Dict.update({'breadcrumbs': breadcrumbs_Dict})
|
|
|
|
t = loader.get_template('pages/p_section.html')
|
|
return get_inter_http_respose(t, Dict, request)
|
|
|
|
except Exception as e:
|
|
msg = f'section_view Error = {str(e)}'
|
|
print(msg)
|
|
return HttpResponse(msg, status=400)
|