Jump to content

Recommended Posts

Posted

[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. :)

  • Replies 31
  • Created
  • Last Reply

Top Posters In This Topic

Posted

>

> 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 Mail

from flask_mail import Message

 

app = Flask(__name__)

application = app

 

app.config['MAIL_SERVER']='mail.susoft.tk'

app.config['MAIL_PORT'] = 465

app.config['MAIL_USERNAME'] = 'myusername'

app.config['MAIL_PASSWORD'] = 'mypass'

app.config['MAIL_USE_TLS'] = True

app.config['MAIL_USE_SSL'] = True

 

sendmail = Mail(app)

 

@app.route('/', methods=['GET' , 'POST'])

def Inicio():

global sendmail

msg = Message('Mensaje nuevo de formulario pagina', sender="from@mail.com",

recipients=['to@mail.com'])

msg.body="HELLO"

sendmail.send(msg)

 

any help?

Posted

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.

Posted

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. I

can't receive MercadoPago IPN, don't know why. I'm continuing on weekend,

so i'll be back later.

Regards

  • 2 weeks later...
Posted

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?? and

whats the correct way to force https?

thank you

Posted

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/")

  • 4 weeks later...
Posted

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.

  • 2 months later...
Guest
This topic is now closed to further replies.

×
×
  • Create New...