0

I started developing a django webapp which will need to connect to oracle databases. But using oracle with django requires an Oracle client if I'm not mistaken which is platform dependant. If it's not possible to create a portable webapp with django and oracle, could the app use an oracle client install on the machine where the app is running?

Thanks

Cyrille MODIANO
  • 2,246
  • 2
  • 21
  • 33

1 Answers1

0

What do you mean by "portable" exactly ? You can definitely move your Django folder around, especially if you use SQLite for database storage, since a SQLite database is just a file.

All you'll need is Python on the target machine, access to the command line and the ability to install your dependencies with pip.

Then you can just run your webapp with python manage.py runserver.

If this doesn't answer your question, please give more info.

Brachamul
  • 1,886
  • 2
  • 21
  • 34
  • portable means I can package the app and run it on any system. I already use SQLite for my main database but the app also have to connect to Oracle to collect data. That is the part which will probably causing problem for the portability because the oracle client is platform dependent. – Cyrille MODIANO Nov 13 '17 at 21:51
  • You can get portable python using WinPython or PythonXY (see https://winpython.github.io). Then you can use http://www.py2exe.org/ to make it into an executable. However, packaging your Django app into a single executable seems... counter-productive ? Maybe this answer would inspire your : https://stackoverflow.com/questions/5458048/how-to-make-a-python-script-standalone-executable-to-run-without-any-dependency – Brachamul Nov 13 '17 at 22:43
  • Ok for python, my main concern is about the oracle dependency. If I understand correctly py2exe or other tools will take care of the python dependencies, but for oracle either the user will need an oracle client installed or I'll have to package the app with a different client for each system. – Cyrille MODIANO Nov 14 '17 at 08:18
  • I think you can use this python package as an oracle client : https://github.com/oracle/python-cx_Oracle – Brachamul Nov 14 '17 at 12:58
  • thanks but cx_Oracle needs and oracle client as well. – Cyrille MODIANO Nov 14 '17 at 13:39
  • It looks like there is a portable Oracle client you could bundle with everything else : http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html – Brachamul Nov 15 '17 at 17:24
  • I looked at the page but the installation says: « Download the desired Instant client packages for your platform ». It’s platform dependent. – Cyrille MODIANO Nov 15 '17 at 17:53