This is a draft cheat sheet. It is a work in progress and is not finished yet.
Heliohost.org
Heliohost.org, |
taotal.heliohost.org/flask/mysqldemo |
python 3.7, flask 1.1.1, java, mysql |
mysql connecton:jdbc:mysql://localhost:3306/myDB, for remost db, using tommy.heliohost.org |
|
setup python django proj
1 dowload python 3.6.3 (tommy) and install to c:\python\python36
2 pip install django==2.1.4 (tommy)
python -m django --version
3 pip install cookiecutter, download cookiecutter-helio-master.zip to c:\python\mywork
4 cd c:\python\mywork
cookiecutter cookiecutter-helio-master.zip
5 copy hello\dispatch.wsgi hello\wsgi.py
6 python manage.py runserver
7 http://127.0.0.1:8000
8 upload hello proj to heliohost.org and run taotao.heliohost.org/hello
--> done
|
Python flask demo
1 Create a folder in public_html called flask: /home/username/public_html/flask/ |
2 create a .htaccess |
3 Create a file named flask.wsgi: web server gatewau interface |
4 Create a python script named myapp.py: this is the app business logic |
|
python-flask -mysql web app
Setting Up Flask:
pip install flask> create home dir
app.py > python app.py > http://localhost:5000
Creating a Home Page:
index.html > in main(): return render_template('index.html')
Setup mysql database: create db, table, procedure
Create ../templates/html form, ../static/.css,python route:
@app.route('/showSignUp')
def showSignUp():
return render_template('signup.html')
|
|
|
|
|
|