Jump to content

Recommended Posts

Posted

Really Thx in advanced .

 

Hi i am just new in the python world , i need to execute a flaskapp for whatsapp sending messages, i followed the steps to implement the flaskapp but i can't execute any code for python native or flask worst it produces an error i followed all the steps to implement flask

 

 

I really need to make it works the .htaccess looks like

 

/home/xtremese/public_html/inteygratemyfrank-i/.htaccess
RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(admin_media/.*)$ - [L]
RewriteRule ^(inteygratemyfrank-i\.wsgi/.*)$ - [L]
RewriteRule ^(.*)$ inteygratemyfrank-i/flask.wsgi/$1 [QSA,PT,L]

 

 

my flask.wsgi looks like

 

import os, sys
# edit your username below
sys.path.append("/home/xtremese/public_html/inteygratemyfrank-i");
sys.path.insert(0, os.path.dirname(__file__))
from myapp import app as application
# make the secret code a little better
application.secret_key = 'secret'
Create a python script named myapp.py
import sys
from flask import Flask, __version__
app = Flask(__name__)
application = app
@app.route("/")
def hello():
return """
HelioHost rules!<br><br>
<a href="/flask/python/version/">Python version</a><br>
<a href="/flask/flask/version/">Flask version</a>
"""
@app.route("/python/version/")
def p_version():
return "Python version %s" % sys.version
@app.route("/flask/version/")
def f_version():
return "Flask version %s" % __version__
if __name__ == "__main__":
app.run()

 

and my files structure looks like :

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...