1

I am getting this error message when I try to run the shell from Eclipse Neon while I can successfully run the Django shell from command window. I am using Python 3.4 and Django 1.10. Any idea where the problem is?

enter image description here

WSGI file:

'''
WSGI config for MyProject project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
'''

import os
from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MyProject.settings")

application = get_wsgi_application()
12
  • I don't know why @Hybrid deleted his answer because "You have an accidental indentation in your wsgi.py file" Commented Dec 30, 2016 at 6:58
  • But then again this question is off topic because it's a typo Commented Dec 30, 2016 at 6:59
  • @e4c5 "wsgi.py" file is generated by django and I have not touched it, so I doubt it is a typo. plus, I can run it from command prompt. Commented Dec 30, 2016 at 20:48
  • Well the error still says extra space so why don't you open it and see? Commented Dec 31, 2016 at 1:28
  • @e4c5 I checked "wsgi.py" file, there is no unexpected indent. Should I look somewhere else? Commented Jan 3, 2017 at 22:00

1 Answer 1

2

I beleive This is a known bug in Eclipse Pydev.

https://www.brainwy.com/tracker/PyDev

Fixed for 5.6

Git: 2c8cd03 2017-03-12 Fabio Zadrozny #PyDev-752: Django version not detected if > 1.10

And a fix has been posted for it.

You could try start a python shell as normal, then:

import sys; print('%s %s' % (sys.executable or sys.platform, sys.version))
import os; os.environ['DJANGO_SETTINGS_MODULE'] = '<Project Name>.settings'; import django
sys.path.append(os.path.expanduser('<path to your project>'))
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

Replace 'Project Name' with your project name and 'path to your project' with your path

alternatively, use a pre 1.10 version of Django i.e 1.7

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.