R
Railway5mo ago
Madlabs

django email backends

Is it possible to implement django.core.mail.backends.smtp.EmailBackend in railway? Trying to use this functionality for user registration email validation feature. I tested in localhost and its working without any issues. However, when deployed to Railway, upon a new user registration, it just shows the page with "Go to Railway" button. I am not able to see any error or logs which tells me the issue. Does anyone know what could be the issue?
31 Replies
Percy
Percy5mo ago
Project ID: N/A
Brody
Brody5mo ago
can you provide me a way to replicate this error?
Madlabs
Madlabs5mo ago
On the registration form, when user clicks on register, the page shows spinning for few seconds and then shows me the railway page there is no error or message that I can tell you
Brody
Brody5mo ago
right but how can i experience this for myself
Madlabs
Madlabs5mo ago
I can send you the url of the application, and you can try registering or I can send you a picture
Brody
Brody5mo ago
send the url please
Madlabs
Madlabs5mo ago
Register Page - Madlabs
Ladlabs Prep provides bite-sized SAT exam prep practice tests to make daily practicising easy. SAT Tests covers English, Vocabulary, Reading Comprehension, Grammar and Math sections Algebra, Geometry, Trigonometry. Seperate sections for Mental Math and Logical and Analytical reasoning.
Brody
Brody5mo ago
yeah i see, your app is crashing
Madlabs
Madlabs5mo ago
yes
Brody
Brody5mo ago
and you said there are no logs during this what so ever?
Madlabs
Madlabs5mo ago
yes, Inside railway I don't see any logs it only gives me deployment logs
Brody
Brody5mo ago
thats the logs you would want to be looking at
Madlabs
Madlabs5mo ago
[2024-01-16 18:27:12 +0000] [7] [CRITICAL] WORKER TIMEOUT (pid:140) @replica: 9a77b73f-949c-4abe-8f5e-9983594df9db View in Context it does not tell me anything
Brody
Brody5mo ago
it tell me that the http post request took longer than 30 seconds so the connection was killed, it should never take 30 seconds, so theres an error in your code but you arent logging it i would recommend you to add more verbose logging so we can find out where the slow down is coming from
Madlabs
Madlabs5mo ago
ok, I will ask the developer to add logging but does Railway allow this feature of sending email. I mean, if it is not blocking anything?
Brody
Brody5mo ago
of course, this isnt a limitation or issue with railway but a code / config / access issue
Madlabs
Madlabs5mo ago
ok, thanks. I will come back with more soon.
Brody
Brody5mo ago
sounds good
maddsua
maddsua5mo ago
can we address the elephant in the room and mention that smtp server won't work with railway? or it's not relevant here?
Brody
Brody5mo ago
no we cant because they aren't running an smtp server but quick question what email provider are you using?
Madlabs
Madlabs5mo ago
I am not sure about it, but I am trying to use django.core.mail.backends.smtp.EmailBackend
Brody
Brody5mo ago
yes but with what email provider?
maddsua
maddsua5mo ago
I mean this thing looks awfully like a server to me tbh
Madlabs
Madlabs5mo ago
the email is with smtp.dreamhost.com SMTP Port 465
Brody
Brody5mo ago
its an smtp client, what makes you think its an smtp server??
maddsua
maddsua5mo ago
oh nvm that's more likely a client
Brody
Brody5mo ago
ofc
maddsua
maddsua5mo ago
yeah it def is
Madlabs
Madlabs5mo ago
is there a document that I can follow or if anyone has used it before? I followed the djago documentation an it works fine in localhost, no issues there
Brody
Brody5mo ago
just follow the django docs, sending emails via an smtp client has little to do with railway with that said, dreamhost could be blocking you and with that said, you still need verbose logging
Madlabs
Madlabs5mo ago
ok I have some pointers now to go back and check thanks to both of you