Wiki

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