apache:
在httpd.conf后面追加代码
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 LoadModule wsgi_module modules/mod_wsgi.so
2 Include "F:/mm/mysite/mysite.conf"
django:
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 <VirtualHost *:80>
2 WSGIScriptAlias / "F:/mm/mysite/django.wsgi"
3
4 <Directory "F:/mm/mysite">
5 Allow from all
6 </Directory>
7
8 <Directory "F:/mm/mysite/mysite">
9 Allow from all
10 </Directory>
11
12 <Directory "F:/mm/mysite/mysite/templates">
13 Allow from all
14 </Directory>
15
16 </VirtualHost>
wsgi:
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 import os,sys
2 apache_configuration= os.path.dirname(__file__)
3 project = os.path.dirname(apache_configuration)
4 workspace = os.path.dirname(project)
5 sys.path.append(apache_configuration)
6
7
8 os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
9 import django.core.handlers.wsgi
10 application = django.core.handlers.wsgi.WSGIHandler()