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




def MainPage(request):

    from ReferenceDataApp.funcs import parse_data, search_cities_in_db, search_airports_in_db
    res = search_airports_in_db('ang')
    res = parse_data()

    page = StaticPage.objects.get(url='main')

    Dict = {
        'page': page,
        'FAQ': page.FAQ_items.filter(enable=True)
    }

    breadcrumbs_Dict = {
    }
    Dict.update({'breadcrumbs': breadcrumbs_Dict})

    t = loader.get_template('pages/p_main.html')
    return HttpResponse(t.render(Dict, request))


