transport-accessibility/transport_accessibility/pt_map/views.py
Johannes Randerath 80197208f8 PUT, DELETE and address Changes
- Added PUT, PATCH and DELETE to modify data in the database.
- refactored modules
- completed docstrings
- data is now served via api/ and web pages via /
2024-06-20 23:25:33 +02:00

30 lines
618 B
Python

"""
Views
=====
Views serving browser viewable, HTML web pages.
Functions
---------
index
Home page
"""
from django.shortcuts import render
from . import query
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)