Django projects loading issues
I have two Django projects that I have deployed and both projects are facing similar issues (most likely because I built them with the same "ideologies"). For one of my projects that's bigger in scale and features, I tried looking at a past thread where @Brody gave a suggestion to add
--timeout 0
, but that actually made the site just not load at all and with Railway saying "Application failed to respond".
I rely on fetching, timeouts and caching quite a bit with these projects so could those reasons be why things are taking so long? Here's one of the projects that is a public repo: https://github.com/pecodeliar/JukeworkWeb I'm like 99% percent sure it's a me problem so I guess I would just like some pointers where in my code I'm going terribly wrong in terms of how a production level app should be written so these loading problems don't occur.GitHub
GitHub - pecodeliar/JukeworkWeb
Contribute to pecodeliar/JukeworkWeb development by creating an account on GitHub.
61 Replies
Project ID:
02122a65-c97a-4cd7-afa6-af31d7e6bd8c
02122a65-c97a-4cd7-afa6-af31d7e6bd8c
The project ID is for the bigger app, a menstrual cycle tracker. It's a full stack app that relys quite heavily on the API which is why I do so much caching. I'm wondering if that's one of the biggest causes of these issues.
Oh, and I'm using DRF, not sure if that makes a difference or is helpful.
real quick can you show me where I said to do
--timeout 0
nvm that's actually valid, it sets the timeout to infinity
what do your deployment logs look like?Just checked, for Jukework specifically, I have a lot of "worker exiting" messages in red.
Sorry, not at home at the moment so smaller screen.
in the repo you linked there was no --timeout flag set, meaning the default timeout of 30 seconds is used, so should a request to your app ever take longer than 30 seconds?
I did have one, the one you suggested that I search, but had to remove it because it would never load.
I am honestly not sure if it should, I am querying a lot of data though, upon log in, and right now I'm the only user LOL.
I'm not sure how bad it will get when I have multiple users.
how long would these requests take when you run your app locally?
Just off the top of my head, upon log-in, there's universal emotions which are like 40 items, then symptoms, like around 25, custom emotions, symptoms and qctivities then daily logs, the cycle logs, then cycle day logs, then a forecast and then calendar months.
Well actually no sorry, upon login, daily logs, cycle logd, cd logs and cal months don't get loaded. Those depend on which link you press while already logged in.
Not very long at all and you've said it yourself, there's no way I have better internet than RW.
I wanna say like 2-3 seconds at most.
okay so you get infinite loading when
--timeout 0
this leads me to believe that where ever your app gets the data from is never returningThat browsable API is faster. The frontend has a lot of timeouts when first loading.
But it does without it. 🤔
but you get worker timeouts?
Yup!
so that means gunicorn killed the request because it wasn't returning
is this a database connection that's hanging?
I'm guessing? I'm still new to this sorry.
But like for Jukework, it's definitely returning something, just takes a couple of minutes sometimes.
it should never take that long right?
No.
I'm pretty sure it's my fault though, not tryna blame RW!
I just don't know where my fault is laying ATM. ðŸ«
where are you getting the data from? postgres? an external api?
Postgres via and API.
They're both full stack apps. I made the frontend, the backend and the API.
pretty certain that this is just some upstream request that's infinitely loading, chuck in some print statements lol
I shall but it also seems like...fine now? I'm trying on different browsers to replicate what's been going on for the past week and it seems to have cleaned itself up.
The app I linked for this questions no longer gets workers messsges in the deploy logs. Jukework does but it's still loading as fast as it would locally.
Not sure what happened but oh well LOL!
that's bizarre
Yeah, cause it wss literally for a good week. Yesterday is took like 4-6 minutes on avg to load just the front page for Jukework.
Forecycle (the one this question is linked to) took the same amount.
Thanks anyways though, maybe this was just some new account wrinkles!
I would still be considered that this might happen again in the future 🤣
Wouldn't be surprised. Me and deployment really aren't friends.
maybe it would be good to add logging with timestamps so you can know where in your code soft locks
Oh! I didn't even know soft locking was a thing!
anything is possible with python
Okay, so every other fetch request is working perfectly, splendid, EXCEPT for symptoms! I am not even sure why because it behaves the exact same way as emotions.
what doesn't work specifically
This is how it's supposed to load. It's specifically universal symptoms that all auth users have access to.
It loads perfectly fine on every other device broswer. I store them in the local storage since they can't be changed by users.
But for some reason, ob ny Mozilla browser on mobile specifically (works fine on desktop), nothing loads at all.
you are on mobile, it is near impossible to debug web apps on mobile
what browser is this? Firefox?
I know. That's why I was trying aim a blow at the wind asking one of the staff.
about a css issue 🤣
Yeah, sorry, I still say Mozilla.
are you near a computer?
I'm on the desktop for mozilla where it's loading fine!
well time to get the Firefox remote debugger running
or try to switch Firefox desktop into mobile mode maybe
Remote debugger? 😳 I've never heard of that before!
well you've seen the dev tools for Firefox desktop right?
Of course. Couldn't get this far without em.
the remote debugger allows you to view the dev tools for your phone's browser, on your computer
well at least chrome has this, I can't imagine Firefox wouldn't
I think I found what you're talking about!
awesome
It requires a USB connection so I'll take a gander when I get home!
Let me try your other suggestion to make the desktop behave like mobile....
chrome can do it over WiFi, Firefox can't?
My work conputer doesn't use Wifi, uses ethernet.
I think. I know it's a wire. 💀
well it doesn't matter, doesn't need to be WiFi, I should have said LAN
To be fair, I wouldn't know the different. I know next to nothing about hardware.
but if it's a work network they might have ap isolation turned on
is there anyway I could access the page that's giving you problems?
Desktop still working fine even when it's in "mobile" mode LOL
I don't think so no. 🤔 Do you know anything about women's health?
Like the difference between a period and menstrual cycle? /genuine-question
you just gonna out me like that
ðŸ˜ðŸ˜ðŸ˜
our health classes sucked, so no i dont
but do i need to know about women's health to get to the page that isnt working?
Specifically to register and allow the app to work properly LOLOL
you give me a temp user account 🙂
Hm, okay, I was thinking about making one anyway!
Give me like 5 minutes. Can you friend me so I can DM credentials?
will do