Project Installation

Version 7 (Etienne Pallier, 03/24/2016 12:51 pm)

1 1 Etienne Pallier
h1. Project Installation
2 1 Etienne Pallier
3 6 Etienne Pallier
4 6 Etienne Pallier
HOWTO Format Redmine Wiki : http://www.redmine.org/projects/redmine/wiki/FrRedmineWikiFormatting
5 6 Etienne Pallier
6 6 Etienne Pallier
{{>toc}}
7 6 Etienne Pallier
8 6 Etienne Pallier
9 3 Etienne Pallier
---
10 3 Etienne Pallier
11 2 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}LIENS UTILES%
12 2 Etienne Pallier
13 2 Etienne Pallier
 * Liens vers web local :
14 2 Etienne Pallier
15 2 Etienne Pallier
  * homepage: http://localhost:8000
16 2 Etienne Pallier
  * admin: http://localhost:8000/admin
17 2 Etienne Pallier
18 2 Etienne Pallier
 * Django:
19 2 Etienne Pallier
20 2 Etienne Pallier
  * Coding style: https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/
21 2 Etienne Pallier
22 2 Etienne Pallier
 * Git docs: 
23 2 Etienne Pallier
24 2 Etienne Pallier
  * https://git-scm.com/docs
25 2 Etienne Pallier
  * https://git-scm.com/book/fr/v1/Les-bases-de-Git-Travailler-avec-des-d%C3%A9p%C3%B4ts-distants
26 2 Etienne Pallier
  * les workflows: https://aresu.dsi.cnrs.fr/spip.php?article219
27 2 Etienne Pallier
  * Git for Eclipse users : http://wiki.eclipse.org/EGit/Git_For_Eclipse_Users
28 2 Etienne Pallier
29 2 Etienne Pallier
 * CADOR web interface: http://cador.obs-hp.fr/ros/manual/cador_actions.html
30 2 Etienne Pallier
31 2 Etienne Pallier
 * pylint (analyse de code) : https://www.pylint.org
32 2 Etienne Pallier
33 2 Etienne Pallier
 * pyreverse (uml diagrams generation, inclus dans pylint) : https://www.logilab.org/blogentry/6883
34 2 Etienne Pallier
35 2 Etienne Pallier
 * tox (a generic virtualenv management and test command line tool) : https://testrun.org/tox/latest/index.html
36 2 Etienne Pallier
37 2 Etienne Pallier
---
38 4 Etienne Pallier
39 4 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}I - DATABASE SCHEMA (v0.2.1)%
40 4 Etienne Pallier
41 4 Etienne Pallier
42 4 Etienne Pallier
{{thumbnail(PYROS_PDM_v021.png, size=300, title=Pyros data model)}}
43 4 Etienne Pallier
44 4 Etienne Pallier
45 4 Etienne Pallier
---
46 5 Etienne Pallier
47 5 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}II - Get the project (from gitlab)%
48 5 Etienne Pallier
49 5 Etienne Pallier
h3. Gitlab management interface
50 5 Etienne Pallier
51 5 Etienne Pallier
https://gitlab.irap.omp.eu/epallier/pyros
52 5 Etienne Pallier
53 5 Etienne Pallier
https://gitlab.irap.omp.eu/epallier/pyros/team
54 5 Etienne Pallier
55 5 Etienne Pallier
Browse the code: https://gitlab.irap.omp.eu/epallier/pyros/tree/master
56 5 Etienne Pallier
57 5 Etienne Pallier
h3. Project structure
58 5 Etienne Pallier
59 5 Etienne Pallier
Once you have fetched the project, you should obtain this structure:
60 5 Etienne Pallier
61 5 Etienne Pallier
<pre>
62 5 Etienne Pallier
63 5 Etienne Pallier
PYROS/
64 5 Etienne Pallier
├── install/
65 5 Etienne Pallier
│   └── REQUIREMENTS.txt
66 5 Etienne Pallier
│   └── INSTALLATION.txt
67 5 Etienne Pallier
├── public/
68 5 Etienne Pallier
│   └── static/
69 5 Etienne Pallier
├── src/
70 5 Etienne Pallier
│   ├── manage.py
71 5 Etienne Pallier
│   ├── pyros/
72 5 Etienne Pallier
│   │   ├── __init__.py
73 5 Etienne Pallier
│   │   ├── __pycache__
74 5 Etienne Pallier
│   │   ├── settings.py
75 5 Etienne Pallier
│   │   ├── urls.py
76 5 Etienne Pallier
│   │   └── wsgi.py
77 5 Etienne Pallier
│   └── pyrosapp/
78 5 Etienne Pallier
│       ├── __init__.py
79 5 Etienne Pallier
│       ├── admin.py
80 5 Etienne Pallier
│       ├── apps.py
81 5 Etienne Pallier
│       ├── migrations
82 5 Etienne Pallier
│       ├── models.py
83 5 Etienne Pallier
│       ├── tests.py
84 5 Etienne Pallier
│       └── views.py
85 5 Etienne Pallier
86 5 Etienne Pallier
87 5 Etienne Pallier
</pre>
88 5 Etienne Pallier
89 5 Etienne Pallier
h3. From the terminal
90 5 Etienne Pallier
91 5 Etienne Pallier
<pre>
92 5 Etienne Pallier
git clone https://gitlab.irap.omp.eu/epallier/pyros.git PYROS
93 5 Etienne Pallier
(or also : git clone git@gitlab.irap.omp.eu:epallier/pyros.git PYROS)
94 5 Etienne Pallier
</pre>
95 5 Etienne Pallier
96 5 Etienne Pallier
This creates a PYROS/ folder containing the project (with a .git/ subfolder for synchronization with the git repository)
97 5 Etienne Pallier
98 5 Etienne Pallier
_If you just wanted a static copy of the project (without synchronization), just remove the .git/ folder:_
99 5 Etienne Pallier
<pre>
100 5 Etienne Pallier
$ rm -r .git/
101 5 Etienne Pallier
</pre>
102 5 Etienne Pallier
103 5 Etienne Pallier
h3. From Eclipse
104 5 Etienne Pallier
105 5 Etienne Pallier
1) Deactivate CA certificate verification
106 5 Etienne Pallier
107 5 Etienne Pallier
Window -> Preferences -> Team -> git -> configuration -> Add entry
108 5 Etienne Pallier
109 5 Etienne Pallier
Key = http.sslVerify
110 5 Etienne Pallier
Value = false
111 5 Etienne Pallier
112 5 Etienne Pallier
2) Fetch the project
113 5 Etienne Pallier
114 5 Etienne Pallier
File/Import project from git
115 5 Etienne Pallier
116 5 Etienne Pallier
Select repository source: Clone URI: https://gitlab.irap.omp.eu/epallier/pyros.git
117 5 Etienne Pallier
118 5 Etienne Pallier
Directory: 
119 5 Etienne Pallier
par défaut, il propose : /Users/epallier/git/pyros
120 5 Etienne Pallier
mais on peut le mettre ailleurs (c'est ce que j'ai fait)
121 5 Etienne Pallier
122 5 Etienne Pallier
initial branch: master
123 5 Etienne Pallier
remote name: origin
124 5 Etienne Pallier
125 5 Etienne Pallier
Import as general project
126 5 Etienne Pallier
127 5 Etienne Pallier
Project name: PYROS
128 5 Etienne Pallier
129 5 Etienne Pallier
130 5 Etienne Pallier
3) Configure the project
131 5 Etienne Pallier
132 5 Etienne Pallier
The project is created. Now, you have to set it as a «PyDev » and a « Django » project.
133 5 Etienne Pallier
134 5 Etienne Pallier
clic droit sur le projet / PyDev / set as a PyDev project
135 5 Etienne Pallier
136 5 Etienne Pallier
clic droit sur le projet / PyDev / set as a Django project
137 5 Etienne Pallier
138 5 Etienne Pallier
clic droit sur le projet : on doit maintenant avoir un sous-menu Django
139 5 Etienne Pallier
140 5 Etienne Pallier
clic droit sur le dossier src / PyDev / set as source folder (add to PYTHONPATH)
141 5 Etienne Pallier
142 5 Etienne Pallier
clic droit sur projet / Properties / Pydev-Django :
143 5 Etienne Pallier
  - Django manage.py : src/manage.py
144 5 Etienne Pallier
  - Django settings module : pyros.settings
145 5 Etienne Pallier
146 5 Etienne Pallier
147 5 Etienne Pallier
4) Set Code style
148 5 Etienne Pallier
149 5 Etienne Pallier
Window/Preferences : Pydev / Editor
150 5 Etienne Pallier
- Auto Imports : uncheck « Do auto import »
151 5 Etienne Pallier
- Code style:
152 5 Etienne Pallier
	- Locals … : camelCase
153 5 Etienne Pallier
	- Methods : camelCase() with first lower
154 5 Etienne Pallier
- Code style / Code Formatter: activer « use autopep8.py for code formatting »
155 5 Etienne Pallier
- Tabs : Tab length : 4
156 5 Etienne Pallier
157 5 Etienne Pallier
(il faudra aussi faire un peu plus loin : https://projects.irap.omp.eu/projects/pyros/wiki/Wiki#Eclipse-only-Set-the-Python3-virtual-environment-as-the-project-interpreter)