开发一个全栈网页的步骤

Posted CHNMSCS

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了开发一个全栈网页的步骤相关的知识,希望对你有一定的参考价值。

Steps for getting a database-backed web application up and running
This is an overview of the list of tasks we’ll need to do for a given web app to run with a database.

  1. Create a database
    Using createdb in Postgres

  2. Establish a connection to the database
    We can connect to a Postgres server from a Python web server using pyscopg2 with psycopg2.connect()

  3. Define and create your data schema
    Execute CREATE TABLE commands to create the tables and define the schema (attributes, data types, etc) that will define what data gets housed for our web app.

  4. Seed the database with initial data
    (Optional) Give the database some initial data, e.g. test data for doing local development.

  5. Create routes and views
    Create routes in our server that will serve pages (views) to the client. Write up our html, CSS, and javascript in our views.
    Then finally, to get our web app running

  6. Run the server
    Get the web server running.

  7. Deploy the server to the web
    … and that is, generally, how we would build a web application backed by a database.

以上是关于开发一个全栈网页的步骤的主要内容,如果未能解决你的问题,请参考以下文章

python全栈开发第十三篇Python面向对象

Java全栈web网页技术:4.jQuery

Java全栈web网页技术:4.jQuery

Python全栈开发之13CSS

Python全栈开发-web框架之django

Python全栈开发之路 第十八篇:Ajax技术