I am unable to host a basic django project in IIS. I have been breaking my head over 2 days now and help would be greeeaaatly appreciated :).
I have enabled IIS, CGI, and others under the Application Development in IIS. This is my folder structure after creating a simple django project via the below command:
django-admin startproject dijky
Folder structure:
+ C:\inetpub\wwwroot
+ dijky
+ dijky
- __init__.py
- settings.py
- urls.py
- wsgi.py
- manage.py
- web.config
- wfastcgi.py
I have copied the wfastcgi.py file into my project folder.
I have then Added a website named "dijky" with the below settings
Under the Machine name in IIS, Clicked on FastCGI Settings, and have given the Full path and Arguments as so:
Then gave the environment variables as:
I even tried setting the WSGI_HANDLER to dijky.wsgi.application, since the file C:\inetpub\wwwroot\dijky\dijky\wsgi.py has:
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dijky.settings")
application = get_wsgi_application()
Both don't work
My web.config XML file is:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="djangoappiis" path="*" verb="*" modules="FastCgiModule" scriptProcessor="C:\Users\xxxxxxx\Anaconda3\envs\djangy\python.exe|C:\inetpub\wwwroot\dijky\wfastcgi.py" resourceType="Unspecified" />
</handlers>
</system.webServer>
<appSettings>
<!-- Required settings -->
<add key="WSGI_HANDLER" value="django.core.wsgi.get_wsgi_application()" />
<add key="PYTHONPATH" value="C:\inetpub\wwwroot\dijky" />
<add key="DJANGO_SETTINGS_MODULE" value="dijky.settings" />
</appSettings>
</configuration>
After Starting the server I am not able to see the default django page that I we get on 127.0.0.1:8000.
I tried localhost:8007 on my browser but get a 500 error.
Any experts out there who can help.