Merge remote-tracking branch 'origin/master'
This commit is contained in:
1
grandnational-dashboard/.gitignore
vendored
1
grandnational-dashboard/.gitignore
vendored
@@ -139,6 +139,7 @@ dmypy.json
|
||||
|
||||
# ignore video
|
||||
*static/assets/videos/gn19-short.mp4
|
||||
*static/font-awesome
|
||||
|
||||
# ignore docker files
|
||||
*docker-images
|
||||
|
||||
34
grandnational-dashboard/grandnational_dashboard/dashboard.py
Normal file
34
grandnational-dashboard/grandnational_dashboard/dashboard.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from starlette.applications import Starlette
|
||||
from starlette.templating import Jinja2Templates
|
||||
from starlette.routing import Route, Mount
|
||||
from starlette.staticfiles import StaticFiles
|
||||
|
||||
|
||||
templates = Jinja2Templates(directory='templates')
|
||||
|
||||
|
||||
async def home(request):
|
||||
print(request.__dict__['scope']['headers'])
|
||||
for a, b in request.__dict__['scope']['headers']:
|
||||
print(a)
|
||||
return templates.TemplateResponse(
|
||||
'index.html',
|
||||
{'request': request},
|
||||
)
|
||||
|
||||
routes = [
|
||||
Route('/', endpoint=home),
|
||||
Mount('/static', StaticFiles(directory='../static'), name='static'),
|
||||
Mount(
|
||||
'/node_modules',
|
||||
StaticFiles(directory='../node_modules'),
|
||||
name='node_modules',
|
||||
),
|
||||
Mount(
|
||||
'/bower_components',
|
||||
StaticFiles(directory='../bower_components'),
|
||||
name='bower_components',
|
||||
),
|
||||
]
|
||||
|
||||
app = Starlette(debug=True, routes=routes)
|
||||
Reference in New Issue
Block a user