Installation ============ Requirements ------------ Defernia is made with several open source softwares. Defernia depends on the following softwares: Python_ 2.6--2.7 or PyPy_ 1.5+ The Defernia system is mostly written in Python_ programming language. There's big incompatibility between Python 2.x and Python 3.x, so you must not use Python 3.0 nor more. It works on PyPy_ 1.5+ as well. PostgreSQL_ 8.3+ or SQLite_ 3+ Defernia uses :abbr:`RDBMS (relational databases)` to store data. Recommend PostgreSQL_ for production use and SQLite_ for development-purpose. .. note:: It probably works well on MySQL_ also, but we don't recommend it. Any other many Python packages Defernia depends on any other many Python packages listed following, but you can be free from these libraries. Because these libraries are installed automatically. - Mercurial_ - SQLAlchemy_ - Flask_ (Werkzeug_ and Jinja_) .. note:: **How to install the above softwares from Debian/Ubuntu Linux**: .. sourcecode:: console $ apt-get install python postgresql # production $ apt-get install python sqlite3 # development .. _Python: http://www.python.org/ .. _PyPy: http://pypy.org/ .. _PostgreSQL: http://www.postgresql.org/ .. _SQLite: http://www.sqlite.org/ .. _MySQL: http://www.mysql.com/ .. _Mercurial: http://mercurial.selenic.com/ .. _SQLAlchemy: http://www.sqlalchemy.org/ .. _Flask: http://flask.pocoo.org/ .. _Werkzeug: http://werkzeug.pocoo.org/ .. _Jinja: http://jina.pocoo.org/ Easy way -------- The easiest way to install Defernia is just using pip_. It downloads Defernia itself and resolves dependencies also automatically. .. sourcecode:: console $ pip install hg+https://bitbucket.org/dahlia/defernia .. _pip: http://www.pip-installer.org/ Hard way -------- Defernia is an ordinary Python package that follows the standard Python distribution way. It means that you can download the Defernia source code and install it by yourself. .. sourcecode:: console $ hg clone https://bitbucket.org/dahlia/defernia $ cd defernia/ defernia$ python setup.py install If setuptools_ or Distribute_ is installed in your system, :file:`setup.py` must have resolved its dependencies automatically as well. .. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools .. _Distribute: http://packages.python.org/distribute/ .. _using-virtualenv: Using virtualenv_ ----------------- If you have an idea to develop Defernia (and contribute to it), virtualenv_ would be helpful. It helps to isolate the working Python site-packages environemt from the system global site-packages environment. If there's no installed :program:`virtualenv` command in your system yet, install it first: (It might need a system administrator permission: use :command:`sudo` then.) .. sourcecode:: console $ easy_install virtualenv .. note:: Most of Linux distributions provide :program:`virtualenv` as package. For example, in Debian or Ubuntu like APT-based distributions you can install it like: .. sourcecode:: console $ apt-get install python-virtualenv And then, make your isolated environment for Defernia development via :program:`virtualenv`: .. sourcecode:: console $ virtualenv --distribute defernia-env defernia-env$ cd defernia-env/ (defernia-env)defernia-env$ source bin/activate The last command makes your command line prompt to enter the created :file:`defernia-env` enviroment. The ``(defernia-env)`` prefix indicates where you are in. When you want to back from here, type :program:`deactivate` in the prompt. What you have to do next is to checkout the Defernia source code. .. sourcecode:: console (defernia-env)defernia-env$ hg clone https://bitbucket.org/dahlia/defernia (defernia-env)defernia-env$ cd defernia/ To install Defernia in development mode and resolve the dependencies, use :program:`setup.py develop` subcommand instead of :program:`setup.py install`. .. sourcecode:: console (defernia-env)defernia$ python setup.py develop It's finished. Now you can hack the Defernia system. .. note:: :program:`hg` is a command provided by Mercurial_. .. _Mercurial: http://mercurial.selenic.com/ .. _virtualenv: http://www.virtualenv.org/