Deploy Django on xampp server

By ukmodak | August 12th 2022 07:07:45 PM | viewed 257 times
step 1:

Set environment variavle on windows as

step 2: open terminal and run following command
pip install mod_wsgi=4.5.20
step 3: to get mod_wsgi path , open terminal and run following command and copy the path
mod_wsgi-express module-config
step 4: open this file http.conf and write the following code C:\xampp\apache\http.conf or on wamp :wamp64\bin\apache\apache2.4.39\conf
loadModule wsgi_module "path"
WSGIScriptAlias / "d:/dijango_project_location/demo/demo/"
WSGIPythonHome "c:/python36"
WSGIPythonPath "d:/dijango_project_location/demo/"

Alias /media/ d:/dijango_project_location/demo/media
Alias /media/ d:/dijango_project_location/demo/static

<Directory d:/dijango_project_location/demo/media>
   Require all granted

<Directory d:/dijango_project_location/demo/static>
   Require all granted

<Directory "d:/dijango_project_location/demo">
      Require all granted

step 5: if apper 400 error on localhost, then to go django project / and change the following line>
DEBUG = True
ALLOWED_HOSTS =['','localhost']
DEBUG = False

Total : 20171

Today :18

Today Visit Country :

  • China
  • United States
  • United Kingdom
  • Portugal
  • Canada
  • Russia