Valentine's day with Python to write a website to express it!

osc_ ixxabuu0 2021-01-23 13:10:45
valentine day python write website

Valentine's Day is coming , The majority of male compatriots are going to give girlfriends what gifts ? masks ? Lipstick ? Better use python Write a website to tell her ! Simple animation + I want to see you bgm, Who else can't ?

Can't python? I can't write websites ? As long as you can understand print('hello world') One more computer is enough ,python+Django+php+mysql+html as long as 30 It can be deployed in minutes , It can not only capture the heart of a girl, but also learn to program . What are we waiting for? , Let's get started .

Get ready

  • A computer (Windows、mac All possible , Little bully can't )

  • One server ( Deploy to the server to make ta You can see it everywhere , Or send your computer to ta see ?)

  • Basic programming knowledge ( Can understand print('hello world') That's enough )

  • Related software :navicat,anaconda,mysql,filezilla etc. ( If not, I need to review my previous articles )



In a nutshell , There are only three steps

  • To configure Django

  • To configure php

  • Revise the relevant copy 、bgm.

Just like the previous deployment of the epidemic tracking page , The first page of this confession uses html+css+js Make , No, it's okay. , As long as the basic line of code configuration, and then directly upload the entire source code . The second page uses php Make , No, it doesn't matter , It's still configured php Environmental Science , Source code ( At the end of the article ) Just upload the whole thing . Two pages need to deploy the environment in my previous articles have detailed fool tutorial guidance , So this article will skip .

One last word , Because the author is equivalent to writing from the perspective of God , And it's normal that Xiaobai or even Xiaobai can't understand some places for the first time , If there is any doubt or an unsolvable error , Welcome to leave a message .

To configure Django

Please make sure that your mysql、 Alibaba cloud security group deployment is completed according to the configuration in the previous article .

First filezilla Software ftp Connect to your own server ,ssh Also remotely connect to your own server , then cd Go to the root , perform

django-admin startproject love

filezilla Refresh the directory and find one in many places love Folder execution

cd love

The representative entered love Folder , Re execution

python startapp web

And then I'll download Django Source inside the whole love The folder uses filezilla Overlay upload to previous Directory ( Cover the first one love). then love Inside Download to local , Just change the database password inside to your database password . And then upload and overlay the original file .

thus Django It's almost done . Finally, execute

nohup python runserver &

Of course, make sure that you add 8000 port .( I won't read the previous article , Stupid tutorial )

thus , The first page is ok 了 . Browser open ip:8000 You can view it . Next, let's look at configuring the second page

To configure PHP

Download the whole php Source code .

apache install

First ssh Connect to your own server . Then perform the following code installation apache

yum install httpd

Next use filezille Software ftp Connect to your own server and find /etc/httpd/conf/httpd.conf Download the file locally , Then open it and make the following changes

#ServerName Change it to ServerName ip:8080
Listen:80 Change it to Listen:8080

It means to open 8080 port . After modification, it will be uploaded to the original directory .

Next, open the alicloud management console , take 8080 Add port to security group . Then go back to the command line and restart httpd service

systemctl start httpd.service

php Environmental installation

yum -y install php

Then install the dependent services

yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel php-mysql

So far it's done , By default , Yours php The file root directory is


Only need to php Source code filezilla Upload it to this folder and type it into your browser


You can see the website . Of course, the second page is opened in the first page , So the test opens successfully and it's over .

Change the text

thus , The two websites are all deployed , You need to change the text , This is even easier , The first page is related to index.html The related content of the second page in index.php in . Just open it with an editor and you can see the source code , Just change it to the text you want , Of course, if you have more front-end knowledge, you can add it freely / Modify the style 、 Animation and so on .

本文为[osc_ ixxabuu0]所创,转载请带上原文链接,感谢

  1. Experience of learning Python
  2. python7、8章
  3. Chapter 7 and 8 of Python
  4. python bool和str转换
  5. python——循环(for循环、while循环)及练习
  6. python变量和常量命名、注释规范
  7. python自定义异常捕获异常处理异常
  8. python 类型转换与数值操作
  9. python 元组(tuple)和列表(list)区别
  10. 解决python tkinter 与 sleep 延迟问题
  11. python字符串截取操作
  12. Python bool and STR conversion
  13. Python -- loop (for loop, while loop) and Practice
  14. Specification for naming and annotating variables and constants in Python
  15. Python custom exception capture exception handling exception
  16. Python type conversion and numerical operation
  17. The difference between tuple and list in Python
  18. Solve the delay problem of Python Tkinter and sleep
  19. Python string interception operation
  20. Python 100天速成中文教程,GitHub标星7700
  21. Python 100 day quick Chinese course, GitHub standard star 7700
  22. 以我的親身經歷,聊聊學python的流程,同時推薦學python的書
  23. With my own experience, I'd like to talk about the process of learning Python and recommend books for learning python
  24. python爬虫获取起点中文网人气排行Top100(快速入门,新手必备!)
  25. Python crawler to get the starting point of Chinese network popularity ranking Top100 (quick start, novice necessary!)
  26. 【Python常用包】itertools
  27. Itertools
  28. (国内首发)最新python初学者上手练习
  29. (国内首发)最新python初学者上手练习
  30. (first in China) the latest practice for beginners of Python
  31. (first in China) the latest practice for beginners of Python
  32. (数据科学学习手札104)Python+Dash快速web应用开发——回调交互篇(上)
  33. (data science learning notes 104) Python + dash rapid web application development -- callback interaction (Part 1)
  34. (数据科学学习手札104)Python+Dash快速web应用开发——回调交互篇(上)
  35. (data science learning notes 104) Python + dash rapid web application development -- callback interaction (Part 1)
  36. (資料科學學習手札104)Python+Dash快速web應用開發——回撥互動篇(上)
  37. (materials science learning notes 104) Python + dash rapid web application development -- callback interaction (Part 1)
  38. Python OpenCV 图片高斯模糊
  39. Python OpenCV image Gaussian blur
  40. Stargan V2: converse image synthesis for multiple domains reading notes and Python code analysis
  41. 零基础入门Python:基本命令、函数、数据结构
  42. Python: basic commands, functions and data structures
  43. 毫无基础的人如何入门Python?从入门到进阶三份教程,拿走不谢
  44. How can a person without foundation get into Python? From the introduction to the advanced three tutorials, take away
  45. Python设计模式面向对象编程
  46. Python design pattern object oriented programming
  47. Python设计模式面向对象编程
  48. Python design pattern object oriented programming
  49. 怎么样描述你的数据——用python做描述性分析
  50. GitHub上3k+star的python爬虫库你了解吗?详解MechanicalSoup爬虫库
  51. python数据分析——在python中实现线性回归
  52. 疫情来袭,30分钟学会用python开发部署疫情可视化网站
  53. How to describe your data
  54. Do you know the python crawler Library of 3K + star on GitHub? Mechanical soup crawler Library
  55. Python data analysis -- realizing linear regression in Python
  56. When the epidemic strikes, learn to develop and deploy the visualization website of epidemic situation with Python in 30 minutes
  57. 手机上利用python进行数据分析——创建自己的远程jupyter notebook
  58. python数据类型的强制转换
  59. Using Python for data analysis on mobile phones -- creating your own remote jupyter notebook
  60. Mandatory conversion of Python data type