{% extends "base.html" %} {% load i18n %} {% load staticfiles %} {% load manager_extras %} {% block title %}{% trans "Get the code" %}{% endblock %} {% block content %}
{% blocktrans %}Click here to download the last stable version. For installation instructions see below.{% endblocktrans %}
{% trans "download stable version:" %} 1.2rc1
{% blocktrans %}In short, these are the steps needed for an installation on a linux or OS X machine, with python already installed. If you want to develop, see the sections below.{% endblocktrans %}
{% blocktrans %}I personally like installing my development
files on a virtualenv, it helps keep the system more or less clean and are very
easy to set up, but you can skip this step if you don't mind installing all
dependencies system-wide (in that case, install django and the other applications
with a sudo
).{% endblocktrans %}
$ sudo apt-get install python-virtualenv
$ sudo apt-get install python-dev
$ virtualenv python-django
$ source python-django/bin/activate
{% blocktrans %}Get the application from PyPI, initialise and start it.{% endblocktrans %}
$ pip install wger
$ wger
{% blocktrans %}The script will, on first run, create a configuration file and a SQLite database with a standard superuser:{% endblocktrans %}
{% blocktrans %}You can later simply call wger
again to start
the application.{% endblocktrans %}
wger --help
to see available options{% endblocktrans %}{% blocktrans %}The code is hosted both on github and on bitbucket. If you are unfamiliar with mercurial or git, take a look at HG init or Pro Git. Both repositories are mantained in sync, so you should be able to work on either one (issues are only collected in github).{% endblocktrans %}
github (GIT) »
{% trans "the main repository. All work happens here." %}
git clone https://github.com/rolandgeider/wger.git
bitbucket (HG) »
{% trans "a mirror of the main repo." %}
hg clone https://bitbucket.org/rolandgeider/wger
{% blocktrans %}The file structure you get once you clone the repo should be self explaining:{% endblocktrans %}
{% blocktrans %}The installation procedure is very similar to the one described above. The notes and infos there also apply, so read that section too. First, install all packages:{% endblocktrans %}
$ sudo apt-get install python-virtualenv
$ sudo apt-get install python-dev
$ virtualenv python-django
$ source python-django/bin/activate
$ pip install -r requirements.txt
{% blocktrans %}Get the code and create a superuser:{% endblocktrans %}
$ git clone https://github.com/rolandgeider/wger.git
$ cd wger
$ python start.py
{% blocktrans %}That's it. You can either start the server again with
start.py
or do it the django way with
python manage.py runserver
.{% endblocktrans %}
{% blocktrans %}If you pull updates and there were database changes, you
can apply them with a simple python manage.py migrate --all
.{% endblocktrans %}
{% blocktrans %}For other ways of contributing besides code, you might want to take a look at the contribute page{% endblocktrans %}
pep8 --max-line-length=100--exclude="urls.py,*migrations*" wger
{% endblocktrans %}{% blocktrans %}If you want to host this with some other evironment (apache, postgreSQL, etc.), you need to perform some steps manually. First, install the necessary packages and dependencies as described before.{% endblocktrans %}
{% blocktrans %}Setup any database that Django supports. Then create a settings file and edit it as needed. There is another configuration file, settings_global.py that contains other global settings.{% endblocktrans %}
$ python extras/scripts/create_local_settings.py
{% blocktrans %}Initialise the database, create a super user and load these fixtures:{% endblocktrans %}
$ python manage.py syncdb
$ python manage.py migrate --all
$ python manage.py loaddata languages
$ python manage.py loaddata days_of_week
$ python manage.py loaddata muscles
$ python manage.py loaddata categories
$ python manage.py loaddata exercises
$ python manage.py loaddata ingredients
$ python manage.py loaddata weight_units
$ python manage.py loaddata ingredient_units
{% blocktrans %}What you do next depends on the server you use and how you
want to serve the application (mod_wsgi, fastCGI). There is a sample wsgi.py
file in the wger folder, edit it and adapt it to your needs and make the server
serve it, e.g. per mod_wsgi. Consult in any case the
django
documentation on the topic.{% endblocktrans %}