Getting Error 404 instead of json when trying to use daphne server and pagekite

so I wrote a backend for my website with Python and FastAPI and now want to run it on my computer or phone. To run the python server I decided to use daphne, to make it reachable from a domain name, I’ve decided to use pagekite.

However, when I go to (not the actual domain name), I get 404 Not found File or directory not found. Sorry! When I go to I get an actual json response I expect. Here are the commands I used to run as the backend.

daphne -b -p 8000 main:app

python3 --service_on=

from fastapi import FastAPI
from datetime import datetime
from pydantic import BaseModel
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()

origins = ["*"]


def root():
    return {"message": "Hello World"}

directionX = 0
directionY = 0
Gas = 0
@app.get("/coordinates/") #post is used to get data, but I can send it using get and query parameters response_model=Item)
def getcoordinates(direction_x,direction_y,gas): #
    global directionX,directionY, Gas #changed async def to def 
    directionX = direction_x
    directionY = direction_y
    Gas = gas
    return {"data":(direction_x,direction_y,gas)}

Here is the whole pagekite log:

python3 --service_on=
>>> Hello! This is v1.5.2.201011.                   [CTRL+C = Stop]
    Built-in HTTPD is on localhost:43503, secret=CCV0mPEbKJ+ZGhi_7SQT+MYr      
Exception in thread Thread-7:arting up...                                      
Traceback (most recent call last):
  File "/usr/lib/python3.8/", line 932, in _bootstrap_inner
  File "/usr/lib/python3.8/", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "<string>", line 3452, in sping
ValueError: not enough values to unpack (expected 2, got 1)
    Connecting to front-end relay ...                       
     - Relay supports 10 protocols on 19 public ports.                         
     - Raw TCP/IP (HTTP proxied) kites are available.                          
     - To enable more logging, add option: --logfile=/path/to/logfile          
    Abuse/DDOS protection: Relaying traffic for up to 5 clients per 10800s.    
    Quota: You have 26 days, 5.0 tunnels left.                                 
~<> Flying builtin HTTPD as                   
     -                                    < (builtin)                   
 << [flying]   Kites are flying and all is well.  



I use Linux Mint. Thanks for your help!


Info can be found in pagekite doc under Kite Management Section 8000