Last update at :2024-07-07,Edit by888u
The recommended system version is centos7 64-bit.
1. Environment requirements Python3.6.5, mysql5.7, nginx (optional).
2. Environment setup python3.6.5 reference http://blog.51cto.com/wenguonideshou/2083301, there is a problem with the soft link address, please read the reply Mysql5.7 installation, refer to https://blog.csdn.net/qq_38663729/article/details/79327305 For python-dev installation, refer to https://blog.csdn.net/default7/article/details/73368665 To install program dependencies, enter the program directory and enter: pip3 install -r requirements.txt
3. Program installation Modify the database configuration in the settings.py file under silumz DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'xxxx', 'USER': 'root', 'PASSWORD': 'xxxx', 'HOST': '127.0.0.1', 'PORT': '3306', } } Create the corresponding database and import the sql file in the program directory Modify the nginx configuration file (centos7 /etc/nginx/nginx.conf) The location field in the server of the configuration file is modified as follows location/{ proxy_pass http://127.0.0.1:8000; index index.html index.htm; } Restart nginx and visit the website.
4. Modify the database address in the crawler db = pymysql.connect("127.0.0.1", "root", "xxxx", "xxxx")
5. Start the program Enter the program directory uwsgi --ini uwsgi.ini
6. Template modification Modify the template configuration in the settings file under silumz TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates'+"/"+"94imm")] 94imm is the template name The template file is located in the templates folder, modify the corresponding page
7. Other configurations Place the pagination.html file in the template directory under /site-packages/dj_pagination/templates/pagination/ in the python installation directory (centos7 /usr/lib/python3.6/site-packages/dj_pagination/templates/pagination)
8. Remarks For other systems, please Baidu mysql python3.6.5 nginx installation method, the program installation method is the same
Source code download: zxy_coding-94imm-20181224
Source code hosting: https://coding.net/u/zxy_coding/p/94imm/git
Recommended site searches: Mainland China PHP Space Unicom virtual host, Buy Space Network, American server website, how to build a server, free domain name, telecom server rental, independent IP virtual host, cloud host rental, private server
发表评论