Open lmangall opened 5 months ago
Implemented SPA structure for the Pong "app",
pong/views.py
index.html
{% load static %}
pong/urls.py
pong
urls.py
app.js
settings.py
It is usefull to see the files that were modified in the commit after Django installation to understand the page organisation and routing
Single Page Application (SPA) structure + real-time interaction using WebSockets.
SPA Structure:
WebSocket Integration:
daphne
pong/consumers.py
routing.py
Real-Time Feature:
start the venv: source venv/bin/activate go into the dir
source venv/bin/activate
eventually collect: python manage.py collectstatic
daphne -p 8000 ft_transcendance_backend.asgi:application
Implemented SPA structure for the Pong "app",
pong/views.py
to serve the main HTML template.index.html
template with Bootstrap and a JavaScript entry point.{% load static %}
at the top of theindex.html
file for static file handling.pong/urls.py
to direct all relevant paths to the SPA entry point.pong
app URLs in the main projecturls.py
.app.js
to handle client-side routing and dynamically update page content.settings.py
to serve JavaScript and CSS files.It is usefull to see the files that were modified in the commit after Django installation to understand the page organisation and routing
Implemented SPA Structure and Real-Time Features
Single Page Application (SPA) structure + real-time interaction using WebSockets.
SPA Structure:
pong/views.py
to serve the main HTML template.index.html
with Bootstrap and JavaScript entry point.pong/urls.py
and integration in the main projecturls.py
.app.js
for client-side routing and dynamic content updates.settings.py
.WebSocket Integration:
daphne
for ASGI support.pong/consumers.py
for real-time interactions.routing.py
.Real-Time Feature:
Usage:
start the venv:
source venv/bin/activate
go into the direventually collect: python manage.py collectstatic
daphne -p 8000 ft_transcendance_backend.asgi:application