Wiki

Version 272 (Etienne Pallier, 03/23/2016 08:39 am)

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