django-ex/openshift/views.py
2015-05-25 20:54:23 +02:00

14 lines
351 B
Python

import os
from django.shortcuts import render
from .models import PageView
# Create your views here.
def index(request):
hostname = os.getenv('HOSTNAME', 'unknown')
PageView.objects.create(hostname=hostname)
return render(request, 'openshift/index.html', {
'hostname': hostname,
'count': PageView.objects.count()
})