Wiki

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