Closed ashutoshkrris closed 2 years ago
Can I have a shot at this one?
Go ahead! Assigning it to you @TimeglitchD
Any updates? @TimeglitchD
I can't seem to get the setup working, so it's probably not fair to keep it assigned to me, feel free to assign someone else. Sorry for the inconvenience!
@TimeglitchD The contributing guidelines have been updated. If you wish, you can check out that. Also, would you let me know where are you stuck?
Hey, I'm interested to solve this bug and want to contribute to this amazing project on this Hacktoberfest 2021
Hey, I'm interested to solve this bug and want to contribute to this amazing project on this Hacktoberfest 2021
Alright, assigning it to you!
Before stating development , would you like to help me by answering my following queries ? ->
In index.html, line: 96 ,
I couldn't find any residing python method/class to handle the contact form data. please tell me the file name and line no if there exist such python method/class, otherwise i will add new method to handle form data.
Do you want to store contact form data in database or want a functionality to send these form data to admin's email.
you are hosting this website on heroku, so if you want to add me mail service for sending form data, using flask-mail might not work in production for heroku. But Sendgrid email or AWS SES will definately allow to send mail from any type of email server on heroku. And Sendgrid will be quick solution for this.
The data-sb-form-api-token="API_TOKEN"
has nothing to do with the form now, and it can be removed. It was there in Bootstrap template.
There is no method as of now, and you can create one in the core/routes.py
file.
Since, we aren't using Database for now. It would be better to send email to the Admin Email. Add an environment variable such as ADMIN_EMAIL
Flask-Mail works fine on heroku too. You can go ahead with that.
Also, the email that the admin will receive should be a HTML template.
@ThisIsBBBGithubAc
Hi, i have one more query regarding Hacktoberfest 2021. I saw list of company's repository and individual's repository in Hacktoberfest official website. So to win a swag , do i need to do something else ? and who will provide the Hacktoberfest Swag gift if someone contributed to some individual's repository but not in the participating company's repository?
It is not compulsory to contribute in the participating company's respository. You can contribute to any respository that has hacktoberfest label. And yes, contributing to this respository will count towards your Hacktoberfest Contribution
Once you complete 4 successful PRs, you'll receive mail from Hacktoberfest where you need to order your TShirt
Okay. Thank you
On Tue, 26 Oct 2021, 6:53 pm Ashutosh Krishna, @.***> wrote:
It is not compulsory to contribute in the participating company's respository. You can contribute to any respository that has hacktoberfest label. And yes, contributing to this respository will count towards your Hacktoberfest Contribution
Once you complete 4 successful PRs, you'll receive mail from Hacktoberfest where you need to order your TShirt
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ashutoshkrris/EazyLoader/issues/26#issuecomment-951934521, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQK5EYIFZXZPDT2KMUCDRQDUI2TTJANCNFSM5GNYSSAA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Since, I'm fixing one bug , how to do 4 pull requests. I'm little confused with this thing! How to do this? Do i have to commit and PR this development into 4 different parts of codes or what?
You need to resolve four issues and create four different PRs. The repository can be one or more than one, doesn't matter. But it should have hacktoberfest label on it.
Hi, I was getting some error yesterday while using Flask_Mail and more time might be needed to fix this error. So Can i continue with Other python library like SMTP, Sendgrid etc?
Could you share the error log? May be we can resolve it @ThisIsBBBGithubAc
this error was displayed: "TypeError: getaddrinfo() argument 1 must be string or None"
Could you please share the entire error log, so that I can see the Line number and filename in which the error is occurring. Also, share the changes that you've made till now
How to share the entire error log? please tell.
You can just copy the last few lines from the terminal and paste it here as codeblock
Traceback (most recent call last): File "/home/thisisbbb/OPEN_SOURCE_CONTRIBUTION/EazyLoader/env/lib/python3.8/site-packages/flask/app.py", line 2091, in __call__ return self.wsgi_app(environ, start_response) File "/home/thisisbbb/OPEN_SOURCE_CONTRIBUTION/EazyLoader/env/lib/python3.8/site-packages/flask/app.py", line 2076, in wsgi_app response = self.handle_exception(e) File "/home/thisisbbb/OPEN_SOURCE_CONTRIBUTION/EazyLoader/env/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app response = self.full_dispatch_request() File "/home/thisisbbb/OPEN_SOURCE_CONTRIBUTION/EazyLoader/env/lib/python3.8/site-packages/flask/app.py", line 1518, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/thisisbbb/OPEN_SOURCE_CONTRIBUTION/EazyLoader/env/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request rv = self.dispatch_request() File "/home/thisisbbb/OPEN_SOURCE_CONTRIBUTION/EazyLoader/env/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) File "/home/thisisbbb/OPEN_SOURCE_CONTRIBUTION/EazyLoader/core/routes.py", line 29, in index mail.send(msg) File "/home/thisisbbb/OPEN_SOURCE_CONTRIBUTION/EazyLoader/env/lib/python3.8/site-packages/flask_mail.py", line 491, in send with self.connect() as connection: File "/home/thisisbbb/OPEN_SOURCE_CONTRIBUTION/EazyLoader/env/lib/python3.8/site-packages/flask_mail.py", line 144, in __enter__ self.host = self.configure_host() File "/home/thisisbbb/OPEN_SOURCE_CONTRIBUTION/EazyLoader/env/lib/python3.8/site-packages/flask_mail.py", line 156, in configure_host host = smtplib.SMTP_SSL(self.mail.server, self.mail.port) File "/usr/lib/python3.8/smtplib.py", line 1043, in __init__ SMTP.__init__(self, host, port, local_hostname, timeout, File "/usr/lib/python3.8/smtplib.py", line 255, in __init__ (code, msg) = self.connect(host, port) File "/usr/lib/python3.8/smtplib.py", line 339, in connect self.sock = self._get_socket(host, port, self.timeout) File "/usr/lib/python3.8/smtplib.py", line 1049, in _get_socket new_socket = socket.create_connection((host, port), timeout, File "/usr/lib/python3.8/socket.py", line 787, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): TypeError: getaddrinfo() argument 1 must be string or None
Also, share what changes have you done so far? May be there would some minor typos
Hi, please check: https://github.com/ThisIsBBBGithubAc/EazyLoader.git
Hi, please check: https://github.com/ThisIsBBBGithubAc/EazyLoader.git
Did you set ADMIN_EMAIL
environment variable in .env
file? Also whenever you modify this file, make sure you deactivate the virtual environment and activate it again to avoid errors.
Yeah, i used ADMIN_EMAIL in .env and other configurations related to flask_mail in config.py and also reactivated the virtual environment.....but still getting the same error.
In the config.py
file, did you set these configurations in the Config
class?
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNAME = config("EMAIL_ADDRESS")
MAIL_PASSWORD = config("EMAIL_PASSWORD")
MAIL_DEBUG = True
I suppose, you haven't added these. @ThisIsBBBGithubAc
Note:
EMAIL_ADDRESS
andEMAIL_PASSWORD
should be added in the.env
file.
I used these:
#EMAIL SETTINGS MAIL_SERVER = 'smtp.gmail.com', MAIL_PORT = 465, MAIL_USE_SSL = True, MAIL_USE_TLS = False, MAIL_USERNAME = 'adminmail@gmail.com', MAIL_PASSWORD = 'password'
Try replacing with the one that I sent you. Also, set the MAIL_USERNAME and MAIL_PASSWORD for a working Gmail account. You might need to switch on Less Secure Apps Access in your Gmail Settings
Yes, i have tried all these ......but getting the same error
Yes, i have tried all these ......but getting the same error
Can you update your branch with the latest changes so that I can test it.
Well, I tried with the changes you have made till now.
There was no modification in the config.py
file, so I added this:
class Config(object):
SECRET_KEY = config('SECRET_KEY') or 'guess-me'
DEBUG = False
TESTING = False
CSRF_ENABLED = True
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNAME = config("EMAIL_ADDRESS")
MAIL_PASSWORD = config("EMAIL_PASSWORD")
MAIL_DEBUG = True
And it worked fine for me.
Yeah, my previous codes have started working now. What i was doing wrong is i was using commas(,) for each line in config.py file like this:
MAIL_SERVER = 'smtp.gmail.com', MAIL_PORT = 465, MAIL_USE_SSL = True, MAIL_USE_TLS = False
It started working after i remove these commas. Thank you
Great to hear that! Also, the email should be an HTML template, so work accordingly
Sure
Hi, Please download this image( i cropped it from logo.png) and rename it as "logo_for_email_template.png". Since this image is in local directory it will not be loaded in email . So host it somewhere and send me the url. You can use google drive (quick solution)
Wait, I'll send you the URL
@ThisIsBBBGithubAc Image URL : https://i.imgur.com/971aIwi.png
image through https://i.imgur.com/971aIwi.png was not loaded, since this link is returning the image with html page
Okay, Now it's working
Please suggest if any change needed!
Amazing!!!
After form Submission Success, do you want this to show :
Form submission successful! To activate this form, sign up at https://startbootstrap.com/solution/contact-forms (previously written html)
or
Form submitted successfully! (flash message)
Just flash the message and redirect to the contact form section again.
For showing the message in the template, you can use the includes/alerts.html
Hi, please check: https://github.com/ThisIsBBBGithubAc/EazyLoader , recently updated, bug fixed.
Looks good to me! Take the latest pull from this repo and create PR
i didn't understand this "Take the latest pull from this repo".....why is this necessary ?
To avoid merge conflicts
Go to this respository's home page and you'll find an option to fetch upstream.
Is there an existing issue for this?
Describe the feature.
The contact form(on the homepage) is not working as of now.
Problem/Motivation.
If somebody faces any issue, they can report using the contact form.
Possible Solution/Pitch.
Instead of saving the contact form data in any database, we can use Flask-Mail to mail the contact form data to the admin email. Make sure you use HTML templates for the email.
Anything else?
This is a beginner-friendly backend issue.
Hacktoberfest
Code of Conduct