Home>Article>Backend Development> How to use python to build a website
How to use python to build a website?
Steps to build a website in python:
1. Import the django package
Can be downloaded directly from pycharm, or pip/easy_install
Django is an open source web application framework, powered by Python written. The framework pattern of MTV is adopted, namely model M, view V and template T. It was originally developed to manage some of the news content-based websites of Lawrence Publishing Group, that is, CMS (Content Management System) software.
2. Set environment variables
path add C:\Python27\Lib\site-packages\django\bin;C:\Python27\Scripts
3. Create a new project
D:\>django-admin.py startproject mysite
4. Create a new app under the project
D:\mysite> python manage.py startapp blog
5. Initialize the admin background database
D:\mysite>python manage.py migrate
6. Start the service
D:\mysite>python manage.py runserver
Note:
HTML, Javascript and CSS are three must-learn lessons. Python is simple, easy to get started with, and can do many things. It can range from writing scripts to building websites, data analysis, etc.
As for how the website can be accessed, here are several methods:
1. You can buy links on Baidu, Google and other search engines, or promote links! However, the cost is higher!
2. Or in other forums, when speaking in a space, you need to pay your own website domain name and a brief introduction. cheap!
3. Or find people online to send promotion links to achieve the purpose of promotion! However, there are prerequisites for promotion. Your website must be novel and creative! The direction is good and suitable for most people’s appetites!
So there is the second type, the cheapest one! Post on major forums about your website, many people will visit it, but don’t post randomly, be careful of being blocked by the administrator or reported!
Related recommendations: "Python Tutorial"
The above is the detailed content of How to use python to build a website. For more information, please follow other related articles on the PHP Chinese website!