This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| html | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Dashboard</title> | |
| <script src="https://unpkg.com/htmx.org"></script> | |
| </head> | |
| <body> | |
| <h1>Welcome to the Mind Upload Dashboard</h1> | |
| <button hx-post="/process-task/" hx-trigger="click" hx-swap="outerHTML">Initiate Mind Upload</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bash | |
| django-admin startproject core . | |
| python manage.py startapp sim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bash | |
| pip install django requests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd sam-app | |
| sam local start-api |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| python manage.py runserver |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html xmlns:hx-on="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <title>Dashboard</title> | |
| <script src="https://unpkg.com/htmx.org"></script> | |
| </head> | |
| <body> | |
| <h1>Welcome to your Mind Uploader</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Event = {'body': {'task_id': 1}, 'httpMethod': 'POST'} | |
| Received task_id 1 | |
| Completed task_id 1 | |
| END RequestId: ac4d9b48-9675-4513-881b-d5a89d801035 | |
| REPORT RequestId: ac4d9b48-9675-4513-881b-d5a89d801035 Init Duration: 0.76 ms Duration: 3895.27 ms Billed Duration: 3896 ms Memory Size: 128 MB Max Memory Used: 128 MB | |
| {"status_code": 404, "body": "{\"status\": \"task does not exist\"}"}% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sam build | |
| sam local invoke --event events/event.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "body": {"task_id": 1}, | |
| "httpMethod": "POST" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # sim/views.py | |
| import requests | |
| import json | |
| from django.shortcuts import render | |
| from django.views.decorators.csrf import csrf_exempt | |
| from django.http import JsonResponse | |
| from .models import TaskResult | |
| def dashboard(request): |