Wiki

Version 281 (Etienne Pallier, 03/24/2016 12:02 pm)

1 1 Etienne Pallier
h1. Technical Documentation for the PYROS project (FGFT-CC)
2 1 Etienne Pallier
3 1 Etienne Pallier
4 1 Etienne Pallier
HOWTO Format Redmine Wiki : http://www.redmine.org/projects/redmine/wiki/FrRedmineWikiFormatting
5 1 Etienne Pallier
6 1 Etienne Pallier
{{>toc}}
7 1 Etienne Pallier
8 1 Etienne Pallier
9 121 Etienne Pallier
---
10 1 Etienne Pallier
11 121 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}I - TODO%
12 121 Etienne Pallier
13 273 Etienne Pallier
 * Mettre en place une collaboration via le gitlab
14 273 Etienne Pallier
15 251 Etienne Pallier
 * Séparation des BD Django et Pyros
16 1 Etienne Pallier
17 1 Etienne Pallier
 * Intégration des modules Django déjà développés
18 271 Etienne Pallier
19 271 Etienne Pallier
 * Intégration continue avec Jenkins (+ run des tests sur une VM Windows)
20 271 Etienne Pallier
21 272 Etienne Pallier
 * Planifier la suite...
22 272 Etienne Pallier
23 272 Etienne Pallier
 * Doc pour le meeting de mai
24 271 Etienne Pallier
 
25 281 Etienne Pallier
 * Liens vers web local :
26 281 Etienne Pallier
27 280 Etienne Pallier
  * homepage: http://localhost:8000
28 280 Etienne Pallier
  * admin: http://localhost:8000/admin
29 121 Etienne Pallier
30 3 Etienne Pallier
---
31 1 Etienne Pallier
32 140 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}I - DATABASE SCHEMA (v0.2.1)%
33 116 Etienne Pallier
34 116 Etienne Pallier
35 117 Etienne Pallier
{{thumbnail(PYROS_PDM_v021.png, size=300, title=Pyros data model)}}
36 121 Etienne Pallier
37 121 Etienne Pallier
38 121 Etienne Pallier
---
39 116 Etienne Pallier
40 141 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}II - Get the project (from gitlab)%
41 141 Etienne Pallier
42 277 Etienne Pallier
h3. Gitlab management interface
43 277 Etienne Pallier
44 277 Etienne Pallier
https://gitlab.irap.omp.eu/epallier/pyros/team
45 277 Etienne Pallier
46 253 Etienne Pallier
h3. Project structure
47 1 Etienne Pallier
48 253 Etienne Pallier
Once you have fetched the project, you should obtain this structure:
49 1 Etienne Pallier
50 226 Etienne Pallier
<pre>
51 1 Etienne Pallier
52 1 Etienne Pallier
PYROS/
53 254 Etienne Pallier
├── install/
54 254 Etienne Pallier
│   └── REQUIREMENTS.txt
55 254 Etienne Pallier
│   └── INSTALLATION.txt
56 226 Etienne Pallier
├── public/
57 226 Etienne Pallier
│   └── static/
58 226 Etienne Pallier
├── src/
59 226 Etienne Pallier
│   ├── manage.py
60 226 Etienne Pallier
│   ├── pyros/
61 226 Etienne Pallier
│   │   ├── __init__.py
62 226 Etienne Pallier
│   │   ├── __pycache__
63 226 Etienne Pallier
│   │   ├── settings.py
64 1 Etienne Pallier
│   │   ├── urls.py
65 1 Etienne Pallier
│   │   └── wsgi.py
66 1 Etienne Pallier
│   └── pyrosapp/
67 1 Etienne Pallier
│       ├── __init__.py
68 1 Etienne Pallier
│       ├── admin.py
69 1 Etienne Pallier
│       ├── apps.py
70 1 Etienne Pallier
│       ├── migrations
71 1 Etienne Pallier
│       ├── models.py
72 1 Etienne Pallier
│       ├── tests.py
73 1 Etienne Pallier
│       └── views.py
74 1 Etienne Pallier
75 1 Etienne Pallier
76 253 Etienne Pallier
</pre>
77 253 Etienne Pallier
78 265 Etienne Pallier
h3. From the terminal
79 253 Etienne Pallier
80 253 Etienne Pallier
<pre>
81 253 Etienne Pallier
git clone https://gitlab.irap.omp.eu/epallier/pyros.git PYROS
82 256 Etienne Pallier
(or also : git clone git@gitlab.irap.omp.eu:epallier/pyros.git PYROS)
83 253 Etienne Pallier
</pre>
84 255 Etienne Pallier
85 253 Etienne Pallier
This creates a PYROS/ folder containing the project (with a .git/ subfolder for synchronization with the git repository)
86 253 Etienne Pallier
87 257 Etienne Pallier
_If you just wanted a static copy of the project (without synchronization), just remove the .git/ folder:_
88 253 Etienne Pallier
<pre>
89 253 Etienne Pallier
$ rm -r .git/
90 253 Etienne Pallier
</pre>
91 226 Etienne Pallier
92 264 Etienne Pallier
h3. From Eclipse
93 1 Etienne Pallier
94 274 Paul Carensac
1) Deactivate CA certificate verification
95 1 Etienne Pallier
96 274 Paul Carensac
Window -> Preferences -> Team -> git -> configuration -> Add entry
97 274 Paul Carensac
98 274 Paul Carensac
Key = http.sslVerify
99 274 Paul Carensac
Value = false
100 274 Paul Carensac
101 274 Paul Carensac
2) Fetch the project
102 274 Paul Carensac
103 252 Etienne Pallier
File/Import project from git
104 1 Etienne Pallier
105 258 Etienne Pallier
Select repository source: Clone URI: https://gitlab.irap.omp.eu/epallier/pyros.git
106 252 Etienne Pallier
107 252 Etienne Pallier
Directory: 
108 252 Etienne Pallier
par défaut, il propose : /Users/epallier/git/pyros
109 258 Etienne Pallier
mais on peut le mettre ailleurs (c'est ce que j'ai fait)
110 252 Etienne Pallier
111 1 Etienne Pallier
initial branch: master
112 1 Etienne Pallier
remote name: origin
113 1 Etienne Pallier
114 252 Etienne Pallier
Import as general project
115 252 Etienne Pallier
116 252 Etienne Pallier
Project name: PYROS
117 1 Etienne Pallier
118 258 Etienne Pallier
119 274 Paul Carensac
3) Configure the project
120 258 Etienne Pallier
121 252 Etienne Pallier
The project is created. Now, you have to set it as a «PyDev » and a « Django » project.
122 252 Etienne Pallier
123 252 Etienne Pallier
clic droit sur le projet / PyDev / set as a PyDev project
124 252 Etienne Pallier
125 1 Etienne Pallier
clic droit sur le projet / PyDev / set as a Django project
126 1 Etienne Pallier
127 252 Etienne Pallier
clic droit sur le projet : on doit maintenant avoir un sous-menu Django
128 252 Etienne Pallier
129 252 Etienne Pallier
clic droit sur le dossier src / PyDev / set as source folder (add to PYTHONPATH)
130 252 Etienne Pallier
131 258 Etienne Pallier
clic droit sur projet / Properties / Pydev-Django :
132 252 Etienne Pallier
  - Django manage.py : src/manage.py
133 1 Etienne Pallier
  - Django settings module : pyros.settings
134 258 Etienne Pallier
135 258 Etienne Pallier
136 275 Paul Carensac
4) Set Code style
137 252 Etienne Pallier
138 252 Etienne Pallier
Window/Preferences : Pydev / Editor
139 252 Etienne Pallier
- Auto Imports : uncheck « Do auto import »
140 252 Etienne Pallier
- Code style:
141 252 Etienne Pallier
	- Locals … : camelCase
142 252 Etienne Pallier
	- Methods : camelCase() with first lower
143 1 Etienne Pallier
- Code style / Code Formatter: activer « use autopep8.py for code formatting »
144 264 Etienne Pallier
- Tabs : Tab length : 4
145 264 Etienne Pallier
146 264 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)
147 169 Etienne Pallier
148 141 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}III - INSTALLATION%
149 2 Etienne Pallier
150 120 Etienne Pallier
151 120 Etienne Pallier
---
152 120 Etienne Pallier
153 184 Etienne Pallier
h3. Install MySql (only if necessary)
154 2 Etienne Pallier
155 49 Etienne Pallier
 * Linux Ubuntu
156 49 Etienne Pallier
<pre>
157 107 Paul Carensac
158 107 Paul Carensac
$ sudo apt-get install mysql-server
159 107 Paul Carensac
$ sudo apt-get install mysql-client
160 107 Paul Carensac
161 49 Etienne Pallier
</pre>
162 49 Etienne Pallier
163 49 Etienne Pallier
 * Linux CentOS
164 49 Etienne Pallier
<pre>
165 49 Etienne Pallier
TODO:
166 49 Etienne Pallier
$ sudo yum install mysql
167 49 Etienne Pallier
...
168 49 Etienne Pallier
</pre>
169 49 Etienne Pallier
170 49 Etienne Pallier
 * Mac OS X
171 1 Etienne Pallier
Install XAMPP
172 1 Etienne Pallier
(but you could also use the pre-installed Mac OS MySql)
173 177 Etienne Pallier
<pre>
174 177 Etienne Pallier
TODO:
175 49 Etienne Pallier
</pre>
176 1 Etienne Pallier
177 49 Etienne Pallier
 * Windows
178 243 Paul Carensac
179 1 Etienne Pallier
<pre>
180 243 Paul Carensac
Download and install the newest version on https://dev.mysql.com/downloads/installer/
181 243 Paul Carensac
182 243 Paul Carensac
Once installed, launch MySQL Installer. Clic on 'Add...' on the right.
183 243 Paul Carensac
In MySQLServers section, choose the newest, then clic on next.
184 243 Paul Carensac
Install and configure the server (just follow the installation guide).
185 243 Paul Carensac
186 243 Paul Carensac
Then launch mysql (via the Windows menu).
187 49 Etienne Pallier
</pre>
188 49 Etienne Pallier
189 49 Etienne Pallier
190 49 Etienne Pallier
---
191 1 Etienne Pallier
192 185 Etienne Pallier
h3. Install Python3.5 (only if necessary)
193 1 Etienne Pallier
194 11 Etienne Pallier
195 11 Etienne Pallier
 * Mac OS X :
196 1 Etienne Pallier
<pre>
197 183 Etienne Pallier
198 24 Etienne Pallier
1) Installer MacPort
199 24 Etienne Pallier
(TODO: doc)
200 24 Etienne Pallier
201 24 Etienne Pallier
2) Installer le "port" python35
202 1 Etienne Pallier
$ sudo port install python35
203 183 Etienne Pallier
204 1 Etienne Pallier
</pre>
205 1 Etienne Pallier
206 1 Etienne Pallier
 * Linux (Ubuntu) :
207 1 Etienne Pallier
<pre>
208 244 Paul Carensac
$ sudo add-apt-repository ppa:fkrull/deadsnakes
209 244 Paul Carensac
$ sudo apt-get update
210 244 Paul Carensac
$ sudo apt-get install python3.5
211 1 Etienne Pallier
212 244 Paul Carensac
$ sudo pip install virtualenv
213 1 Etienne Pallier
</pre>
214 1 Etienne Pallier
215 244 Paul Carensac
216 244 Paul Carensac
 * Windows 7 :
217 244 Paul Carensac
<pre>
218 244 Paul Carensac
Go to https://www.python.org/downloads/windows/ , choose the wanted version
219 244 Paul Carensac
On the wanted version’s page, download Windows x86 executable installer
220 244 Paul Carensac
221 244 Paul Carensac
Run the executable
222 244 Paul Carensac
    * On the first page, check "Add python3.5 to PATH"
223 244 Paul Carensac
    * Choose "Install now" option
224 245 Paul Carensac
225 245 Paul Carensac
Open cmd (windows + R, cmd) :
226 245 Paul Carensac
 $ python -m pip install --upgrade pip
227 245 Paul Carensac
 $ pip install virtualenv
228 244 Paul Carensac
</pre>
229 1 Etienne Pallier
230 183 Etienne Pallier
 * Windows 10 :
231 183 Etienne Pallier
<pre>
232 187 Etienne Pallier
TODO:
233 183 Etienne Pallier
</pre>
234 3 Etienne Pallier
235 4 Etienne Pallier
---
236 5 Etienne Pallier
237 192 Etienne Pallier
h3. Create a Python3 virtual environment dedicated to the project (inside the project folder)
238 127 Etienne Pallier
239 131 Etienne Pallier
<pre>
240 1 Etienne Pallier
241 193 Etienne Pallier
$ mkdir private/
242 193 Etienne Pallier
243 133 Etienne Pallier
$ cd private/
244 3 Etienne Pallier
245 246 Paul Carensac
$ which python3.5 ("where python" for windows)
246 3 Etienne Pallier
/opt/local/bin/python3.5
247 15 Etienne Pallier
248 127 Etienne Pallier
$ virtualenv-3.5 venv_py35_pyros -p /opt/local/bin/python3.5
249 3 Etienne Pallier
=> creates a venv_py35_pyros/ folder inside PYROS/private/
250 1 Etienne Pallier
251 131 Etienne Pallier
</pre>
252 1 Etienne Pallier
253 7 Etienne Pallier
---
254 3 Etienne Pallier
255 65 Etienne Pallier
h3. Activate the python virtual environment (from inside the project)
256 7 Etienne Pallier
257 55 Etienne Pallier
<pre>
258 1 Etienne Pallier
259 65 Etienne Pallier
$ pwd
260 134 Etienne Pallier
.../PYROS/private
261 1 Etienne Pallier
262 247 Paul Carensac
$ source ./venv_py35_pyros/bin/activate (venv_py35_pyros/Scripts/activate on Windows)
263 247 Paul Carensac
264 65 Etienne Pallier
265 3 Etienne Pallier
$ python -V
266 1 Etienne Pallier
Python 3.5.1
267 3 Etienne Pallier
268 3 Etienne Pallier
$ which pip
269 77 Etienne Pallier
.../PYROS/venv_py35_pyros/bin/pip
270 16 Etienne Pallier
271 194 Etienne Pallier
Upgrade pip to last version available:
272 3 Etienne Pallier
$ pip install --upgrade pip
273 3 Etienne Pallier
Collecting pip
274 3 Etienne Pallier
  Downloading pip-8.1.1-py2.py3-none-any.whl (1.2MB)
275 3 Etienne Pallier
Installing collected packages: pip
276 3 Etienne Pallier
  Found existing installation: pip 7.1.2
277 3 Etienne Pallier
    Uninstalling pip-7.1.2:
278 3 Etienne Pallier
      Successfully uninstalled pip-7.1.2
279 1 Etienne Pallier
Successfully installed pip-8.1.1
280 194 Etienne Pallier
281 194 Etienne Pallier
Upgrade wheel to last version available:
282 194 Etienne Pallier
$ pip install --upgrade wheel
283 194 Etienne Pallier
Collecting wheel
284 194 Etienne Pallier
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
285 194 Etienne Pallier
Installing collected packages: wheel
286 194 Etienne Pallier
  Found existing installation: wheel 0.24.0
287 194 Etienne Pallier
    Uninstalling wheel-0.24.0:
288 194 Etienne Pallier
      Successfully uninstalled wheel-0.24.0
289 194 Etienne Pallier
Successfully installed wheel-0.29.0
290 194 Etienne Pallier
291 55 Etienne Pallier
292 55 Etienne Pallier
</pre>
293 18 Etienne Pallier
294 267 Etienne Pallier
---
295 267 Etienne Pallier
296 212 Etienne Pallier
h3. Install the needed Python packages (from within the virtual environment)
297 18 Etienne Pallier
298 66 Etienne Pallier
First, be sure that the virtual environment is activated:
299 66 Etienne Pallier
<pre>
300 66 Etienne Pallier
$ python -V
301 66 Etienne Pallier
Python 3.5.1
302 66 Etienne Pallier
</pre>
303 66 Etienne Pallier
304 62 Etienne Pallier
 * *Automatic Installation of all packages*
305 62 Etienne Pallier
<pre>
306 90 Etienne Pallier
$ pip install -r REQUIREMENTS.txt
307 62 Etienne Pallier
</pre>
308 62 Etienne Pallier
309 93 Etienne Pallier
 * *Or, manual installation of each package*
310 62 Etienne Pallier
311 62 Etienne Pallier
  * *Install Django* :
312 32 Etienne Pallier
<pre>
313 3 Etienne Pallier
$ pip install django
314 3 Etienne Pallier
Collecting django
315 3 Etienne Pallier
  Downloading Django-1.9.4-py2.py3-none-any.whl (6.6MB)
316 3 Etienne Pallier
Installing collected packages: django
317 3 Etienne Pallier
Successfully installed django-1.9.4
318 3 Etienne Pallier
319 3 Etienne Pallier
$ pip install django-admin-tools
320 3 Etienne Pallier
Collecting django-admin-tools
321 3 Etienne Pallier
  Downloading django_admin_tools-0.7.2-py2.py3-none-any.whl (289kB)
322 3 Etienne Pallier
Installing collected packages: django-admin-tools
323 3 Etienne Pallier
Successfully installed django-admin-tools-0.7.2
324 3 Etienne Pallier
325 21 Etienne Pallier
$ pip install django-debug-toolbar
326 21 Etienne Pallier
Collecting django-debug-toolbar
327 21 Etienne Pallier
  Downloading django_debug_toolbar-1.4-py2.py3-none-any.whl (212kB)
328 21 Etienne Pallier
Requirement already satisfied (use --upgrade to upgrade): Django>=1.7 in ./venv_py35_pyros/lib/python3.5/site-packages (from django-debug-toolbar)
329 21 Etienne Pallier
Collecting sqlparse (from django-debug-toolbar)
330 21 Etienne Pallier
  Downloading sqlparse-0.1.19.tar.gz (58kB)
331 21 Etienne Pallier
Building wheels for collected packages: sqlparse
332 21 Etienne Pallier
  Running setup.py bdist_wheel for sqlparse ... done
333 21 Etienne Pallier
  Stored in directory: /Users/epallier/Library/Caches/pip/wheels/7b/d4/72/6011bb100dd5fc213164e4bbee13d4e03261dd54ce6a5de6b8
334 21 Etienne Pallier
Successfully built sqlparse
335 21 Etienne Pallier
Installing collected packages: sqlparse, django-debug-toolbar
336 21 Etienne Pallier
Successfully installed django-debug-toolbar-1.4 sqlparse-0.1.19
337 21 Etienne Pallier
338 21 Etienne Pallier
$ pip install django-extensions
339 21 Etienne Pallier
Collecting django-extensions
340 21 Etienne Pallier
  Downloading django_extensions-1.6.1-py2.py3-none-any.whl (202kB)
341 21 Etienne Pallier
Collecting six>=1.2 (from django-extensions)
342 21 Etienne Pallier
  Downloading six-1.10.0-py2.py3-none-any.whl
343 21 Etienne Pallier
Installing collected packages: six, django-extensions
344 21 Etienne Pallier
Successfully installed django-extensions-1.6.1 six-1.10.0
345 21 Etienne Pallier
346 21 Etienne Pallier
$ pip install django-suit
347 21 Etienne Pallier
Collecting django-suit
348 21 Etienne Pallier
  Downloading django-suit-0.2.18.tar.gz (587kB)
349 21 Etienne Pallier
Building wheels for collected packages: django-suit
350 1 Etienne Pallier
  Running setup.py bdist_wheel for django-suit ... done
351 1 Etienne Pallier
  Stored in directory: /Users/epallier/Library/Caches/pip/wheels/12/8b/9a/e02ab0ad9229881638aa040d47d77c8f562999533811927d41
352 1 Etienne Pallier
Successfully built django-suit
353 1 Etienne Pallier
Installing collected packages: django-suit
354 1 Etienne Pallier
Successfully installed django-suit-0.2.18
355 21 Etienne Pallier
356 32 Etienne Pallier
</pre>
357 32 Etienne Pallier
358 63 Etienne Pallier
  * *Install the web application server gunicorn (will be used in production instead of the dev django web server)* :
359 32 Etienne Pallier
<pre>
360 25 Etienne Pallier
$ pip install gunicorn
361 25 Etienne Pallier
Collecting gunicorn
362 25 Etienne Pallier
  Downloading gunicorn-19.4.5-py2.py3-none-any.whl (112kB)
363 21 Etienne Pallier
Installing collected packages: gunicorn
364 26 Etienne Pallier
Successfully installed gunicorn-19.4.5
365 1 Etienne Pallier
</pre>
366 1 Etienne Pallier
367 63 Etienne Pallier
  * *Install the python mysql client*:
368 32 Etienne Pallier
<pre>
369 32 Etienne Pallier
$ pip install mysqlclient
370 72 Etienne Pallier
...
371 72 Etienne Pallier
</pre>
372 33 Etienne Pallier
373 73 Etienne Pallier
   * => Issue under Mac OS X:
374 72 Etienne Pallier
<pre>
375 3 Etienne Pallier
$ pip install mysqlclient
376 3 Etienne Pallier
Collecting mysqlclient
377 1 Etienne Pallier
  Downloading mysqlclient-1.3.7.tar.gz (79kB)
378 22 Etienne Pallier
Building wheels for collected packages: mysqlclient
379 3 Etienne Pallier
  Running setup.py bdist_wheel for mysqlclient ... error
380 3 Etienne Pallier
381 1 Etienne Pallier
  ----------------------------------------
382 1 Etienne Pallier
  Failed building wheel for mysqlclient
383 1 Etienne Pallier
  Running setup.py clean for mysqlclient
384 1 Etienne Pallier
Failed to build mysqlclient
385 1 Etienne Pallier
Installing collected packages: mysqlclient
386 1 Etienne Pallier
  Running setup.py install for mysqlclient ... done
387 1 Etienne Pallier
Successfully installed mysqlclient-1.3.7
388 1 Etienne Pallier
389 1 Etienne Pallier
BOUH !!!
390 1 Etienne Pallier
391 1 Etienne Pallier
$ pip install --upgrade wheel
392 1 Etienne Pallier
Collecting wheel
393 1 Etienne Pallier
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
394 1 Etienne Pallier
Installing collected packages: wheel
395 1 Etienne Pallier
  Found existing installation: wheel 0.24.0
396 1 Etienne Pallier
    Uninstalling wheel-0.24.0:
397 1 Etienne Pallier
      Successfully uninstalled wheel-0.24.0
398 1 Etienne Pallier
Successfully installed wheel-0.29.0
399 1 Etienne Pallier
400 1 Etienne Pallier
$ pip uninstall mysqlclient
401 1 Etienne Pallier
402 1 Etienne Pallier
$ pip install mysqlclient
403 1 Etienne Pallier
Collecting mysqlclient
404 1 Etienne Pallier
  Using cached mysqlclient-1.3.7.tar.gz
405 1 Etienne Pallier
Building wheels for collected packages: mysqlclient
406 1 Etienne Pallier
  Running setup.py bdist_wheel for mysqlclient ... done
407 1 Etienne Pallier
  Stored in directory: /Users/epallier/Library/Caches/pip/wheels/9b/06/50/d11418c26cf8f2156b13d4363b5afde8e7e75ebb8540d0228d
408 1 Etienne Pallier
Successfully built mysqlclient
409 1 Etienne Pallier
Installing collected packages: mysqlclient
410 1 Etienne Pallier
Successfully installed mysqlclient-1.3.7
411 1 Etienne Pallier
412 1 Etienne Pallier
YES !!!
413 1 Etienne Pallier
414 1 Etienne Pallier
</pre>
415 1 Etienne Pallier
416 107 Paul Carensac
   * => Issues under Ubuntu:
417 107 Paul Carensac
<pre>
418 107 Paul Carensac
$ pip install mysqlclient
419 107 Paul Carensac
Collecting mysqlclient
420 107 Paul Carensac
  Downloading mysqlclient-1.3.7.tar.gz (79kB)
421 107 Paul Carensac
    100% |████████████████████████████████| 81kB 1.5MB/s
422 107 Paul Carensac
    Complete output from command python setup.py egg_info:
423 107 Paul Carensac
    /bin/sh: 1: mysql_config: not found
424 107 Paul Carensac
    Traceback (most recent call last):
425 107 Paul Carensac
      File "<string>", line 1, in <module>
426 107 Paul Carensac
    [...]
427 107 Paul Carensac
    ----------------------------------------
428 107 Paul Carensac
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-q6j4inuz/mysqlclient/
429 1 Etienne Pallier
430 108 Paul Carensac
BOUH !!!
431 108 Paul Carensac
432 107 Paul Carensac
$ sudo apt-get install libmysqlclient-dev
433 108 Paul Carensac
434 107 Paul Carensac
$ pip install mysqlclient
435 107 Paul Carensac
Collecting mysqlclient
436 107 Paul Carensac
  Using cached mysqlclient-1.3.7.tar.gz
437 107 Paul Carensac
Building wheels for collected packages: mysqlclient
438 107 Paul Carensac
  Running setup.py bdist_wheel for mysqlclient ... error
439 107 Paul Carensac
440 107 Paul Carensac
    _mysql.c:40:20: fatal error: Python.h: No such file or directory
441 107 Paul Carensac
     #include "Python.h"
442 107 Paul Carensac
                        ^
443 107 Paul Carensac
    compilation terminated.
444 107 Paul Carensac
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
445 107 Paul Carensac
    
446 107 Paul Carensac
    ----------------------------------------
447 107 Paul Carensac
Command "/home/carens_p/pyros/venv_py35_pyros/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-k3klv92j/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-gz242xxs-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/carens_p/pyros/venv_py35_pyros/include/site/python3.5/mysqlclient" failed with error code 1 in /tmp/pip-build-k3klv92j/mysqlclient/
448 107 Paul Carensac
449 108 Paul Carensac
BOUH !!!
450 108 Paul Carensac
451 107 Paul Carensac
$ sudo apt-get install python3.5-dev
452 108 Paul Carensac
453 107 Paul Carensac
$ pip install mysqlclient
454 107 Paul Carensac
455 107 Paul Carensac
YES !!!
456 107 Paul Carensac
457 107 Paul Carensac
</pre>
458 12 Etienne Pallier
459 250 Paul Carensac
 * => Issue under Windows
460 250 Paul Carensac
<pre>
461 250 Paul Carensac
Same message as the issue for Mac.
462 250 Paul Carensac
463 250 Paul Carensac
Go to http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient to download the newest mysqlclient wheel
464 250 Paul Carensac
465 250 Paul Carensac
$ pip install path\to\mysqlclient\wheel
466 250 Paul Carensac
467 250 Paul Carensac
No need to redo "pip install mysqlclient"
468 250 Paul Carensac
</pre>
469 250 Paul Carensac
470 12 Etienne Pallier
---
471 28 Etienne Pallier
472 262 Etienne Pallier
h3. (Eclipse only) Set the Python3 virtual environment as the project interpreter
473 260 Etienne Pallier
474 260 Etienne Pallier
clic droit sur projet / Properties / PyDev - Interpreter/Grammar :
475 260 Etienne Pallier
Grammar version : 3
476 276 Paul Carensac
477 260 Etienne Pallier
Interpreter : click on « click here to configure an interpreter not listed »
478 276 Paul Carensac
479 260 Etienne Pallier
click on « New » :
480 260 Etienne Pallier
- Interpreter name : venv_py35_pyros
481 260 Etienne Pallier
- Interpreter executable : click on « Browse »
482 260 Etienne Pallier
	Select your private/venv_py35_pyros/bin/python3.5 executable
483 260 Etienne Pallier
	click OK
484 260 Etienne Pallier
	click OK again
485 260 Etienne Pallier
486 260 Etienne Pallier
Interpreter: select now venv_py35_pyros from the list
487 260 Etienne Pallier
488 266 Etienne Pallier
---
489 266 Etienne Pallier
490 270 Etienne Pallier
h3. Run the project
491 142 Etienne Pallier
492 270 Etienne Pallier
TODO: more details... (notamment sur localhost:8000/admin)
493 1 Etienne Pallier
494 270 Etienne Pallier
h4. From the terminal
495 270 Etienne Pallier
496 142 Etienne Pallier
<pre>
497 142 Etienne Pallier
498 150 Etienne Pallier
$ cd src/
499 150 Etienne Pallier
500 1 Etienne Pallier
$ ./manage.py runserver
501 38 Etienne Pallier
(or gunicorn pyros.wsgi)
502 3 Etienne Pallier
==> http://localhost:8000
503 87 Etienne Pallier
...
504 87 Etienne Pallier
...
505 87 Etienne Pallier
Ctrl-c
506 87 Etienne Pallier
507 1 Etienne Pallier
</pre>
508 270 Etienne Pallier
509 270 Etienne Pallier
h4. From Eclipse
510 270 Etienne Pallier
511 270 Etienne Pallier
clic droit sur projet, Django/Custom command/runserver
512 270 Etienne Pallier
513 270 Etienne Pallier
check http://localhost:8000/
514 142 Etienne Pallier
515 142 Etienne Pallier
516 142 Etienne Pallier
---
517 142 Etienne Pallier
518 156 Paul Carensac
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}IV - CONFIGURATION of the Django Back Office (administration interface)%
519 155 Paul Carensac
520 268 Etienne Pallier
[[django_backoffice_config|Configuration of the Django Back office (admin)]]
521 268 Etienne Pallier
522 211 Paul Carensac
523 229 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}V - INSTALLATION FROM THE BEGINNING (for dev only, history of the initial project creation)%
524 1 Etienne Pallier
525 236 Etienne Pallier
526 242 Etienne Pallier
[[pyros_install_from_start|Pyros installation from the beginning]]