Can I detect if my code is running on cPython or Jython?
Asked 07 September, 2021
Viewed 1.9K times
  • 65
Votes

I'm working on a small django project that will be deployed in a servlet container later. But development is much faster if I work with cPython instead of Jython. So what I want to do is test if my code is running on cPython or Jython in my settiings.py so I can tell it to use the appropriate db driver (postgresql_psycopg2 or doj.backends.zxjdbc.postgresql). Is there a simple way to do this?

5 Answer