Host Django with XAMPP on Windows

前端 未结 5 819
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-30 11:59

Can I run a Django (Python framework) base site with XAMPP on Windows? Please guide me.

5条回答
  •  一个人的身影
    2021-01-30 12:30

    XAMPP for windows contains: Apache, MySQL, PHP + PEAR, Perl, mod_php, mod_perl, mod_ssl, OpenSSL, phpMyAdmin, Webalizer, Mercury Mail Transport System for Win32 and NetWare Systems v3.32, Ming, JpGraph, FileZilla FTP Server, mcrypt, eAccelerator, SQLite, and WEB-DAV + mod_auth_mysql.

    There are two requirements to run django missing:

    • Python
    • mod_wsgi

    So, NO, you can't run django with XAMPP alone. You need to install additional software.

    However running django is very easy. If you just want to develop an application, you only need python and django. Django itself includes an internal web server that can be used for development.

    If you want to use django on windows for a production server, you don't even need the apache web server. You could install just:

    • Python
    • cherrypy

    That's enough to have a good django production server up and running, since cherrypy's web server is written in python and is pretty good to serve django (or any other wsgi-compatible) applications. If you're not using apache for anything else I think this setup is actually better and easier. There are other webservers you could use instead of cherrypy. But if you really want to use apache, you also need mod_wsgi.

提交回复
热议问题