Ask coding questions

← Back to all posts
kotrotkot (0)

How to use my django project on as a server? I tried to do it directly, but it does not work.

My Flutter frontend on FlutLab does not see my Django backend on 0

I am trying (unsuccessfully) to get data from my django backend, developed on, to my flutter frontend, developed on FlutLab. On Flutter side, I get data successfully from, for example, On Django side, I render my data normally and get data by Postman, also without problem.

But if my frontend send get() request directly to backend, I see just my circular indicator.

My URL on Flutter/Dio looks like Response response = await Dio().get("");

My ALLOWED_HOSTS on Django looks like

ALLOWED_HOSTS = ['', '', 'localhost', '']
Actually I have no idea which host/port I need to use in this case, so, I just added all I could think of.

Is it possible to get data from my backend to frontend in this case and how to do it if yes?

I also can provide more details if necessary.

All ideas are highly appreciated!

ch1ck3n (1553)

in mysite/urls put

from django.contrib import admin
from django.urls import include, path

urlpatterns = [
    path("admin/",, name="admin"),
    path("", include("backend.urls"))
kotrotkot (0)

@ch1ck3n Yes I did it. The same result: no communication between frontend and backend. Anyway, thank you for reaction. If you have more ideas, I am happy to try)