4

I have a django project (a django module/app some other modules that are used from the django one) that uses SQLite. This project is for a University course and now I am asked to supply it in such a way so that it may be installed on some server in our faculty. I'm not the one who's going to install it, and I will not be contacted in case of failure, so I am looking for the easiest, simplest way to supply the project for installation.

I have come across django-jython which supposedly allows one to create WAR files from django projects. However, in the Database Backends section, it says:

SQLite3
Experimental. By now, use it only if you are working on improving it. Or if you are really adventurous.

My overall goal is to deliver this project and I would appreciate any helpful advice. In particular:

  • Is there another way to pack a django project into a WAR file that supports SQLite?
  • Is it safe to use SQLite with django-jython in spite of this warning? If so, then how?
  • Is there any other simple way to pack a django project so that it'll be a piece of cake to install?
  • If the above answers are "no", then what does it take to change the configuration of the project to use MySQL instead?
Amir Rachum
  • 67,681
  • 68
  • 159
  • 239
  • I've no clue about WAR files or jython, but you might look into virtualenv and pip (specifically, the requirements file) to make deployment easier. Easiest form of distribution for most django apps is a git/hg repo hosted on github/bitbucket (as pip can download via hg and git protocols); for a uni project, though, a simple zip file containing the project and requirements.txt should do. Of course, this all depends on the instructor knowing how to use virtualenv and pip... – eternicode Jun 23 '11 at 04:34
  • can you give more information about the server setup/use case? Does this need to run under apache? What database options are available on the server? – Thomas Jun 23 '11 at 06:14
  • 1
    what about supplying a small script with all the necessary files that will put everything in the right places? It could ask for input about file locations if that is something that needs to be done. – chandsie Jun 23 '11 at 23:58

1 Answers1

1

You should look into Fabric for easy deployment. I haven't used it myself, but I've heard good things. I've also had good success quickly and easily setting up servers using Gunicorn with Nginx as a reverse-proxy.

As others have said, using virtualenv, with pip, can quickly get all your dependencies installed via requirements.txt (from virtualenv).

Some of these blog posts may help:

Edit:

As I reread your post I saw your last bullet point/question. Django is designed to be loosely coupled, meaning that there shouldn't (in most cases) be reasons that one app is dependant on sqlite vs mysql. If you don't need to save the data in the db, changing to MySQL is as easy as starting a mysql server on your machine, and changing the settings.py of your django project. This SO question may help

Community
  • 1
  • 1
j_syk
  • 6,023
  • 2
  • 36
  • 53