


Detailed tutorial on installing and building django1.10.3 and Apache2.4 under windows10
Recently, I have discovered that many tutorials are built on Linux. Windows seems not to be naturally suitable, but I am still willing to try this pit. The following article mainly introduces you to the method of installing and building django1.10.3 and Apache2.4 under Windows 10 system. Friends in need can refer to it. Let’s take a look together.
Environment introduction
python3.5.2 64-bit
django 1.10.3
apache 2.4 64-bit
windows 10
The focus is on apache.
I believe that everyone who is interested in reading this article already knows about python and django.
Install Apache2.4
Address: www.apachelounge.com/download/
Download: vc_redist.x64. exe direct installation vc_redist_x64/86.exe.
Download: httpd-2.4.17-win64-VC14.zip
Configure environment variables: add path to D:\Apache24\bin;
Extract to the specified directory and modify the configuration file: http.conf (Change the ServerRoot in the following content to your own actual Apche decompression path)
ServerRoot "D:/Apache24" …… Listen 127.0.0.1:8081 #修改端口号 …… ServerName www.example.com:8081 …… DocumentRoot "D:/Apache24/htdocs" <Directory "D:/Apache24/htdocs"> …… ScriptAlias /cgi-bin/ "D:/Apache24/cgi-bin/" …… <Directory "D:/Apache24/cgi-bin"> AllowOverride None Options None Require all granted </Directory>
Start the apache service:
cmd>httpd
127.0.0.1:8081/index.html
It works! apache configuration successful
install mod_wsgi
Install first: pip install wheel
Installmod_wsgi-4.4.23+ap24vc14-cp35-cp35m-win_amd64.whl
Download: mod_wsgi-4.4.23+ap24vc14-cp35-cp35m-win_amd64.whl
Address: www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi
pip installation: pip install mod_wsgi-4.4.23+ap24vc14-cp35-cp35m-win_amd64.whl
Configure Apache2.4, mod_wsgi, Django project engineering
1. Copy C:\Python35\mod_wsgi.so to D:\Apache24\modules
(mod_wsgi. so can only be found after mod_wsgi-4.4.23+ap24vc14-cp35-cp35m-win_amd64.whl
is installed successfully)
2. Modify the http.conf file of apache2.4:
#添加mod_wsgi.so 模块 LoadModule wsgi_module modules/mod_wsgi.so
3. Configure the django project and modify http.conf
#添加mod_wsgi.so 模块 LoadModule wsgi_module modules/mod_wsgi.so #指定静态资源路径 Alias /statics/ F:/pydj/newsCollection/toutiao/statics/ <Directory F:/pydj/newsCollection/toutiao/statics> Require all granted </Directory> #指定newsCollection项目的wsgi.py配置文件路径 WSGIScriptAlias / F:/pydj/newsCollection/newsCollection/wsgi.py #指定项目路径 WSGIPythonPath F:/pydj/newsCollection <Directory F:/pydj/newsCollection/newsCollection> <Files wsgi.py> Require all granted </Files> </Directory>
wsgi.py content:
import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myweb.settings") from django.core.wsgi import get_wsgi_application application = get_wsgi_application()
#Note that myweb above is changed to your own project name, such as newsCollection in the picture above. Refer to the directory structure in the picture above.
Configuring the django project setting.py
ALLOWED_HOSTS = ['127.0.0.1', 'localhost']
Finally, let me tell you that there will be a log when Apche starts an error, httpd-2.4. 23-x64-vc14-r3\Apache24\logs directory error information, troubleshoot slowly
Summary
The above is the detailed content of Detailed tutorial on installing and building django1.10.3 and Apache2.4 under windows10. For more information, please follow other related articles on the PHP Chinese website!

TomergelistsinPython,youcanusethe operator,extendmethod,listcomprehension,oritertools.chain,eachwithspecificadvantages:1)The operatorissimplebutlessefficientforlargelists;2)extendismemory-efficientbutmodifiestheoriginallist;3)listcomprehensionoffersf

In Python 3, two lists can be connected through a variety of methods: 1) Use operator, which is suitable for small lists, but is inefficient for large lists; 2) Use extend method, which is suitable for large lists, with high memory efficiency, but will modify the original list; 3) Use * operator, which is suitable for merging multiple lists, without modifying the original list; 4) Use itertools.chain, which is suitable for large data sets, with high memory efficiency.

Using the join() method is the most efficient way to connect strings from lists in Python. 1) Use the join() method to be efficient and easy to read. 2) The cycle uses operators inefficiently for large lists. 3) The combination of list comprehension and join() is suitable for scenarios that require conversion. 4) The reduce() method is suitable for other types of reductions, but is inefficient for string concatenation. The complete sentence ends.

PythonexecutionistheprocessoftransformingPythoncodeintoexecutableinstructions.1)Theinterpreterreadsthecode,convertingitintobytecode,whichthePythonVirtualMachine(PVM)executes.2)TheGlobalInterpreterLock(GIL)managesthreadexecution,potentiallylimitingmul

Key features of Python include: 1. The syntax is concise and easy to understand, suitable for beginners; 2. Dynamic type system, improving development speed; 3. Rich standard library, supporting multiple tasks; 4. Strong community and ecosystem, providing extensive support; 5. Interpretation, suitable for scripting and rapid prototyping; 6. Multi-paradigm support, suitable for various programming styles.

Python is an interpreted language, but it also includes the compilation process. 1) Python code is first compiled into bytecode. 2) Bytecode is interpreted and executed by Python virtual machine. 3) This hybrid mechanism makes Python both flexible and efficient, but not as fast as a fully compiled language.

Useaforloopwheniteratingoverasequenceorforaspecificnumberoftimes;useawhileloopwhencontinuinguntilaconditionismet.Forloopsareidealforknownsequences,whilewhileloopssuitsituationswithundeterminediterations.

Pythonloopscanleadtoerrorslikeinfiniteloops,modifyinglistsduringiteration,off-by-oneerrors,zero-indexingissues,andnestedloopinefficiencies.Toavoidthese:1)Use'i


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver Mac version
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
