30 lines
619 B
Python
30 lines
619 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)
|
|
|