diff --git a/openshift/migrations/0001_initial.py b/openshift/migrations/0001_initial.py new file mode 100644 index 0000000..d607430 --- /dev/null +++ b/openshift/migrations/0001_initial.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='PageView', + fields=[ + ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), + ('hostname', models.CharField(max_length=32)), + ('timestamp', models.DateTimeField(auto_now_add=True)), + ], + ), + ] diff --git a/openshift/models.py b/openshift/models.py index 71a8362..8567d5d 100644 --- a/openshift/models.py +++ b/openshift/models.py @@ -1,3 +1,7 @@ from django.db import models # Create your models here. + +class PageView(models.Model): + hostname = models.CharField(max_length=32) + timestamp = models.DateTimeField(auto_now_add=True) diff --git a/openshift/templates/openshift/index.html b/openshift/templates/openshift/index.html index c634822..a2a3a2a 100644 --- a/openshift/templates/openshift/index.html +++ b/openshift/templates/openshift/index.html @@ -50,7 +50,8 @@
- Server hostname: {{ HOSTNAME }}
+ Server hostname: {{ HOSTNAME }}
+ Page views: {{ count }}