Self hosted FLOSS fitness/workout, nutrition and weight tracker
Some improvements to the installation documentation
Roland Geider2903a5e60d06
diff --git a/docs/development.rst b/docs/development.rstindex 0a93395b2..60989a570 100644--- a/docs/development.rst+++ b/docs/development.rst@@ -17,7 +17,7 @@ and populate it with data on the first run::$ invoke create_settings \--settings-path /home/wger/wger/settings.py \--database-path /home/wger/wger/database.sqlite- $ invoke bootstrap_wger+ $ invoke bootstrap_wger \--settings-path /home/wger/wger/settings.py \--no-start-server$ python manage.py runserver@@ -28,75 +28,68 @@ That's it. You can log in with the default administator user:* **passsword**: adminYou can start the application again with the django server with-``python manage.py runserver``. If you pull updates and there were database-changes, you can apply them with a simple ``python manage.py migrate --all``.+``python manage.py runserver``.++.. _tips:Tips-----Moving important files-~~~~~~~~~~~~~~~~~~~~~~--The start script places the settings file and the sqlite database in a non-obvious place. For development I suggest moving them to the folder with the-code::-- $ cd wger- $ invoke config_location- Settings file: /home/user/.config/wger/settings.py- Database file: /home/user/.local/share/wger/database.sqlite-- $ mv /home/user/.config/wger/settings.py .- $ mv /home/user/.local/share/wger/database.sqlite-- # Update the path for the sqlite files in DATABASES section- $ vim settings.py---Miscellaneous settings-~~~~~~~~~~~~~~~~~~~~~~+Updating the code+~~~~~~~~~~~~~~~~~-The following settings can be very useful during development (add to your-settings.py):+When pulling updates from upstream there are a couple of things to consider.+These steps apply to all installation methods above.+Upgrading the database+``````````````````````-**Setting the email backend**- Use the console backend, all sent emails will be printed to it::+There are regularly changes and upgrades to the database schema (these may also+come from new versions of django or the installed dependencies). If you start+the development server and see a message that there are unapplied migrations,+just do ``python manage.py migrate --all``.- EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'+Downloading dependencies with Bower+```````````````````````````````````+Bower is used to download different JS and CSS libraries. If you update master+it is recommended that you first delete the existing libraries+(``rm wger/core/static/bower_components``) and then download the new versions+with::-Selectively running tests-~~~~~~~~~~~~~~~~~~~~~~~~~+ $ python manage.py bower install-If you do a ``python manage.py test`` you will run the complete testsuite, and-this can take a while. You can control which tests will be executed like this.-Test only the tests in the 'core' app::+Some info about bower, during the bootstrap process bower is installed locally+to src/wger. If this didn't work and you get an error saying that bower is not+installed, you can manually install it by going to the wger folder (not in the+project's root directory) and performing the step manually::- python manage.py test wger.core+ $ cd wger/wger+ $ npm install bower-Test only the tests in the 'test_user.py` file in the core app::+Alternatively, you can manually set the path to the bower binary by editing+``BOWER_PATH`` (see ``wger/settings_global.py``).- python manage.py test wger.core.tests.test_user-Test only the tests in 'StatusUserTestCase' in the file 'test_user.py` file in-the core app::+Clearing the cache+``````````````````- python manage.py test wger.core.tests.test_user.StatusUserTestCase+Sometimes there are changes to the internal changes of the cached structures.+It is recommended that you just clear all the existing caches+``python manage.py clear-cache --clear-all``+Miscellaneous settings+~~~~~~~~~~~~~~~~~~~~~~-Using runserver_plus-~~~~~~~~~~~~~~~~~~~~+The following settings can be very useful during development (add to your+settings.py):-During development you can use ``runserver_plus`` instead of the default django-server as you can use an interactive debugger directly from the browser if an-exception occurs. It also accepts the same command line options. For this just-install the following packages::- pip install django_extensions werkzeug- python manage.py runserver_plus [options]+**Setting the email backend**+ Use the console backend, all sent emails will be printed to it::+ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'Dummy data generator~~~~~~~~~~~~~~~~~~~~@@ -132,13 +125,38 @@ user will have 20 workouts and each exercise in each workout 30 log entries::While it is possible to generate hundreds of users, gyms are more restricted andyou will probably get duplicate names if you generate more than a dozen.-Installing Bower-~~~~~~~~~~~~~~~~-Bower should be installed in wger/wger not in the project's root directory::+Selectively running tests+~~~~~~~~~~~~~~~~~~~~~~~~~++If you do a ``python manage.py test`` you will run the complete testsuite, and+this can take a while. You can control which tests will be executed like this.++Test only the tests in the 'core' app::++ python manage.py test wger.core++Test only the tests in the 'test_user.py` file in the core app::++ python manage.py test wger.core.tests.test_user++Test only the tests in 'StatusUserTestCase' in the file 'test_user.py` file in+the core app::++ python manage.py test wger.core.tests.test_user.StatusUserTestCase+++Using runserver_plus+~~~~~~~~~~~~~~~~~~~~++During development you can use ``runserver_plus`` instead of the default django+server as you can use an interactive debugger directly from the browser if an+exception occurs. It also accepts the same command line options. For this just+install the following packages::++ pip install django_extensions werkzeug+ python manage.py runserver_plus [options]- $ cd ~/home/wger/wger- $ npm install bowerContributing------------@@ -159,9 +177,6 @@ Contributingpep8 tool (pip install pep8) from the command line (travis will do this as partof the tests): ``pep8 wger``-* **code for python3**: while the application should remain compatible with+* **Code for python3**: while the application should remain compatible withpython2, use django's suggestion to mantain sanity: code for py3 and treatpy2 as a backwards compatibility requirement. If you need, you can use six.--For other ways of contributing besides code, you might want to take a look at-the contribute page.diff --git a/docs/docker.rst b/docs/docker.rstindex 717858c2c..4d41e94b4 100644--- a/docs/docker.rst+++ b/docs/docker.rst@@ -2,7 +2,8 @@ Docker======There are docker files available to quickly get a version of wger up and-running. They are all located under ``extras/docker``.+running. They are all located under ``extras/docker`` if you want to build+them yourself.Developmentdiff --git a/docs/install.rst b/docs/install.rstindex ea6541ec6..dc9a29021 100644--- a/docs/install.rst+++ b/docs/install.rst@@ -14,8 +14,14 @@ The application is compatible and regularly tested with* sqlite, postgres* python 2.7, 3.4 and 3.5-See the :ref:`other-changes` section for content related changes to your-installation.+You might also want to take a look at the :ref:`other-changes` section for other+changes you might want to do to your local instance such as Terms of Service or+contact page.++.. note::+ Please note that all the steps related to upgrading the database or+ downloading external JS dependencies mentioned in the :ref:`tips` section+ in the development page apply to all the installation options.@@ -51,4 +57,4 @@ For a more production-like setting with apache and mod-wsgi consult theDocker-------There are docker images available, see the :doc:`docker` chapter.\ No newline at end of file+There are also docker images available, see the :doc:`docker` chapter.