Show server hostname

This commit is contained in:
Rodolfo Carvalho 2015-05-24 13:56:43 +02:00
parent 0bb02a4c0f
commit ab4b961cb5
2 changed files with 9 additions and 3 deletions

View file

@ -10,8 +10,7 @@
body>div { border-bottom:1px solid #ddd; } body>div { border-bottom:1px solid #ddd; }
h1 { font-weight:normal; } h1 { font-weight:normal; }
code { background: #ffd; } code { background: #ffd; }
#summary { background: #34383c; } #summary, #hostname { background: #34383c; color: #fff; }
#summary h1 { color: #fff; }
#explanation { background:#eee; } #explanation { background:#eee; }
#instructions { background:#f6f6f6; } #instructions { background:#f6f6f6; }
#instructions ol li { margin: 0.2em 0 0.2em 2em; } #instructions ol li { margin: 0.2em 0 0.2em 2em; }
@ -47,4 +46,10 @@
before taking this project into a production environment. before taking this project into a production environment.
</p> </p>
</div> </div>
<div id="hostname">
<p>
Server hostname: {{ HOSTNAME }}
</p>
</div>
</body></html> </body></html>

View file

@ -1,6 +1,7 @@
import os
from django.shortcuts import render from django.shortcuts import render
# Create your views here. # Create your views here.
def index(request): def index(request):
return render(request, 'openshift/index.html') return render(request, 'openshift/index.html', {'HOSTNAME': os.getenv('HOSTNAME', 'unknown')})