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.
-
Create a database
Using createdb in Postgres -
Establish a connection to the database
We can connect to a Postgres server from a Python web server using pyscopg2 with psycopg2.connect() -
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. -
Seed the database with initial data
(Optional) Give the database some initial data, e.g. test data for doing local development. -
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 -
Run the server
Get the web server running. -
Deploy the server to the web
… and that is, generally, how we would build a web application backed by a database.
最后
以上就是烂漫小甜瓜最近收集整理的关于开发一个全栈网页的步骤的全部内容,更多相关开发一个全栈网页内容请搜索靠谱客的其他文章。
发表评论 取消回复