Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix setup : localhost:8000 just loading forever #378

Open
StitiFatah opened this issue Sep 7, 2024 · 1 comment
Open

Nix setup : localhost:8000 just loading forever #378

StitiFatah opened this issue Sep 7, 2024 · 1 comment

Comments

@StitiFatah
Copy link

StitiFatah commented Sep 7, 2024

Hi,

Just picked up this framework this morning and I'm running into problems.

OS : Archlinux
Nix : Tried 2.24-5, got the symlink error #356, upgraded to last unstable release fixed it, I then tried 2.20.5 as that's what appeared in one of your screenshots where you said it worked in an attempt to solve the current problem.
Browser : Brave, Chromium, FIrefox

I don't usually have problems with Django's dev server nor vite, I was just using both together yesterday and retried now and both work fine.

After a while the browser returns the typical django yellow error page insidctaing a connection timeout : HTTPConnectionPool(host='localhost', port=9000): Max retries exceeded with url: /_reactivated/ (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x762aee3b3740>, 'Connection to localhost timed out. (connect timeout=None)'))
but no errors are displayed before that.

Edit : I guess it's not a nix problem, just going from :

def polls_index(request: HttpRequest) -> HttpResponse:
    return templates.PollsIndex(
        latest_question_list=list(models.Question.objects.all())
    ).render(request)

to something just returning hand written HTML :

def polls_index(request: HttpRequest) -> HttpResponse:
    foo = models.Question.objects.first().question_text
    return HttpResponse(f"<div> First question : {foo} </div>")

works and the /admin endpoint as well.

So I guess it's a problem with the templates.

In the docs it says :

just run cd <project_name>, then nix-shell and finally python manage.py runserver

With the server running, you can visit http://localhost:8000 to see Reactivated in action.

Is there an additional required step ?

Thanks.

Edit 2 : Things work fine with the docker instructions

@StitiFatah StitiFatah changed the title localhost:8000 just loading forever localhost:8000 just loading forever (instructions unclear ?) Sep 7, 2024
@StitiFatah StitiFatah changed the title localhost:8000 just loading forever (instructions unclear ?) Nix setup : localhost:8000 just loading forever Sep 7, 2024
@silviogutierrez
Copy link
Owner

It appears the vite process is not starting, so Django is unable to render the template. Poke around reactivated/__init__.py and there's a subprocess there that starts the vite process. That might shed some light as to why the process fails.

Not too sure how else to debug this, maybe try npm exec start_vite to see if you get errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants