2015-05-24 13:56:43 +02:00
|
|
|
import os
|
2015-05-24 13:10:47 +02:00
|
|
|
from django.shortcuts import render
|
2015-05-25 20:57:28 +02:00
|
|
|
from django.conf import settings
|
2015-05-24 13:10:47 +02:00
|
|
|
|
2015-05-29 17:14:34 +02:00
|
|
|
from . import database
|
2015-05-25 16:12:22 +02:00
|
|
|
from .models import PageView
|
|
|
|
|
2015-05-24 13:10:47 +02:00
|
|
|
# Create your views here.
|
|
|
|
|
|
|
|
def index(request):
|
2015-05-25 16:12:22 +02:00
|
|
|
hostname = os.getenv('HOSTNAME', 'unknown')
|
|
|
|
PageView.objects.create(hostname=hostname)
|
2015-05-25 20:57:28 +02:00
|
|
|
|
2015-05-29 12:23:59 +02:00
|
|
|
return render(request, 'welcome/index.html', {
|
2015-05-25 20:54:23 +02:00
|
|
|
'hostname': hostname,
|
2015-05-29 17:14:34 +02:00
|
|
|
'database': database.info(),
|
2015-05-25 16:12:22 +02:00
|
|
|
'count': PageView.objects.count()
|
|
|
|
})
|