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