-
Notifications
You must be signed in to change notification settings - Fork 1
Javascript Notes (Backend)
- Open your Python environment
source ./app/venv/bin/activate
- Then, install Django using the following:
pip install django
- Now, to start off, you should make your own project. You can do this by running this in your terminal:
django-admin startproject [INSERT NAME OF PROJECT]
- For convenience, switch to the project folder
cd [INSERT NAME OF PROJECT]
- And try and run it on the host:
python manage.py runserver 0.0.0.0:7860
You should get this upon visiting http://localhost:7860/:
(otherwise, you might need to debug!)
python manage.py startapp [INSERT NAME OF APP]
This will create a folder within your project folder (my app is called "first_test" while my project is called "modelworks_chatbot"

To edit what you want to see, go to [INSERT NAME OF APP]/views.py. There is substantial documentation on how to do this, but for simplicity this wiki follows the w3schools guide and uses the following code:
from django.shortcuts import render
from django.http import HttpResponse
def members(request):
return HttpResponse("Hello world!")
To link what you wrote to the host:
- Create a new file within the APP folder:
urls.py - Copy and paste in the following:
from django.urls import path
from . import views
urlpatterns = [
path('[INSERT NAME OF APP]/', views.[INSERT NAME OF APP], name='[INSERT NAME OF APP]'),
]
- Go back to the main project folder and go to its
urls.pyfile - Add the following to its
urlpatternsarray:path('', include('[INSERT NAME OF APP].urls')),- It should look like this:
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('', include('members.urls')),
path('admin/', admin.site.urls),
]
Now, you can see your work on the host by running it:
python manage.py runserver 0.0.0.0:7860
Then go to http://localhost:7860/[INSERT NAME OF APP] to access what you wrote in [INSERT NAME OF APP]/views.py

(wip)
- https://www.w3schools.com/django/django_templates.php
- https://www.geeksforgeeks.org/how-to-connect-django-with-reactjs/
- Open your Python environment
source ./app/venv/bin/activate
- Then, install Flask using the following:
pip install flask
- (wip) for changing host: https://www.geeksforgeeks.org/changing-host-ip-address-in-flask/
[need to insert how we got this working]
| Option | recommended | currently working on all devices | easy to set up | Final |
|---|---|---|---|---|
| Django | - | - | + | -1 |
| Flask | + (Elena) | - | - | -1 |
| FastAPI | + (Elena) | + | + | 3 |
Ultimately, FastAPI was the only framework that was the best for all team members, hence it was chosen for our backend.
Welcome to the ModelWorks Wiki! Use the links below to navigate our resources quickly.
Product Information
- π¦ !! JoeyLLM Guide !! π¦
- Shared Product Vision
- Personas, Scenarios, & User Stories
- Procedure to Resolve Conflicts
- Project Milestones
- Decision Making Protocol
- Story Point Estimation Algorithm
- Gradio Notes
- Javascript Notes (split into two)
- Ollama Notes
- Langchain Notes
- Chroma Notes
- GPU Monitor Notes
- Open WebUI Notes
- Web Search Notes
- Chat History Notes
- Meeting Minute 1
- Meeting Minute 2
- Meeting Minute 3
- Meeting Minute 4
- Meeting Minute 5
- Meeting Minute 6
- Meeting Minute 7
- Meeting Minute 8
- Meeting Minute 9
- Meeting Minute 10
- Meeting Minute 11