R
Railway•15mo ago
Justicia

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.
No description
61 Replies
Percy
Percy•15mo ago
Project ID: 02122a65-c97a-4cd7-afa6-af31d7e6bd8c
Justicia
JusticiaOP•15mo ago
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.
Brody
Brody•15mo ago
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?
Justicia
JusticiaOP•15mo ago
Just checked, for Jukework specifically, I have a lot of "worker exiting" messages in red.
Justicia
JusticiaOP•15mo ago
Sorry, not at home at the moment so smaller screen.
No description
Brody
Brody•15mo ago
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?
Justicia
JusticiaOP•15mo ago
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.
Brody
Brody•15mo ago
how long would these requests take when you run your app locally?
Justicia
JusticiaOP•15mo ago
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.
Brody
Brody•15mo ago
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 returning
Justicia
JusticiaOP•15mo ago
That browsable API is faster. The frontend has a lot of timeouts when first loading. But it does without it. 🤔
Brody
Brody•15mo ago
but you get worker timeouts?
Justicia
JusticiaOP•15mo ago
Yup!
Brody
Brody•15mo ago
so that means gunicorn killed the request because it wasn't returning is this a database connection that's hanging?
Justicia
JusticiaOP•15mo ago
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.
Brody
Brody•15mo ago
it should never take that long right?
Justicia
JusticiaOP•15mo ago
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. 🫠
Brody
Brody•15mo ago
where are you getting the data from? postgres? an external api?
Justicia
JusticiaOP•15mo ago
Postgres via and API. They're both full stack apps. I made the frontend, the backend and the API.
Brody
Brody•15mo ago
pretty certain that this is just some upstream request that's infinitely loading, chuck in some print statements lol
Justicia
JusticiaOP•15mo ago
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!
Brody
Brody•15mo ago
that's bizarre
Justicia
JusticiaOP•15mo ago
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! kekw
Brody
Brody•15mo ago
I would still be considered that this might happen again in the future 🤣
Justicia
JusticiaOP•15mo ago
Wouldn't be surprised. cryingman Me and deployment really aren't friends.
Brody
Brody•15mo ago
maybe it would be good to add logging with timestamps so you can know where in your code soft locks
Justicia
JusticiaOP•15mo ago
Oh! I didn't even know soft locking was a thing!
Brody
Brody•15mo ago
anything is possible with python
Justicia
JusticiaOP•15mo ago
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.
Brody
Brody•15mo ago
what doesn't work specifically
Justicia
JusticiaOP•15mo ago
This is how it's supposed to load. It's specifically universal symptoms that all auth users have access to.
No description
Justicia
JusticiaOP•15mo ago
It loads perfectly fine on every other device broswer. I store them in the local storage since they can't be changed by users.
Justicia
JusticiaOP•15mo ago
But for some reason, ob ny Mozilla browser on mobile specifically (works fine on desktop), nothing loads at all.
No description
Brody
Brody•15mo ago
you are on mobile, it is near impossible to debug web apps on mobile what browser is this? Firefox?
Justicia
JusticiaOP•15mo ago
I know. That's why I was trying aim a blow at the wind asking one of the staff. cryingman
Brody
Brody•15mo ago
about a css issue 🤣
Justicia
JusticiaOP•15mo ago
Yeah, sorry, I still say Mozilla.
Brody
Brody•15mo ago
are you near a computer?
Justicia
JusticiaOP•15mo ago
sadcat I'm on the desktop for mozilla where it's loading fine!
Brody
Brody•15mo ago
well time to get the Firefox remote debugger running or try to switch Firefox desktop into mobile mode maybe
Justicia
JusticiaOP•15mo ago
Remote debugger? 😳 I've never heard of that before!
Brody
Brody•15mo ago
well you've seen the dev tools for Firefox desktop right?
Justicia
JusticiaOP•15mo ago
Of course. Couldn't get this far without em.
Brody
Brody•15mo ago
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
Justicia
JusticiaOP•15mo ago
I think I found what you're talking about!
Brody
Brody•15mo ago
awesome
Justicia
JusticiaOP•15mo ago
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....
Brody
Brody•15mo ago
chrome can do it over WiFi, Firefox can't?
Justicia
JusticiaOP•15mo ago
My work conputer doesn't use Wifi, uses ethernet. I think. I know it's a wire. 💀
Brody
Brody•15mo ago
well it doesn't matter, doesn't need to be WiFi, I should have said LAN
Justicia
JusticiaOP•15mo ago
To be fair, I wouldn't know the different. I know next to nothing about hardware.
Brody
Brody•15mo ago
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?
Justicia
JusticiaOP•15mo ago
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
Brody
Brody•15mo ago
you just gonna out me like that
Justicia
JusticiaOP•15mo ago
😭😭😭
Brody
Brody•15mo ago
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?
Justicia
JusticiaOP•15mo ago
Specifically to register and allow the app to work properly LOLOL
Brody
Brody•15mo ago
you give me a temp user account 🙂
Justicia
JusticiaOP•15mo ago
Hm, okay, I was thinking about making one anyway! Give me like 5 minutes. Can you friend me so I can DM credentials?
Brody
Brody•15mo ago
will do
Want results from more Discord servers?
Add your server