Commit 152ebd04ba01e7f8679730d11f8080cbb3ade4ac
1 parent
f1e92a83
Exists in
master
and in
29 other branches
Add colab documentation for installation
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com> Signed-off-by: Luciano Prestes Cavalcanti <lucianopcbr@gmail.com> Signed-off-by: Matheus Fernandes <matheus.souza.fernandes@gmail.com>
Showing
1 changed file
with
103 additions
and
6 deletions
Show diff stats
docs/source/user.rst
| ... | ... | @@ -4,13 +4,110 @@ User Documentation |
| 4 | 4 | Getting Started |
| 5 | 5 | --------------- |
| 6 | 6 | |
| 7 | -Dependencies | |
| 8 | -++++++++++++ | |
| 9 | -.. TODO | |
| 7 | +Install Requirements with Vagrant | |
| 8 | ++++++++++++++++++++++++++++++++++ | |
| 9 | + | |
| 10 | +Need VirtualBox and Vagrant installed | |
| 11 | + | |
| 12 | +Run the following command to create and up the colab virtual machine | |
| 13 | + | |
| 14 | +.. code-block:: shell | |
| 15 | + | |
| 16 | + $ vagrant up | |
| 17 | + | |
| 18 | +Run the following command to access colab virtual machine | |
| 19 | + | |
| 20 | +.. code-block:: shell | |
| 21 | + | |
| 22 | + $ vagrant ssh | |
| 23 | + | |
| 24 | +Install Requirements without Vagrant | |
| 25 | +++++++++++++++++++++ | |
| 26 | + | |
| 27 | +Install virtualenvwrapper | |
| 28 | + | |
| 29 | +Use this link to configure the virtualenvwreapper: https://virtualenvwrapper.readthedocs.org | |
| 30 | + | |
| 31 | +Run the following command | |
| 32 | + | |
| 33 | +.. code-block:: shell | |
| 34 | + | |
| 35 | + $ mkvirtualenv colab | |
| 36 | + | |
| 37 | +Install Development | |
| 38 | ++++++++++++++++++++ | |
| 39 | + | |
| 40 | +On the colab folder use the following commands, or in the colab vagrant ("$ vagrant ssh") | |
| 41 | + | |
| 42 | +.. code-block:: shell | |
| 43 | + | |
| 44 | + $ workon colab | |
| 45 | + $ pip install -e . #(dont need this command if use vagrant) | |
| 46 | + $ colab-admin migrate #(dont need this command if use vagrant) | |
| 47 | + $ colab-admin runserver 0.0.0.0:8000 | |
| 48 | + | |
| 49 | + | |
| 50 | +Colab settings | |
| 51 | ++++++++++++++++++ | |
| 52 | + | |
| 53 | +View the following file: | |
| 54 | + | |
| 55 | +.. code-block:: shell | |
| 56 | + | |
| 57 | + $ cat /etc/colab/settings.py | |
| 58 | + | |
| 59 | +The file /etc/colab/settings.py have the configurations of colab, this configurations overrides the django settings.py | |
| 60 | + | |
| 61 | + | |
| 62 | +Add a new plugin | |
| 63 | +---------------- | |
| 64 | +- Atention: replace the brackets, [], for the content presented in the brackets | |
| 65 | + | |
| 66 | +- Make sure the application has the following requirements | |
| 67 | + | |
| 68 | + - Suport for remote user authentication | |
| 69 | + | |
| 70 | + - A relative url root | |
| 71 | + | |
| 72 | + - A relative static url root, for change url's of css and javascript | |
| 73 | + | |
| 74 | +- Create the plugin configuration for the application | |
| 75 | + | |
| 76 | + - create file: [plugin_name].py | |
| 77 | + | |
| 78 | + - on folder: /etc/colab/plugins.d/ | |
| 79 | + | |
| 80 | +Use this template for the plugin configuration file | |
| 81 | + | |
| 82 | +.. code-block:: python | |
| 83 | + | |
| 84 | + from colab.plugins.utils.menu import colab_url_factory | |
| 85 | + from django.utils.translation import ugettext_lazy as _ | |
| 86 | + | |
| 87 | + name = 'colab.plugins.[plugin_name]' | |
| 88 | + | |
| 89 | + upstream = 'http://[host_of_application]/[relative_url_root]/' | |
| 90 | + private_token = '[plugin_private_token_for_data_import]' | |
| 91 | + | |
| 92 | + urls = { | |
| 93 | + 'include': 'colab.plugins.[plugin_name].urls', | |
| 94 | + 'namespace': '[plugin_name]', | |
| 95 | + 'prefix': '[application_prefix]', | |
| 96 | + } | |
| 97 | + | |
| 98 | + menu_title = '[menu_title_of_html]' | |
| 99 | + | |
| 100 | + url = colab_url_factory('[plugin_name]') | |
| 101 | + | |
| 102 | + menu_urls = { | |
| 103 | + url(display=_('[name_of_link_page]'), viewname='[name_of_view_in_the_application]', kwargs={'path': '/[page_appication_path]/' }, auth=True), | |
| 104 | + | |
| 105 | + # You can have more than one url | |
| 106 | + url(display=_('[name_of_link_page]'), viewname='[another_name_of_view_in_the_application]', kwargs={'path': '/[another_page_appication_path]/' }, auth=True), | |
| 107 | + } | |
| 108 | + | |
| 109 | + | |
| 10 | 110 | |
| 11 | -Install | |
| 12 | -+++++++ | |
| 13 | -.. TODO | |
| 14 | 111 | |
| 15 | 112 | Plugins |
| 16 | 113 | ------- | ... | ... |