3015a46f9a
Support for MySQL, include SQLite persistence warning.
18 lines
443 B
Python
18 lines
443 B
Python
import os
|
|
from django.shortcuts import render
|
|
from django.conf import settings
|
|
|
|
from . import database
|
|
from .models import PageView
|
|
|
|
# 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()
|
|
})
|