Krydos Posted August 30, 2017 Posted August 30, 2017 [Wed Aug 30 14:25:02.823974 2017] [wsgi:error] [pid 3110:tid 140299519121152] [client x.x.x.x:50765] mod_wsgi (pid=3110): Target WSGI script '/home/susoft1/public_html/flask/flask.wsgi' cannot be loaded as Python module. [Wed Aug 30 14:25:02.824045 2017] [wsgi:error] [pid 3110:tid 140299519121152] [client x.x.x.x:50765] mod_wsgi (pid=3110): Exception occurred processing WSGI script '/home/susoft1/public_html/flask/flask.wsgi'. [Wed Aug 30 14:25:02.824357 2017] [wsgi:error] [pid 3110:tid 140299519121152] [client x.x.x.x:50765] Traceback (most recent call last): [Wed Aug 30 14:25:02.824401 2017] [wsgi:error] [pid 3110:tid 140299519121152] [client x.x.x.x:50765] File "/home/susoft1/public_html/flask/flask.wsgi", line 7, in <module> [Wed Aug 30 14:25:02.824408 2017] [wsgi:error] [pid 3110:tid 140299519121152] [client x.x.x.x:50765] from views import app as application [Wed Aug 30 14:25:02.824432 2017] [wsgi:error] [pid 3110:tid 140299519121152] [client x.x.x.x:50765] File "/home/susoft1/public_html/flask/views.py", line 61 [Wed Aug 30 14:25:02.824449 2017] [wsgi:error] [pid 3110:tid 140299519121152] [client x.x.x.x:50765] def Inicio(): [Wed Aug 30 14:25:02.824477 2017] [wsgi:error] [pid 3110:tid 140299519121152] [client x.x.x.x:50765] ^ [Wed Aug 30 14:25:02.824493 2017] [wsgi:error] [pid 3110:tid 140299519121152] [client x.x.x.x:50765] SyntaxError: invalid syntax Do you see the error here on line 57? 57 @app.route('/' , methods=['GET' , 'POST'] I find it hard to believe that this actually runs on your local computer when you're missing a parenthesis, but if this is how you want to slowly keep debugging I'm fine with it.
HelioHost Posted August 31, 2017 Author Posted August 31, 2017 >> thanks to you, i've solved lot of problems. but now i'm not able to send> mails with flask-mail:> from flask_mail import Mailfrom flask_mail import Message app = Flask(__name__)application = app app.config['MAIL_SERVER']='mail.susoft.tk'app.config['MAIL_PORT'] = 465app.config['MAIL_USERNAME'] = 'myusername'app.config['MAIL_PASSWORD'] = 'mypass'app.config['MAIL_USE_TLS'] = Trueapp.config['MAIL_USE_SSL'] = True sendmail = Mail(app) @app.route('/', methods=['GET' , 'POST'])def Inicio():global sendmailmsg = Message('Mensaje nuevo de formulario pagina', sender="from@mail.com",recipients=['to@mail.com'])msg.body="HELLO"sendmail.send(msg) any help?
Krydos Posted August 31, 2017 Posted August 31, 2017 Try it without starttls. [Wed Aug 30 18:46:59.710831 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] [2017-08-30 18:46:59,600] ERROR in app: Exception on / [GET] [Wed Aug 30 18:46:59.710880 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] Traceback (most recent call last): [Wed Aug 30 18:46:59.710895 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] File "/usr/local/python3.6/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app [Wed Aug 30 18:46:59.710902 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] response = self.full_dispatch_request() [Wed Aug 30 18:46:59.710909 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] File "/usr/local/python3.6/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request [Wed Aug 30 18:46:59.710914 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] rv = self.handle_user_exception(e) [Wed Aug 30 18:46:59.710919 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] File "/usr/local/python3.6/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception [Wed Aug 30 18:46:59.710924 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] reraise(exc_type, exc_value, tb) [Wed Aug 30 18:46:59.710928 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] File "/usr/local/python3.6/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise [Wed Aug 30 18:46:59.710933 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] raise value [Wed Aug 30 18:46:59.710937 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] File "/usr/local/python3.6/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request [Wed Aug 30 18:46:59.710942 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] rv = self.dispatch_request() [Wed Aug 30 18:46:59.710946 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] File "/usr/local/python3.6/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request [Wed Aug 30 18:46:59.710951 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] return self.view_functions[rule.endpoint](**req.view_args) [Wed Aug 30 18:46:59.710955 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] File "/home/susoft1/public_html/flask/views.py", line 63, in Inicio [Wed Aug 30 18:46:59.710960 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] sendmail.send(msg) [Wed Aug 30 18:46:59.710965 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] File "/usr/local/python3.6/lib/python3.6/site-packages/flask_mail.py", line 491, in send [Wed Aug 30 18:46:59.710969 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] with self.connect() as connection: [Wed Aug 30 18:46:59.710974 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] File "/usr/local/python3.6/lib/python3.6/site-packages/flask_mail.py", line 144, in __enter__ [Wed Aug 30 18:46:59.710978 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] self.host = self.configure_host() [Wed Aug 30 18:46:59.710982 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] File "/usr/local/python3.6/lib/python3.6/site-packages/flask_mail.py", line 163, in configure_host [Wed Aug 30 18:46:59.710987 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] host.starttls() [Wed Aug 30 18:46:59.710991 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] File "/usr/local/python3.6/lib/python3.6/smtplib.py", line 751, in starttls [Wed Aug 30 18:46:59.710996 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] "STARTTLS extension not supported by server.") [Wed Aug 30 18:46:59.711009 2017] [wsgi:error] [pid 31150:tid 140299535906560] [client x.x.x.x:57340] smtplib.SMTPNotSupportedError: STARTTLS extension not supported by server.
HelioHost Posted September 6, 2017 Author Posted September 6, 2017 Hey! I've been bussy with lot of things to study. But returning to the app:i've debugged almost all (thanks to you, of course) except one problem. Ican't receive MercadoPago IPN, don't know why. I'm continuing on weekend,so i'll be back later.Regards
HelioHost Posted September 16, 2017 Author Posted September 16, 2017 Hello, i have a little problem! sometimes my app url (www.susoft.tk/flask/)turns into www.susoft.tk/flask.wsgi/flask. Why is this happening?? andwhats the correct way to force https?thank you
Krydos Posted September 17, 2017 Posted September 17, 2017 There's a few different ways to redirect to https that work. Here's one: RewriteEngine On RewriteCond %{HTTPS} !=on RewriteCond ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] The susoft.tk/flask.wsgi/flask is probably because of the way you're defining your routes. It works for me when I do routes like this: @app.route("/") @app.route("/whatever/")
HelioHost Posted October 9, 2017 Author Posted October 9, 2017 HI!i need a module to be installed. from flask.ext import restful Thanks in advance.
Krydos Posted October 9, 2017 Posted October 9, 2017 I installed flask-restful on Tommy python 3.6, but I need to point out >>> from flask.ext import restful __main__:1: ExtDeprecationWarning: Importing flask.ext.restful is deprecated, use flask_restful instead. You should be using flask_restful instead.
HelioHost Posted October 14, 2017 Author Posted October 14, 2017 Hey, i need some modules to be installed: wtformsMySQLdbflask_mailrequestsflask_restfulmercadopago Thanks in advance.
Krydos Posted October 14, 2017 Posted October 14, 2017 Installed. https://krydos.heliohost.org/cgi-bin/modules36.py
HelioHost Posted October 21, 2017 Author Posted October 21, 2017 Hi, I've changed main folder name from flask to sicc (http://susoft.com.ar/flask to http://susoft.com.ar/sicc)I've also modified .htaccess and flask.wsgi but 500 error appears. Whatcould it be? Thanks (again haha)
HelioHost Posted October 23, 2017 Author Posted October 23, 2017 Oh, I've change the content, not the name. I thought it was only a name.Thank you El 22 oct. 2017 6:43 PM, "Heliohost Support" escribio: > Did you change flask.wsgi to sicc.wsgi?>> You may view the status of your ticket by visiting:>> https://www.helionet.org/index/index.php?showtopic=29441>> Thank you,> Heliohost support> https://www.heliohost.org/> https://www.helionet.org/>>
HelioHost Posted December 26, 2017 Author Posted December 26, 2017 Hey! I need flask-dance module to be installed please. Thanks!
Krydos Posted December 27, 2017 Posted December 27, 2017 There you go https://krydos.heliohost.org/cgi-bin/modules36.py
Recommended Posts