Blame view

install/INSTALLATION.html 21.8 KB
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
1
2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
1a8abf18   Etienne Pallier   updated install doc
4
<title>Project Installation</title>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style>
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
h1, h2, h3, h4 {  font-family: "Trebuchet MS",Georgia,"Times New Roman",serif; }
ul.toc { padding: 4px; margin-left: 0; }
ul.toc li { list-style-type:none; }
ul.toc li.heading2 { margin-left: 1em; }
ul.toc li.heading3 { margin-left: 2em; }
a.wiki-anchor { display: none; margin-left: 6px; text-decoration: none; }
a.wiki-anchor:hover { color: #aaa !important; text-decoration: none; }
h1:hover a.wiki-anchor, h2:hover a.wiki-anchor, h3:hover a.wiki-anchor { display: inline; color: #ddd; }
</style>
</head>
<body>
1a8abf18   Etienne Pallier   updated install doc
19
20
<a name="Project-Installation"></a>
<h1 >Project Installation<a href="#Project-Installation" class="wiki-anchor">&para;</a></h1>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
21
22


1a8abf18   Etienne Pallier   updated install doc
23
	<p>Project Development page : <a href="Project_Development.html" class="wiki-page">Project Development</a></p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
24

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
25

1a8abf18   Etienne Pallier   updated install doc
26
	<p>HOWTO Format Redmine Wiki : <a class="external" href="http://www.redmine.org/projects/redmine/wiki/FrRedmineWikiFormatting">http://www.redmine.org/projects/redmine/wiki/FrRedmineWikiFormatting</a></p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
27
28


1a8abf18   Etienne Pallier   updated install doc
29
30
31
32
	<ul class="toc right"><li><a href="#Project-Installation">Project Installation</a><ul><li><a href="#I-DATABASE-SCHEMA-v021">I - DATABASE SCHEMA (v0.2.1)</a></li><li><a href="#II-Get-the-project-from-gitlab">II - Get the project (from gitlab)</a><ul><li><a href="#Browse-the-code-from-gitlab">Browse the code from gitlab</a></li><li><a href="#Project-structure">Project structure</a></li><li><a href="#From-the-terminal">From the terminal</a></li><li><a href="#From-Eclipse">From Eclipse</a></li><li><a href="#For-easier-installation-you-can-use-Sqlite-instead-of-Mysql">For easier installation, you can use Sqlite instead of Mysql</a></li></ul>
</li><li><a href="#III-INSTALLATION">III - INSTALLATION</a><ul><li><a href="#Install-MySql-only-if-necessary">Install MySql (only if necessary)</a></li><li><a href="#Install-Python35-only-if-necessary">Install Python3.5 (only if necessary)</a></li><li><a href="#Create-a-Python3-virtual-environment-dedicated-to-the-project-inside-the-project-folder">Create a Python3 virtual environment dedicated to the project (inside the project folder)</a></li><li><a href="#Activate-the-python-virtual-environment-from-inside-the-project">Activate the python virtual environment (from inside the project)</a></li><li><a href="#Install-the-needed-Python-packages-from-within-the-virtual-environment">Install the needed Python packages (from within the virtual environment)</a></li><li><a href="#Eclipse-only-Set-the-Python3-virtual-environment-as-the-project-interpreter">(Eclipse only) Set the Python3 virtual environment as the project interpreter</a></li><li><a href="#Run-the-project">Run the project</a><ul><li><a href="#From-the-terminal-2">From the terminal</a></li><li><a href="#From-Eclipse-2">From Eclipse</a></li></ul>
</li></ul>
</li><li><a href="#IV-TEST">IV - TEST</a><ul><li><a href="#From-Terminal">From Terminal</a></li><li><a href="#From-Eclipse-3">From Eclipse:</a></li><li><a href="#Custom-commands-">Custom commands :</a></li></ul></li></ul></li></ul>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
33
34
35
36
37
38
39
40
41


<hr />


	<a name="I-DATABASE-SCHEMA-v021"></a>
<h2 ><span style="margin-left:0px;font-weight:bold;font-size:25px;color:red;">I - DATABASE SCHEMA (v0.2.1)</span><a href="#I-DATABASE-SCHEMA-v021" class="wiki-anchor">&para;</a></h2>


1a8abf18   Etienne Pallier   updated install doc
42
	<p><a href="/attachments/2543" class="thumbnail" title="Pyros data model"><img alt="PYROS_PDM_v021.png" src="/attachments/thumbnail/2543/300" /></a></p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
43
44
45
46
47
48
49
50
51


<hr />


	<a name="II-Get-the-project-from-gitlab"></a>
<h2 ><span style="margin-left:0px;font-weight:bold;font-size:25px;color:red;">II - Get the project (from gitlab)</span><a href="#II-Get-the-project-from-gitlab" class="wiki-anchor">&para;</a></h2>


1a8abf18   Etienne Pallier   updated install doc
52
53
	<a name="Browse-the-code-from-gitlab"></a>
<h3 >Browse the code from gitlab<a href="#Browse-the-code-from-gitlab" class="wiki-anchor">&para;</a></h3>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
54
55


1a8abf18   Etienne Pallier   updated install doc
56
	<p><a class="external" href="https://gitlab.irap.omp.eu/epallier/pyros/tree/master">https://gitlab.irap.omp.eu/epallier/pyros/tree/master</a></p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
57
58


1a8abf18   Etienne Pallier   updated install doc
59
60
	<a name="Project-structure"></a>
<h3 >Project structure<a href="#Project-structure" class="wiki-anchor">&para;</a></h3>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
61
62


1a8abf18   Etienne Pallier   updated install doc
63
	<p>Once you have fetched the project, you should obtain this structure:</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
64
65
66
67
68


<pre>

PYROS/
1a8abf18   Etienne Pallier   updated install doc
69
70
71
├── install/
│   └── REQUIREMENTS.txt
│   └── INSTALLATION.txt
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
├── public/
│   └── static/
├── src/
│   ├── manage.py
│   ├── pyros/
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   ├── settings.py
│   │   ├── urls.py
│   │   └── wsgi.py
│   └── pyrosapp/
│       ├── __init__.py
│       ├── admin.py
│       ├── apps.py
│       ├── migrations
│       ├── models.py
│       ├── tests.py
│       └── views.py

</pre>

1a8abf18   Etienne Pallier   updated install doc
93
94
	<a name="From-the-terminal"></a>
<h3 >From the terminal<a href="#From-the-terminal" class="wiki-anchor">&para;</a></h3>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
95
96
97


<pre>
1a8abf18   Etienne Pallier   updated install doc
98
99
git clone https://gitlab.irap.omp.eu/epallier/pyros.git PYROS
(or also : git clone git@gitlab.irap.omp.eu:epallier/pyros.git PYROS)
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
100
101
</pre>

1a8abf18   Etienne Pallier   updated install doc
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
	<p>This creates a PYROS/ folder containing the project (with a .git/ subfolder for synchronization with the git repository)</p>


	<p><em>If you just wanted a static copy of the project (without synchronization), just remove the .git/ folder:</em><br /><pre>
$ rm -r .git/
</pre></p>


	<a name="From-Eclipse"></a>
<h3 >From Eclipse<a href="#From-Eclipse" class="wiki-anchor">&para;</a></h3>


	<p>0) Install Eclipse (if necessary)</p>


	<p>Get the Eclipse version for Php</p>


	<p>Install the plug-in pydev (via install new software, add <a class="external" href="http://pydev.org/updates">http://pydev.org/updates</a>)</p>


	<p>1) Deactivate CA certificate verification</p>


	<p>Window -> Preferences -> Team -> git -> configuration -> Add entry</p>


	<p>Key = http.sslVerify<br />Value = false</p>


	<p>2) Fetch the project</p>


	<p>File/Import project from git</p>


	<p>Select repository source: Clone URI: <a class="external" href="https://gitlab.irap.omp.eu/epallier/pyros.git">https://gitlab.irap.omp.eu/epallier/pyros.git</a></p>


	<p>Directory: <br />par défaut, il propose : /Users/epallier/git/pyros<br />mais on peut le mettre ailleurs (c'est ce que j'ai fait)</p>


	<p>initial branch: master<br />remote name: origin</p>


	<p>Import as general project</p>


	<p>Project name: PYROS</p>


	<p>3) Configure the project</p>


	<p>The project is created. Now, you have to set it as a «PyDev » and a « Django » project.</p>


	<p>clic droit sur le projet / PyDev / set as a PyDev project</p>


	<p>clic droit sur le projet / PyDev / set as a Django project</p>


	<p>clic droit sur le projet : on doit maintenant avoir un sous-menu Django</p>


	<p>clic droit sur le dossier src / PyDev / set as source folder (add to PYTHONPATH)</p>


	<p>clic droit sur projet / Properties / Pydev-Django :<br />  - Django manage.py : src/manage.py<br />  - Django settings module : pyros.settings</p>


	<p>4) Set Code style</p>


	<p>Window/Preferences : Pydev / Editor<br />- Auto Imports : uncheck « Do auto import »<br />- Code style:<br />    - Locals … : camelCase<br />    - Methods : camelCase() with first lower<br />- Code style / Code Formatter: activer « use autopep8.py for code formatting »<br />- Tabs : Tab length : 4</p>


	<p>(<br />il faudra aussi faire un peu plus loin : <br /><a class="external" href="https://projects.irap.omp.eu/projects/pyros/wiki/Project_Installation#Eclipse-only-Set-the-Python3-virtual-environment-as-the-project-interpreter">https://projects.irap.omp.eu/projects/pyros/wiki/Project_Installation#Eclipse-only-Set-the-Python3-virtual-environment-as-the-project-interpreter</a><br />)</p>


	<a name="For-easier-installation-you-can-use-Sqlite-instead-of-Mysql"></a>
<h3 >For easier installation, you can use Sqlite instead of Mysql<a href="#For-easier-installation-you-can-use-Sqlite-instead-of-Mysql" class="wiki-anchor">&para;</a></h3>


	<p>By default, Mysql will be used, but then you will need to install the Mysql database server.</p>


	<p>Thus, in order to skip Mysql installation, use Sqlite instead as the database server (which will need no installation at all) :</p>


	<p>Edit pyros/settings.py and just set MYSQL variable to False, and that's it.</p>


e649dbb9   Etienne Pallier   INSTALLATION DOC ...
196
197
198
199
200
201
202
203
204
205
206
	<a name="III-INSTALLATION"></a>
<h2 ><span style="margin-left:0px;font-weight:bold;font-size:25px;color:red;">III - INSTALLATION</span><a href="#III-INSTALLATION" class="wiki-anchor">&para;</a></h2>


<hr />


	<a name="Install-MySql-only-if-necessary"></a>
<h3 >Install MySql (only if necessary)<a href="#Install-MySql-only-if-necessary" class="wiki-anchor">&para;</a></h3>


1a8abf18   Etienne Pallier   updated install doc
207
208
	<p><strong>Skip this step if you are using Sqlite instead of MySql</strong>

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
	<ul>
	<li>Linux Ubuntu<br /><pre>

$ sudo apt-get install mysql-server
$ sudo apt-get install mysql-client

</pre></li>
	</ul>


	<ul>
	<li>Linux CentOS<br /><pre>
TODO:
$ sudo yum install mysql
...
</pre></li>
	</ul>


	<ul>
	<li>Mac OS X<br />Install XAMPP<br />(but you could also use the pre-installed Mac OS MySql)<br /><pre>
TODO:
</pre></li>
	</ul>


	<ul>
	<li>Windows</li>
	</ul>
1a8abf18   Etienne Pallier   updated install doc
238
</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367


<pre>
Download and install the newest version on https://dev.mysql.com/downloads/installer/

Once installed, launch MySQL Installer. Clic on 'Add...' on the right.
In MySQLServers section, choose the newest, then clic on next.
Install and configure the server (just follow the installation guide).

Then launch mysql (via the Windows menu).
</pre>

<hr />


	<a name="Install-Python35-only-if-necessary"></a>
<h3 >Install Python3.5 (only if necessary)<a href="#Install-Python35-only-if-necessary" class="wiki-anchor">&para;</a></h3>


	<ul>
	<li>Mac OS X :<br /><pre>

1) Installer MacPort
(TODO: doc)

2) Installer le "port" python35
$ sudo port install python35

</pre></li>
	</ul>


	<ul>
	<li>Linux (Ubuntu) :<br /><pre>
$ sudo add-apt-repository ppa:fkrull/deadsnakes
$ sudo apt-get update
$ sudo apt-get install python3.5

$ sudo pip install virtualenv
</pre></li>
	</ul>


	<ul>
	<li>Windows 7 :<br /><pre>
Go to https://www.python.org/downloads/windows/ , choose the wanted version
On the wanted version’s page, download Windows x86 executable installer

Run the executable
    * On the first page, check "Add python3.5 to PATH" 
    * Choose "Install now" option

Open cmd (windows + R, cmd) :
 $ python -m pip install --upgrade pip
 $ pip install virtualenv
</pre></li>
	</ul>


	<ul>
	<li>Windows 10 :<br /><pre>
TODO:
</pre></li>
	</ul>


<hr />


	<a name="Create-a-Python3-virtual-environment-dedicated-to-the-project-inside-the-project-folder"></a>
<h3 >Create a Python3 virtual environment dedicated to the project (inside the project folder)<a href="#Create-a-Python3-virtual-environment-dedicated-to-the-project-inside-the-project-folder" class="wiki-anchor">&para;</a></h3>


<pre>

$ mkdir private/

$ cd private/

$ which python3.5 ("where python" for windows)
/opt/local/bin/python3.5

$ virtualenv-3.5 venv_py35_pyros -p /opt/local/bin/python3.5
=&gt; creates a venv_py35_pyros/ folder inside PYROS/private/

</pre>

<hr />


	<a name="Activate-the-python-virtual-environment-from-inside-the-project"></a>
<h3 >Activate the python virtual environment (from inside the project)<a href="#Activate-the-python-virtual-environment-from-inside-the-project" class="wiki-anchor">&para;</a></h3>


<pre>

$ pwd
.../PYROS/private

$ source ./venv_py35_pyros/bin/activate (venv_py35_pyros/Scripts/activate on Windows)

$ python -V
Python 3.5.1

$ which pip
.../PYROS/venv_py35_pyros/bin/pip

Upgrade pip to last version available:
$ pip install --upgrade pip
Collecting pip
  Downloading pip-8.1.1-py2.py3-none-any.whl (1.2MB)
Installing collected packages: pip
  Found existing installation: pip 7.1.2
    Uninstalling pip-7.1.2:
      Successfully uninstalled pip-7.1.2
Successfully installed pip-8.1.1

Upgrade wheel to last version available:
$ pip install --upgrade wheel
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
Installing collected packages: wheel
  Found existing installation: wheel 0.24.0
    Uninstalling wheel-0.24.0:
      Successfully uninstalled wheel-0.24.0
Successfully installed wheel-0.29.0

</pre>

1a8abf18   Etienne Pallier   updated install doc
368
369
370
<hr />


e649dbb9   Etienne Pallier   INSTALLATION DOC ...
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
	<a name="Install-the-needed-Python-packages-from-within-the-virtual-environment"></a>
<h3 >Install the needed Python packages (from within the virtual environment)<a href="#Install-the-needed-Python-packages-from-within-the-virtual-environment" class="wiki-anchor">&para;</a></h3>


	<p>First, be sure that the virtual environment is activated:<br /><pre>
$ python -V
Python 3.5.1
</pre></p>


	<ul>
	<li><strong>Automatic Installation of all packages</strong><br /><pre>
$ pip install -r REQUIREMENTS.txt
</pre></li>
	</ul>


	<ul>
	<li><strong>Or, manual installation of each package</strong>

	<ul>
	<li><strong>Install Django</strong> :<br /><pre>
$ pip install django
Collecting django
  Downloading Django-1.9.4-py2.py3-none-any.whl (6.6MB)
Installing collected packages: django
Successfully installed django-1.9.4

$ pip install django-admin-tools
Collecting django-admin-tools
  Downloading django_admin_tools-0.7.2-py2.py3-none-any.whl (289kB)
Installing collected packages: django-admin-tools
Successfully installed django-admin-tools-0.7.2

$ pip install django-debug-toolbar
Collecting django-debug-toolbar
  Downloading django_debug_toolbar-1.4-py2.py3-none-any.whl (212kB)
Requirement already satisfied (use --upgrade to upgrade): Django&gt;=1.7 in ./venv_py35_pyros/lib/python3.5/site-packages (from django-debug-toolbar)
Collecting sqlparse (from django-debug-toolbar)
  Downloading sqlparse-0.1.19.tar.gz (58kB)
Building wheels for collected packages: sqlparse
  Running setup.py bdist_wheel for sqlparse ... done
  Stored in directory: /Users/epallier/Library/Caches/pip/wheels/7b/d4/72/6011bb100dd5fc213164e4bbee13d4e03261dd54ce6a5de6b8
Successfully built sqlparse
Installing collected packages: sqlparse, django-debug-toolbar
Successfully installed django-debug-toolbar-1.4 sqlparse-0.1.19

$ pip install django-extensions
Collecting django-extensions
  Downloading django_extensions-1.6.1-py2.py3-none-any.whl (202kB)
Collecting six&gt;=1.2 (from django-extensions)
  Downloading six-1.10.0-py2.py3-none-any.whl
Installing collected packages: six, django-extensions
Successfully installed django-extensions-1.6.1 six-1.10.0

$ pip install django-suit
Collecting django-suit
  Downloading django-suit-0.2.18.tar.gz (587kB)
Building wheels for collected packages: django-suit
  Running setup.py bdist_wheel for django-suit ... done
  Stored in directory: /Users/epallier/Library/Caches/pip/wheels/12/8b/9a/e02ab0ad9229881638aa040d47d77c8f562999533811927d41
Successfully built django-suit
Installing collected packages: django-suit
Successfully installed django-suit-0.2.18

</pre></li>
	</ul>


	<ul>
	<li><strong>Install the web application server gunicorn (will be used in production instead of the dev django web server)</strong> :<br /><pre>
$ pip install gunicorn
Collecting gunicorn
  Downloading gunicorn-19.4.5-py2.py3-none-any.whl (112kB)
Installing collected packages: gunicorn
Successfully installed gunicorn-19.4.5
</pre></li>
	</ul>


	<ul>
	<li><strong>Install the python mysql client</strong>:<br /><pre>
$ pip install mysqlclient
...
</pre>

	<ul>
	<li>=> Issue under Mac OS X:<br /><pre>
$ pip install mysqlclient
Collecting mysqlclient
  Downloading mysqlclient-1.3.7.tar.gz (79kB)
Building wheels for collected packages: mysqlclient
  Running setup.py bdist_wheel for mysqlclient ... error
…
  ----------------------------------------
  Failed building wheel for mysqlclient
  Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
  Running setup.py install for mysqlclient ... done
Successfully installed mysqlclient-1.3.7

BOUH !!!

$ pip install --upgrade wheel
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
Installing collected packages: wheel
  Found existing installation: wheel 0.24.0
    Uninstalling wheel-0.24.0:
      Successfully uninstalled wheel-0.24.0
Successfully installed wheel-0.29.0

$ pip uninstall mysqlclient

$ pip install mysqlclient
Collecting mysqlclient
  Using cached mysqlclient-1.3.7.tar.gz
Building wheels for collected packages: mysqlclient
  Running setup.py bdist_wheel for mysqlclient ... done
  Stored in directory: /Users/epallier/Library/Caches/pip/wheels/9b/06/50/d11418c26cf8f2156b13d4363b5afde8e7e75ebb8540d0228d
Successfully built mysqlclient
Installing collected packages: mysqlclient
Successfully installed mysqlclient-1.3.7

YES !!!

</pre></li>
	</ul>


	<ul>
	<li>=> Issues under Ubuntu:<br /><pre>
$ pip install mysqlclient
Collecting mysqlclient
  Downloading mysqlclient-1.3.7.tar.gz (79kB)
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
    Complete output from command python setup.py egg_info:
    /bin/sh: 1: mysql_config: not found
    Traceback (most recent call last):
      File "&lt;string&gt;", line 1, in &lt;module&gt;
    [...]
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-q6j4inuz/mysqlclient/

BOUH !!!

$ sudo apt-get install libmysqlclient-dev

$ pip install mysqlclient
Collecting mysqlclient
  Using cached mysqlclient-1.3.7.tar.gz
Building wheels for collected packages: mysqlclient
  Running setup.py bdist_wheel for mysqlclient ... error
…
    _mysql.c:40:20: fatal error: Python.h: No such file or directory
     #include "Python.h" 
                        ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
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/

BOUH !!!

$ sudo apt-get install python3.5-dev

$ pip install mysqlclient

YES !!!

</pre></li>
	</ul></li>
	</ul></li>
	</ul>


1a8abf18   Etienne Pallier   updated install doc
548
549
550
	<ul>
	<li>=> Issue under Windows<br /><pre>
Same message as the issue for Mac.
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
551

1a8abf18   Etienne Pallier   updated install doc
552
Go to http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient to download the newest mysqlclient wheel
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
553

1a8abf18   Etienne Pallier   updated install doc
554
$ pip install path\to\mysqlclient\wheel
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
555

1a8abf18   Etienne Pallier   updated install doc
556
557
558
No need to redo "pip install mysqlclient" 
</pre></li>
	</ul>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
559

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
560
561
562
563

<hr />


1a8abf18   Etienne Pallier   updated install doc
564
565
	<a name="Eclipse-only-Set-the-Python3-virtual-environment-as-the-project-interpreter"></a>
<h3 >(Eclipse only) Set the Python3 virtual environment as the project interpreter<a href="#Eclipse-only-Set-the-Python3-virtual-environment-as-the-project-interpreter" class="wiki-anchor">&para;</a></h3>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
566
567


1a8abf18   Etienne Pallier   updated install doc
568
	<p>clic droit sur projet / Properties / PyDev - Interpreter/Grammar :<br />Grammar version : 3</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
569
570


1a8abf18   Etienne Pallier   updated install doc
571
	<p>Interpreter : click on « click here to configure an interpreter not listed »</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
572

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
573

1a8abf18   Etienne Pallier   updated install doc
574
	<p>click on « New » :<br />- Interpreter name : venv_py35_pyros<br />- Interpreter executable : click on « Browse »<br />    Select your private/venv_py35_pyros/bin/python3.5 executable<br />    click OK<br />    click OK again</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
575
576


1a8abf18   Etienne Pallier   updated install doc
577
	<p>Interpreter: select now venv_py35_pyros from the list</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
578

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
579

1a8abf18   Etienne Pallier   updated install doc
580
<hr />
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
581

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
582

1a8abf18   Etienne Pallier   updated install doc
583
584
	<a name="Run-the-project"></a>
<h3 >Run the project<a href="#Run-the-project" class="wiki-anchor">&para;</a></h3>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
585

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
586

1a8abf18   Etienne Pallier   updated install doc
587
	<p>TODO: more details... (notamment sur localhost:8000/admin)</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
588

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
589

1a8abf18   Etienne Pallier   updated install doc
590
591
	<a name="From-the-terminal-2"></a>
<h4 >From the terminal<a href="#From-the-terminal-2" class="wiki-anchor">&para;</a></h4>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
592
593
594


<pre>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
595

1a8abf18   Etienne Pallier   updated install doc
596
$ cd src/
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
597

1a8abf18   Etienne Pallier   updated install doc
598
599
600
601
602
603
$ ./manage.py runserver
(or gunicorn pyros.wsgi)
==&gt; http://localhost:8000
...
...
Ctrl-c
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
604

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
605
606
</pre>

1a8abf18   Etienne Pallier   updated install doc
607
608
	<a name="From-Eclipse-2"></a>
<h4 >From Eclipse<a href="#From-Eclipse-2" class="wiki-anchor">&para;</a></h4>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
609
610


1a8abf18   Etienne Pallier   updated install doc
611
	<p>Right clic on project -> Django/Custom command/runserver</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
612
613


1a8abf18   Etienne Pallier   updated install doc
614
	<p>Error on Ubuntu :</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
615
616


1a8abf18   Etienne Pallier   updated install doc
617
<pre>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
618

1a8abf18   Etienne Pallier   updated install doc
619
620
621
622
Traceback (most recent call last):
  File "/home/carens_p/git/pyros/src/manage.py", line 8, in &lt;module&gt;
    from django.core.management import execute_from_command_line
ImportError: No module named 'django'
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
623

1a8abf18   Etienne Pallier   updated install doc
624
</pre>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
625

1a8abf18   Etienne Pallier   updated install doc
626
	<p>Project -> Properties -> Pydev interpreter -> Clic here to configure an interpreter not listed</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
627
628


1a8abf18   Etienne Pallier   updated install doc
629
	<p>select venv_py35_pyros</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
630

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
631

1a8abf18   Etienne Pallier   updated install doc
632
	<p>In Libraries, clic on 'New folder', then select your virtualenv's lib/python3.5/site-packages folder.</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
633

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
634

1a8abf18   Etienne Pallier   updated install doc
635
	<p>OK -> re-select venv_py35_pyros in 'Interpreter' dropdown menu</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
636

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
637

1a8abf18   Etienne Pallier   updated install doc
638
	<p>Then right clic on project -> Django/Custom command/runserver</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
639

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
640

1a8abf18   Etienne Pallier   updated install doc
641
	<p>check <a class="external" href="http://localhost:8000/">http://localhost:8000/</a></p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
642
643


1a8abf18   Etienne Pallier   updated install doc
644
<hr />
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
645

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
646

1a8abf18   Etienne Pallier   updated install doc
647
648
	<a name="IV-TEST"></a>
<h2 ><span style="margin-left:0px;font-weight:bold;font-size:25px;color:red;">IV - TEST</span><a href="#IV-TEST" class="wiki-anchor">&para;</a></h2>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
649

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
650

1a8abf18   Etienne Pallier   updated install doc
651
	<p>Tests are classes declared in all apps' test.py file. The test classes inherit from django.test.TestCase</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
652

e649dbb9   Etienne Pallier   INSTALLATION DOC ...
653

1a8abf18   Etienne Pallier   updated install doc
654
	<p>You can run the tests suite, just to be sure that the software is well installed.</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
655
656


1a8abf18   Etienne Pallier   updated install doc
657
658
	<a name="From-Terminal"></a>
<h3 >From Terminal<a href="#From-Terminal" class="wiki-anchor">&para;</a></h3>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
659
660
661


<pre>
1a8abf18   Etienne Pallier   updated install doc
662
$ cd src/
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
663

1a8abf18   Etienne Pallier   updated install doc
664
$ ./manage.py test
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
665

1a8abf18   Etienne Pallier   updated install doc
666
Ran 5 tests in 0.093s
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
667

1a8abf18   Etienne Pallier   updated install doc
668
OK
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
669
670
</pre>

1a8abf18   Etienne Pallier   updated install doc
671
672
	<a name="From-Eclipse-3"></a>
<h3 >From Eclipse:<a href="#From-Eclipse-3" class="wiki-anchor">&para;</a></h3>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
673
674
675


	<ul>
1a8abf18   Etienne Pallier   updated install doc
676
	<li>Right-clic on the project / Django / Run Django tests</li>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
677
678
679
	</ul>


e649dbb9   Etienne Pallier   INSTALLATION DOC ...
680
	<ul>
1a8abf18   Etienne Pallier   updated install doc
681
	<li>Right-clic on the project / Django / Custom command / ...</li>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
682
683
684
	</ul>


1a8abf18   Etienne Pallier   updated install doc
685
686
	<a name="Custom-commands-"></a>
<h3 >Custom commands :<a href="#Custom-commands-" class="wiki-anchor">&para;</a></h3>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
687
688


1a8abf18   Etienne Pallier   updated install doc
689
	<p>$ [./manage.py] test app.tests                           # Run tests for the application 'app'<br />$ [./manage.py] test app.tests.ModelTests                # Run test methods declared in the class app.tests.ModelTests<br />$ [./manage.py] test app.tests.ModelTests.test_method    # Only run the method test_method declared in app.tests.ModelTests</p>
e649dbb9   Etienne Pallier   INSTALLATION DOC ...
690
691
</body>
</html>