Python+mysql+flask Create a Weibo app (continuous update)

Source: Internet
Author: User
Tags virtual environment

The structure of Weibo applications:

    • User management, including login management, sessions, user roles, profiles and user avatars.
    • Database management, including database migration processing.
    • Web Forms support, including field validation and verification code features to prevent spam.
    • Paging functionality for big data.
    • Full-Text search.
    • User Email Notification

Install the virtual environment

Self-surfing on the internet, this is not much to say, in fact, I am very annoying to install virtual environment, in their own computer is directly insert ...

Install the PY module:

Flask\scripts\pip Install Flaskflask\scripts\pip install FLASK-LOGINFLASK\SCRIPTS\PIP install Flask-openidflask\ Scripts\pip Install Flask-sqlalchemyflask\scripts\pip install SQLALCHEMY-MIGRATEFLASK\SCRIPTS\PIP Install Flask-whooshalchemyflask\scripts\pip Install Flask-wtfflask\scripts\pip Install FLASK-BABELFLASK\SCRIPTS\PIP Install Flup
Let's start our journey.
Create the structure of the program (think of what to add, the moment has not thought how to partition it ...) )
Microblog-app
__init__.py
views.py
-static
-templats
run.py


Initialize app\__init__.py

 from Import  = Flask (__name__)fromimport views

Writing an attempt to function

# app\views.py  from Import App@app.route ('/') @app. Route ('/index')  )def  index ():    Pass

The final step to making the Web app fully operational is to create a script that launches the application Web server we developed.

# sicroblog\run.py  from Import app if __name__ " __main__ " :    app.run (Debug=true)

Debug =true Open Debug mode

At this point you can run the program, open the http:\\127.0.0.1:5000 in the browser, although nothing appears, but you have succeeded in the first step

Python+mysql+flask Create a Weibo app (continuous update)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.