Are there problems developing Django on Jython?

The background

I'm building a fair-sized web application with a friend in my own time, and we've decided to go with the Django framework on Python. Django provides us with a lot of features we're going to need, so please don't suggest alternative frameworks.

The only decision I'm having trouble with, is whether we use Python or Jython to develop our application. Now I'm pretty familiar with Java and could possibly benefit from the libraries within the JDK. I know minimal Python, but am using this project as an opportunity to learn a new language - so the majority of work will be written in Python.

The attractiveness of Jython is of course the JVM. The number of python/django enabled web-hosts is extremely minimal - whereas I'm assuming I could drop a jython/django application on a huge variety of hosts. This isn't a massive design decision, but still one I think needs to be decided. I'd really prefer jython over python for the jvm accessibility alone.

Questions

Does Jython have many limitations compared to regular python? Will running django on jython cause problems? How quick is the Jython team to release updates alongside Python? Will Django work as advertised on Jython (with very minimal pre-configuration)?

Decision

Thanks for the helpful comments. What I think I'm going to do is develop in Jython for the JVM support - but to try to only use Python code/libraries. Portability isn't a major concern so if I need a library in the JDK (not readily available in python), I'll use it. As long as Django is fully supported, I'm happy.


Asked by: Samantha482 | Posted: 24-09-2021






Answer 1

Django does work on Jython, although you'll need to use the development release of Jython, since technically Jython 2.5 is still in beta. However, Django 1.0 and up should work unmodified.

So as to whether you should use the regular Python implementation or Jython, I'd say it's a matter of whether you prefer having all the Java libraries available or all of the Python libraries. At this point you can expect almost everything in the Python standard library to work with Jython, but there are still plenty of third-party packages which will not work, especially C extension modules. I'd personally recommend going with regular Python, but if you've got a ton of JVM experience and want to stick with what you know, then I can respect that.

As for finding Python hosting, this page might be helpful.

Answered by: Stuart139 | Posted: 25-10-2021



Answer 2

I'd say that if you like Django, you'll also like Python. Don't make the (far too common) mistake of mixing past language's experience while you learn a new one. Only after mastering Python, you'll have the experience to judge if a hybrid language is better than either one.

It's true that very few cheap hostings offer Django preinstalled; but it's quite probable that that will change, given that it's the most similar environment to Google's app engine. (and most GAE projects can be made to run on Django)

Answered by: Thomas894 | Posted: 25-10-2021



Answer 3

I have recently started working on an open source desktop project in my spare time. So this may not apply. I came to the same the question. I decided that I should write as much of the code as possible in python (and Django) and target all the platforms CPython, Jython, and IronPython.

Then, I decided that I would write plugins that would interface with libraries on different implementations (for example, different GUI libraries).

Why? I decided early on that longevity of my code may depend on targeting not only CPython but also virtual machines. For today's purposes CPython is the way to go because of speed, but who knows about tomorrow. If you code is flexible enough, you may not have to decide on targeting one.

The downside to this approach is that you will have more code to create and maintain.

Answered by: Elise460 | Posted: 25-10-2021



Answer 4

Django is supposed to be jython-compatible sinc version 1.0.

This tutorial is a bit outdated, but from there you can see there are no special issues.

Answered by: Chester904 | Posted: 25-10-2021



Similar questions

java - Platform for developing all things google?

I am interested in developing things for google apps and android using python and java. I am new to both and was wondering if a environment set in windows or linux would be more productive for these tasks?


module - Developing and using the same Python on the same computer

I'm developing a Python utility module to help with file downloads, archives, etc. I have a project set up in a virtual environment along with my unit tests. When I want to use this module on the same computer (essentially as "Production"), I move the files to the mymodule directory in the ~/dev/modules/mymodule I keep all 3rd-party modules under ~/dev/modules/...


python - Developing a RIA with Django - what technology stack?

I need to develop a web application with the following requirements: Desktop like UI on the client side Application deployment Scalability (i.e. distributing the service on multiple servers) What I thought of so far (as I love Python but haven't done much web development yet): Django Fabric (think I've read somewhere it's suited for this) ...


python - How to perform TDD when developing a Django API

When doing TDD on a Django app API, I write tests demonstrating that when proper constraints are provided, expected results are achieved. How do I write tests for the infinite permutations of cases where inputs are 'wrong'. Two things come to mind: 1) I shouldn't break the dynamic aspect of python by type-checking every input, and 2) I should be testing "interesting" functions or methods (not getter...


python - Django static files when locally developing - how to serve absolutely?

This should be super simple, but somehow its has had me stuck all morning. I'm developing locally, using the django debug server, and with this filestructure: /project/ (django project) /static/ (static files) In the settings.py MEDIA_ROOT and MEDIA_URL are both set to '/static/' and I'm using this in my urls.py url(r'^(?P<path>.*)$', 'django.views.static.serve', {'do...


Developing Python Module

I'd like to start developing an existing Python module. It has a source folder and the setup.py script to build and install it. The build script just copies the source files since they're all python scripts. Currently, I have put the source folder under version control and whenever I make a change I re-build and re-install. This seems a little slow, and it doesn't settle well with me to "commit" my changes to my py...


sockets - Developing T.120 protocol in Python

I am creating a chat application which supports chat, group chat, file sharing, whiteboard(not mandatory). I make it own to contribute fedora. if anyone wants to join to grow it welcome(shantanubanerjee75@gmail.com). Netmeeting works on T.120 protocol but didn't find any way to use it. Is there any protocol in linux which support my requirements? is there any way to write a own application protocol in python with few heade...


python - What steps do i need to take to start developing iPhone apps?

This question already has answers here:


python - Developing and Publishing Custom Django Modules

How should I create a Django app for 3rd party use? I've been hacking on something lately and I'd like to put it up on GitHub and let it loose. How should I structure it? Is there a way I can use it without having to store an entire Django project around it in the repository? How can I test it locally inside of another project? I'm kind of new at this, so I'm sorry. In the past, I've used Buildout to build my proj...


java - Hadoop - Saving Log Data and Developing GUI

I am doing research for my new project, Following is the details of my project, research and questions: Project: Save the Logs (ex. format is TimeStamp,LOG Entry,Location,Remarks etc ) from different sources. Here Different sources is like, gettting the LOG data from the different systems world wide (Just an Overview) (After saving the LOG Entries in Hadoop as specified in 1) Genera...






Still can't find your answer? Check out these communities...



PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python



top