Skip to content

Instantly share code, notes, and snippets.

@jayhale
Last active March 12, 2019 21:28
Show Gist options
  • Save jayhale/dee47d8b285fae2e813256fa99e9f104 to your computer and use it in GitHub Desktop.
Save jayhale/dee47d8b285fae2e813256fa99e9f104 to your computer and use it in GitHub Desktop.
Django on Zeit Now: now-django-example/example_app/views.py
# now-django-example/example_app/views.py
from datetime import datetime
from django.http import HttpResponse
def index(request):
now = datetime.now()
html = f'''
<html>
<body>
<h1>Hello from Zeit Now!</h1>
<p>The current time is { now }.</p>
</body>
</html>
'''
return HttpResponse(html)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment