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
Project ID:
N/A
Would help if you could paste the error in with a code block around it. (https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-#h_01GY0DAKGXDEHE263BCAYEGFJA)
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 recurringException: Install 'email_validator' for email validation support.There's your issue. Do you have that added to the requirements file?
You mean the email validator package? no i don't. Will adding it solve the problem?
try it
just did and received the same error
Here is my requirement.txt file
please i need help
HEyyy....
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
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
you can always try to solve this yourself as neither me or luna are python devs
this issue isnt specific to railway
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
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
i get you
This is likely more of a docker or deployment issue than railway.
everything seems fine now. Figured out why it showed the email validator error. So how do i proceed from here please
what do you mean?
please reference the railway provided template for flask, specifically the procfile
https://github.com/railwayapp-templates/flask
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
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
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'
do you have flask in your requirements.txt?
Thanks i just did and it's working perfectly
sounds good
sorry but please i still haven't been able to configure the postgreSQL.
I gave you instructions above
yeah i tried to follow them but still didn't work
then you didn't follow them lol
Here is a screenshot. I already have my blog configured with SQlite db. How do i get this postgre SQL instead
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