Commit fe35cecc879025c71acb6a5892373612526b4400
Exists in
master
and in
29 other branches
Merge branch 'documentation' into 'master'
Documentation Add user documentation See merge request !88
Showing
1 changed file
with
107 additions
and
6 deletions
Show diff stats
docs/source/user.rst
... | ... | @@ -4,13 +4,114 @@ 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 | + - on folder: /etc/colab/plugins.d/ | |
77 | + | |
78 | + - create file: [plugin_name].py | |
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 | + | |
91 | + # The private_token is optional | |
92 | + # It is used to access the application data being coupled to colab | |
93 | + # It is recommended to use the provate_token an admin of the application | |
94 | + private_token = '[plugin_private_token_for_data_import]' | |
95 | + | |
96 | + urls = { | |
97 | + 'include': '[plugin_module_path].urls', | |
98 | + 'namespace': '[plugin_name]', | |
99 | + 'prefix': '[application_prefix]/', # Exemple: http://site.com/[application_prefix]/ | |
100 | + } | |
101 | + | |
102 | + menu_title = '[menu_title_of_html]' | |
103 | + | |
104 | + url = colab_url_factory('[plugin_name]') | |
105 | + | |
106 | + menu_urls = { | |
107 | + url(display=_('[name_of_link_page]'), viewname='[name_of_view_in_the_application]', kwargs={'path': '/[page_appication_path]/' }, auth=True), | |
108 | + | |
109 | + # You can have more than one url | |
110 | + url(display=_('[name_of_link_page]'), viewname='[another_name_of_view_in_the_application]', kwargs={'path': '/[another_page_appication_path]/' }, auth=True), | |
111 | + } | |
112 | + | |
113 | + | |
10 | 114 | |
11 | -Install | |
12 | -+++++++ | |
13 | -.. TODO | |
14 | 115 | |
15 | 116 | Plugins |
16 | 117 | ------- | ... | ... |