R
Railway2y ago
Dipec

Deploying my website/blog

Heyyy. Anyone know how i can resolve this issue? I am trying to deploy my blog on GitHub to railway but got this error
31 Replies
Percy
Percy2y ago
Project ID: N/A
Dipec
Dipec2y ago
Traceback (most recent call last): File "/app/main.py", line 9, in <module> from forms import CreatePostForm, RegisterForm, LoginForm, CommentForm File "/app/forms.py", line 16, in <module> class RegisterForm(FlaskForm): File "/app/forms.py", line 18, in RegisterForm email = StringField('Email', validators=[DataRequired(), Email()]) File "/opt/venv/lib/python3.10/site-packages/wtforms/validators.py", line 332, in __init__ raise Exception("Install 'email_validator' for email validation support.") Exception: Install 'email_validator' for email validation support. Thats the error code please It's recurring
luna
luna2y ago
Exception: Install 'email_validator' for email validation support.
There's your issue. Do you have that added to the requirements file?
Dipec
Dipec2y ago
You mean the email validator package? no i don't. Will adding it solve the problem?
Brody
Brody2y ago
try it
Dipec
Dipec2y ago
just did and received the same error
Dipec
Dipec2y ago
Here is my requirement.txt file
Dipec
Dipec2y ago
please i need help HEyyy....
Brody
Brody2y ago
chill, this is comunity support, we help when we have time to do so pypi lists the package name as email-validator not email_validator
Dipec
Dipec2y ago
I just tried that too but isn't working Yeah i get. Sorry it just means i have to pause what i'm doing but it's okay. Atleast i'm sure i would get a respond sometime. I have no choice but to wait
Brody
Brody2y ago
you can always try to solve this yourself as neither me or luna are python devs this issue isnt specific to railway
Dipec
Dipec2y ago
Of course I'll try other ways to solve it. Hopefully i get it. I just think it's more of a railway problem than it is python coz it's working perfectly well locally on my pc
Brody
Brody2y ago
i assure you, its not a problem specfic to railway just beacuse it works on your computer but not on railway, does not automatically mean its a problem with railway, thats a very common misconception
Dipec
Dipec2y ago
i get you
luna
luna2y ago
This is likely more of a docker or deployment issue than railway.
Dipec
Dipec2y ago
everything seems fine now. Figured out why it showed the email validator error. So how do i proceed from here please
luna
luna2y ago
what do you mean?
Brody
Brody2y ago
please reference the railway provided template for flask, specifically the procfile https://github.com/railwayapp-templates/flask
Dipec
Dipec2y ago
Hey thanks i've successfully been able to do what i wanted. But i have a worry. How can i configure railway with postgresql. Currently i'm working with SQLite like i have an issue with adding the PostgreSQL addon to your project Please i need help
Brody
Brody2y ago
once your railway project is open, click the "+ New" button, then you can add the postgre database you will then want to setup the variable references in your railway django service https://docs.railway.app/develop/variables#reference-variables then you can reference this for how to use the postgre variables in code https://github.com/railwayapp-templates/django/blob/main/mysite/settings.py#L81
Dipec
Dipec2y ago
Hello there Having another slight issue please tried deploying my portfolio website but got this Traceback (most recent call last): File "main.py", line 1, in <module> from flask import Flask, render_template, redirect, url_for, flash, request, abort, session ModuleNotFoundError: No module named 'flask'
Brody
Brody2y ago
do you have flask in your requirements.txt?
Dipec
Dipec2y ago
Thanks i just did and it's working perfectly
Brody
Brody2y ago
sounds good
Dipec
Dipec2y ago
sorry but please i still haven't been able to configure the postgreSQL.
Brody
Brody2y ago
I gave you instructions above
Dipec
Dipec2y ago
yeah i tried to follow them but still didn't work
Brody
Brody2y ago
then you didn't follow them lol
Dipec
Dipec2y ago
Here is a screenshot. I already have my blog configured with SQlite db. How do i get this postgre SQL instead
Brody
Brody2y ago
you will then want to setup the variable references in your railway django service https://docs.railway.app/develop/variables#reference-variables then you can reference this for how to use the postgre variables in code https://github.com/railwayapp-templates/django/blob/main/mysite/settings.py#L81
Want results from more Discord servers?
Add your server