adrian rodas
adrian rodas

Reputation: 11

Django + IIS windows server 2008

Hi I am trying to install django on IIS by following this guide http://www.youtube.com/watch?v=kXbfHtAvubc#t=194 but at the end I always get this error

Python 3.4 Django 1.7.1 Windows Server 2008R2 IIS 7.5


file Wsgi.py

   import os
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Plastimi.settings")

from django.core.wsgi import get_wsgi_application application = get_wsgi_application()



Environment Variables

NAME : WSGI_HANDLER

VALUE: django.core.wsgi.get_wsgi_application()


Error occurred while reading WSGI handler: Traceback (most recent call last): File "C:\inetpub\wwwroot\Django\Plastimi\wfastcgi.py", line 711, in main env, handler = read_wsgi_handler(response.physical_path) File "C:\inetpub\wwwroot\Django\Plastimi\wfastcgi.py", line 568, in read_wsgi_handler return env, get_wsgi_handler(handler_name) File "C:\inetpub\wwwroot\Django\Plastimi\wfastcgi.py", line 541, in get_wsgi_handler handler = handler() File "c:\Python34\lib\site-packages\django\core\wsgi.py", line 14, in get_wsgi_application django.setup() File "c:\Python34\lib\site-packages\django__init__.py", line 20, in setup configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) File "c:\Python34\lib\site-packages\django\conf__init__.py", line 46, in getattr self._setup(name) File "c:\Python34\lib\site-packages\django\conf__init__.py", line 40, in _setup % (desc, ENVIRONMENT_VARIABLE)) django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. StdOut: StdErr:

Upvotes: 1

Views: 1676

Answers (1)

momsab
momsab

Reputation: 11

WSGI_HANDLER: replace django.core.handlers.wsgi.WSGIHandler() with django.core.wsgi.get_wsgi_application()

django.core.handlers.wsgi.WSGIHandler() is deprecated from 1.4

a good video tutorial with text explanation you can find on http://chrisberragan.com/posts/2014/03/19/installing-django-on-iis-7-5/

Upvotes: 1

Related Questions