I'm trying to deploy a django app as war (to use with JBOSS server). I have seen the documentation and I made this:
jython manage.py builder --include-java-libs=/usr/share/java/jython/jython.jar
And I have this error:
Traceback (most recent call last):
File "manage.py", line 16, in <module>
raise ImportError(
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
What should I do? Thanks.
You have not activated that environment where you installed Python and other dependent packages for application.
Activate the environment and then run:
jython manage.py builder --include-java-libs=/usr/share/java/jython/jython.jar
Then it will work for you.
Try this:
jython -m pip list
In the list check the package name django is there or not. Also, check for package django-jython.
To install this package to jython installation directory, run this command:
jython -m pip install django
jython -m pip install django-jython
To build war file, use this command:
jython manage.py buildwar --include-java-libs=/path/to/jython-standalone.jar