Can I run Django’s internal server for testing with Jython?
I’ve installed django-jython, but I get this message when I try to run the server:
jython manage.py runserver 8000
Traceback (most recent call last): File "manage.py", line 2, in <module>
from django.core.management import execute_manager
ImportError: No module named django
This means that Jython cannot find the ‘django’ module. Here, the first thing Jython is going to do is try to find the django module:
It fails, and throws
ImportError: No module named django.You should find out where your django module is, it should be a directory named ‘django’ that contains an
__init__.pyfile.Set your python path for jython to the parent directory. For example, if you find
/Users/cassiomelo/code/jython/Lib/site-packages/django/__init__.py, then you should add/Users/cassiomelo/code/jython/Lib/site-packagesto the python path. Click the link to see how to set it depending on your Jython version.The next time Jython will try to import the ‘django’ module, it will look in the directory of the python path if there is a directory named ‘django’ with an
__init__.pyin it and proceed to importing the core submodule, then management, then execute_manager.