transport-accessibility/transport_accessibility/pt_map/views.py
Johannes Randerath 53ab731787 Cookies and tests
- Added cookie banner
- Improved tests and fixed models accordingly
2024-07-03 01:18:17 +02:00

31 lines
631 B
Python

"""
Views
=====
Views serving browser viewable, HTML web pages.
Functions
---------
index
Home page
"""
from django.shortcuts import render
from . import query
import json
def index(request):
"""
Home page view serving the default index page.
Context
-------
"Stops": Json Representation of all stops found in the database
"Routes": Json Representation of all routes found in the database
"""
context = {
"stops": json.dumps(query.get_all_stops()),
"routes": json.dumps(query.get_all_routes()),
}
return render(request, "map.html", context)