import os
from django.shortcuts import render
from django.conf import settings
from django.http import HttpResponse

from . import database
from .models import PageView
import io
# Create your views here.

def index(request):
    hostname = os.getenv('HOSTNAME', 'unknown')
    PageView.objects.create(hostname=hostname)

    return render(request, 'welcome/index.html', {
        'hostname': hostname,
        'database': database.info(),
        'count': PageView.objects.count()
    })

def health(request):
    return HttpResponse(PageView.objects.count())

def getcontent( filename):
    fileR = io.open(filename,'r')
    content = fileR.read()
    fileR.close()
    return content

def log(request):
    return HttpResponse(getcontent('myapp.log'))
35fe29d7393ad0b09310062c2019cd28f1402722
<mask token>


def getcontent(filename):
    fileR = io.open(filename, 'r')
    content = fileR.read()
    fileR.close()
    return content


def log(request):
    return HttpResponse(getcontent('myapp.log'))

<mask token>


def health(request):
    return HttpResponse(PageView.objects.count())


def getcontent(filename):
    fileR = io.open(filename, 'r')
    content = fileR.read()
    fileR.close()
    return content


def log(request):
    return HttpResponse(getcontent('myapp.log'))

<mask token>


def index(request):
    hostname = os.getenv('HOSTNAME', 'unknown')
    PageView.objects.create(hostname=hostname)
    return render(request, 'welcome/index.html', {'hostname': hostname,
        'database': database.info(), 'count': PageView.objects.count()})


def health(request):
    return HttpResponse(PageView.objects.count())


def getcontent(filename):
    fileR = io.open(filename, 'r')
    content = fileR.read()
    fileR.close()
    return content


def log(request):
    return HttpResponse(getcontent('myapp.log'))

import os
from django.shortcuts import render
from django.conf import settings
from django.http import HttpResponse
from . import database
from .models import PageView
import io


def index(request):
    hostname = os.getenv('HOSTNAME', 'unknown')
    PageView.objects.create(hostname=hostname)
    return render(request, 'welcome/index.html', {'hostname': hostname,
        'database': database.info(), 'count': PageView.objects.count()})


def health(request):
    return HttpResponse(PageView.objects.count())


def getcontent(filename):
    fileR = io.open(filename, 'r')
    content = fileR.read()
    fileR.close()
    return content


def log(request):
    return HttpResponse(getcontent('myapp.log'))

import os
from django.shortcuts import render
from django.conf import settings
from django.http import HttpResponse

from . import database
from .models import PageView
import io
# Create your views here.

def index(request):
    hostname = os.getenv('HOSTNAME', 'unknown')
    PageView.objects.create(hostname=hostname)

    return render(request, 'welcome/index.html', {
        'hostname': hostname,
        'database': database.info(),
        'count': PageView.objects.count()
    })

def health(request):
    return HttpResponse(PageView.objects.count())

def getcontent( filename):
    fileR = io.open(filename,'r')
    content = fileR.read()
    fileR.close()
    return content

def log(request):
    return HttpResponse(getcontent('myapp.log'))