Wiki

Version 59 (Etienne Pallier, 03/18/2016 12:12 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 1 Etienne Pallier
10 3 Etienne Pallier
---
11 1 Etienne Pallier
12 57 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}TODO%
13 57 Etienne Pallier
14 58 Etienne Pallier
ajouter lien vers pyros.sql
15 57 Etienne Pallier
16 57 Etienne Pallier
---
17 57 Etienne Pallier
18 17 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}I - INSTALLATION%
19 2 Etienne Pallier
20 51 Etienne Pallier
h3. If necessary, install MySql
21 2 Etienne Pallier
22 49 Etienne Pallier
 * Linux Ubuntu
23 49 Etienne Pallier
<pre>
24 49 Etienne Pallier
TODO:
25 49 Etienne Pallier
$ sudo apt-get install mysql
26 49 Etienne Pallier
...
27 49 Etienne Pallier
</pre>
28 49 Etienne Pallier
29 49 Etienne Pallier
 * Linux CentOS
30 49 Etienne Pallier
<pre>
31 49 Etienne Pallier
TODO:
32 49 Etienne Pallier
$ sudo yum install mysql
33 49 Etienne Pallier
...
34 49 Etienne Pallier
</pre>
35 49 Etienne Pallier
36 49 Etienne Pallier
 * Mac OS X
37 49 Etienne Pallier
<pre>
38 49 Etienne Pallier
TODO:
39 49 Etienne Pallier
Install XAMPP
40 49 Etienne Pallier
(but you could also use the pre-installed Mac OS MySql)
41 49 Etienne Pallier
</pre>
42 49 Etienne Pallier
43 49 Etienne Pallier
 * Windows
44 49 Etienne Pallier
<pre>
45 49 Etienne Pallier
TODO:
46 49 Etienne Pallier
</pre>
47 49 Etienne Pallier
48 49 Etienne Pallier
49 49 Etienne Pallier
---
50 1 Etienne Pallier
51 6 Etienne Pallier
h3. Create database
52 1 Etienne Pallier
53 52 Etienne Pallier
54 52 Etienne Pallier
 * Linux and Mac OS X:
55 52 Etienne Pallier
<pre>
56 3 Etienne Pallier
One liner:
57 3 Etienne Pallier
$ mysql -u root < pyros.sql
58 1 Etienne Pallier
59 3 Etienne Pallier
Or :
60 3 Etienne Pallier
$ mysql -u root
61 3 Etienne Pallier
mysql> create database pyros;
62 3 Etienne Pallier
mysql> use pyros;
63 3 Etienne Pallier
mysql> source pyros.sql;
64 1 Etienne Pallier
65 3 Etienne Pallier
(
66 3 Etienne Pallier
TODO:
67 3 Etienne Pallier
mysql> grant all on pyros.* to pyros@localhost identified by ‘pyros’;)
68 3 Etienne Pallier
mysql> flush privileges;
69 3 Etienne Pallier
)
70 52 Etienne Pallier
</pre>
71 1 Etienne Pallier
72 53 Etienne Pallier
73 53 Etienne Pallier
 * Windows:
74 52 Etienne Pallier
<pre>
75 52 Etienne Pallier
TODO: Use phpmyadmin ?
76 52 Etienne Pallier
</pre>
77 1 Etienne Pallier
78 1 Etienne Pallier
79 4 Etienne Pallier
---
80 5 Etienne Pallier
81 6 Etienne Pallier
h3. Install python3.5
82 1 Etienne Pallier
83 11 Etienne Pallier
84 11 Etienne Pallier
 * Mac OS X :
85 23 Etienne Pallier
<pre>
86 24 Etienne Pallier
1) Installer MacPort
87 24 Etienne Pallier
(TODO: doc)
88 24 Etienne Pallier
89 24 Etienne Pallier
2) Installer le "port" python35
90 1 Etienne Pallier
$ sudo port install python35
91 23 Etienne Pallier
</pre>
92 1 Etienne Pallier
93 11 Etienne Pallier
 * Linux (Ubuntu) :
94 23 Etienne Pallier
<pre>
95 1 Etienne Pallier
$ sudo apt-get ...
96 23 Etienne Pallier
</pre>
97 1 Etienne Pallier
98 5 Etienne Pallier
99 3 Etienne Pallier
100 4 Etienne Pallier
---
101 5 Etienne Pallier
102 13 Etienne Pallier
h3. Create project dir
103 13 Etienne Pallier
104 13 Etienne Pallier
$ mkdir pyros
105 13 Etienne Pallier
106 13 Etienne Pallier
107 13 Etienne Pallier
---
108 13 Etienne Pallier
109 59 Etienne Pallier
110 59 Etienne Pallier
h3. Get the project (from git)
111 59 Etienne Pallier
112 59 Etienne Pallier
TODO:
113 59 Etienne Pallier
114 59 Etienne Pallier
115 59 Etienne Pallier
---
116 59 Etienne Pallier
117 14 Etienne Pallier
h3. Create virtualenv with python3.5 dedicated to pyros project
118 3 Etienne Pallier
119 3 Etienne Pallier
$ cd pyros/
120 3 Etienne Pallier
121 3 Etienne Pallier
$ which python3.5
122 3 Etienne Pallier
/opt/local/bin/python3.5
123 3 Etienne Pallier
124 15 Etienne Pallier
$ virtualenv-3.5 venv_py35_pyros -p /opt/local/bin/python3.5
125 3 Etienne Pallier
=> creates a venv_py35_pyros/ folder inside pyros/
126 3 Etienne Pallier
127 1 Etienne Pallier
128 1 Etienne Pallier
129 7 Etienne Pallier
---
130 3 Etienne Pallier
131 16 Etienne Pallier
h3. Activate venv
132 7 Etienne Pallier
133 55 Etienne Pallier
<pre>
134 55 Etienne Pallier
135 3 Etienne Pallier
$ source venv_py35_pyros/bin/activate
136 3 Etienne Pallier
137 3 Etienne Pallier
$ python -V
138 3 Etienne Pallier
Python 3.5.1
139 3 Etienne Pallier
140 3 Etienne Pallier
$ which pip
141 1 Etienne Pallier
…/pyros/venv_py35_pyros/bin/pip
142 16 Etienne Pallier
143 18 Etienne Pallier
Upgrade pip to last version available :
144 3 Etienne Pallier
$ pip install --upgrade pip
145 3 Etienne Pallier
Collecting pip
146 3 Etienne Pallier
  Downloading pip-8.1.1-py2.py3-none-any.whl (1.2MB)
147 3 Etienne Pallier
Installing collected packages: pip
148 3 Etienne Pallier
  Found existing installation: pip 7.1.2
149 3 Etienne Pallier
    Uninstalling pip-7.1.2:
150 3 Etienne Pallier
      Successfully uninstalled pip-7.1.2
151 1 Etienne Pallier
Successfully installed pip-8.1.1
152 55 Etienne Pallier
153 55 Etienne Pallier
</pre>
154 18 Etienne Pallier
155 27 Etienne Pallier
h3. Install needed python packages (from within the virtual environment)
156 18 Etienne Pallier
157 3 Etienne Pallier
158 33 Etienne Pallier
*Install Django* :
159 32 Etienne Pallier
160 32 Etienne Pallier
<pre>
161 3 Etienne Pallier
$ pip install django
162 3 Etienne Pallier
Collecting django
163 3 Etienne Pallier
  Downloading Django-1.9.4-py2.py3-none-any.whl (6.6MB)
164 3 Etienne Pallier
Installing collected packages: django
165 3 Etienne Pallier
Successfully installed django-1.9.4
166 3 Etienne Pallier
167 3 Etienne Pallier
$ pip install django-admin-tools
168 3 Etienne Pallier
Collecting django-admin-tools
169 3 Etienne Pallier
  Downloading django_admin_tools-0.7.2-py2.py3-none-any.whl (289kB)
170 3 Etienne Pallier
Installing collected packages: django-admin-tools
171 3 Etienne Pallier
Successfully installed django-admin-tools-0.7.2
172 3 Etienne Pallier
173 21 Etienne Pallier
$ pip install django-debug-toolbar
174 21 Etienne Pallier
Collecting django-debug-toolbar
175 21 Etienne Pallier
  Downloading django_debug_toolbar-1.4-py2.py3-none-any.whl (212kB)
176 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)
177 21 Etienne Pallier
Collecting sqlparse (from django-debug-toolbar)
178 21 Etienne Pallier
  Downloading sqlparse-0.1.19.tar.gz (58kB)
179 21 Etienne Pallier
Building wheels for collected packages: sqlparse
180 21 Etienne Pallier
  Running setup.py bdist_wheel for sqlparse ... done
181 21 Etienne Pallier
  Stored in directory: /Users/epallier/Library/Caches/pip/wheels/7b/d4/72/6011bb100dd5fc213164e4bbee13d4e03261dd54ce6a5de6b8
182 21 Etienne Pallier
Successfully built sqlparse
183 21 Etienne Pallier
Installing collected packages: sqlparse, django-debug-toolbar
184 21 Etienne Pallier
Successfully installed django-debug-toolbar-1.4 sqlparse-0.1.19
185 21 Etienne Pallier
186 21 Etienne Pallier
$ pip install django-extensions
187 21 Etienne Pallier
Collecting django-extensions
188 21 Etienne Pallier
  Downloading django_extensions-1.6.1-py2.py3-none-any.whl (202kB)
189 21 Etienne Pallier
Collecting six>=1.2 (from django-extensions)
190 21 Etienne Pallier
  Downloading six-1.10.0-py2.py3-none-any.whl
191 21 Etienne Pallier
Installing collected packages: six, django-extensions
192 21 Etienne Pallier
Successfully installed django-extensions-1.6.1 six-1.10.0
193 21 Etienne Pallier
194 21 Etienne Pallier
$ pip install django-suit
195 21 Etienne Pallier
Collecting django-suit
196 21 Etienne Pallier
  Downloading django-suit-0.2.18.tar.gz (587kB)
197 21 Etienne Pallier
Building wheels for collected packages: django-suit
198 1 Etienne Pallier
  Running setup.py bdist_wheel for django-suit ... done
199 1 Etienne Pallier
  Stored in directory: /Users/epallier/Library/Caches/pip/wheels/12/8b/9a/e02ab0ad9229881638aa040d47d77c8f562999533811927d41
200 1 Etienne Pallier
Successfully built django-suit
201 1 Etienne Pallier
Installing collected packages: django-suit
202 1 Etienne Pallier
Successfully installed django-suit-0.2.18
203 21 Etienne Pallier
204 32 Etienne Pallier
</pre>
205 32 Etienne Pallier
206 33 Etienne Pallier
*Install the web application server gunicorn (will be used in production instead of the dev django web server)* :
207 32 Etienne Pallier
<pre>
208 25 Etienne Pallier
$ pip install gunicorn
209 25 Etienne Pallier
Collecting gunicorn
210 25 Etienne Pallier
  Downloading gunicorn-19.4.5-py2.py3-none-any.whl (112kB)
211 21 Etienne Pallier
Installing collected packages: gunicorn
212 26 Etienne Pallier
Successfully installed gunicorn-19.4.5
213 32 Etienne Pallier
</pre>
214 1 Etienne Pallier
215 33 Etienne Pallier
*Install the python mysql client*:
216 32 Etienne Pallier
<pre>
217 32 Etienne Pallier
$ pip install mysqlclient
218 32 Etienne Pallier
...
219 32 Etienne Pallier
</pre>
220 20 Etienne Pallier
221 33 Etienne Pallier
=> Issue under Mac OS X:
222 21 Etienne Pallier
<pre>
223 20 Etienne Pallier
224 3 Etienne Pallier
Collecting mysqlclient
225 3 Etienne Pallier
  Downloading mysqlclient-1.3.7.tar.gz (79kB)
226 1 Etienne Pallier
Building wheels for collected packages: mysqlclient
227 22 Etienne Pallier
  Running setup.py bdist_wheel for mysqlclient ... error
228 3 Etienne Pallier
229 3 Etienne Pallier
  ----------------------------------------
230 1 Etienne Pallier
  Failed building wheel for mysqlclient
231 1 Etienne Pallier
  Running setup.py clean for mysqlclient
232 1 Etienne Pallier
Failed to build mysqlclient
233 1 Etienne Pallier
Installing collected packages: mysqlclient
234 1 Etienne Pallier
  Running setup.py install for mysqlclient ... done
235 1 Etienne Pallier
Successfully installed mysqlclient-1.3.7
236 1 Etienne Pallier
237 1 Etienne Pallier
BOUH !!!
238 1 Etienne Pallier
239 1 Etienne Pallier
$ pip install --upgrade wheel
240 1 Etienne Pallier
Collecting wheel
241 1 Etienne Pallier
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
242 1 Etienne Pallier
Installing collected packages: wheel
243 1 Etienne Pallier
  Found existing installation: wheel 0.24.0
244 1 Etienne Pallier
    Uninstalling wheel-0.24.0:
245 1 Etienne Pallier
      Successfully uninstalled wheel-0.24.0
246 1 Etienne Pallier
Successfully installed wheel-0.29.0
247 1 Etienne Pallier
248 1 Etienne Pallier
$ pip uninstall mysqlclient
249 1 Etienne Pallier
250 1 Etienne Pallier
$ pip install mysqlclient
251 1 Etienne Pallier
Collecting mysqlclient
252 1 Etienne Pallier
  Using cached mysqlclient-1.3.7.tar.gz
253 1 Etienne Pallier
Building wheels for collected packages: mysqlclient
254 1 Etienne Pallier
  Running setup.py bdist_wheel for mysqlclient ... done
255 1 Etienne Pallier
  Stored in directory: /Users/epallier/Library/Caches/pip/wheels/9b/06/50/d11418c26cf8f2156b13d4363b5afde8e7e75ebb8540d0228d
256 1 Etienne Pallier
Successfully built mysqlclient
257 1 Etienne Pallier
Installing collected packages: mysqlclient
258 1 Etienne Pallier
Successfully installed mysqlclient-1.3.7
259 1 Etienne Pallier
260 1 Etienne Pallier
YES !!!
261 21 Etienne Pallier
</pre>
262 1 Etienne Pallier
263 1 Etienne Pallier
264 12 Etienne Pallier
265 12 Etienne Pallier
266 12 Etienne Pallier
---
267 12 Etienne Pallier
268 28 Etienne Pallier
h3. Project organization
269 12 Etienne Pallier
 
270 29 Etienne Pallier
Example of a good organization :
271 1 Etienne Pallier
272 29 Etienne Pallier
1 project = N applis
273 29 Etienne Pallier
(but 1 appli can be part of many projects)
274 30 Etienne Pallier
(then 1 appli = N models)
275 12 Etienne Pallier
276 31 Etienne Pallier
<pre>
277 34 Etienne Pallier
278 29 Etienne Pallier
MYPROJECT/
279 34 Etienne Pallier
280 50 Etienne Pallier
281 1 Etienne Pallier
	src/
282 1 Etienne Pallier
		myproject/
283 34 Etienne Pallier
		appli1/
284 34 Etienne Pallier
		appli2/
285 12 Etienne Pallier
286 34 Etienne Pallier
		appliN/
287 34 Etienne Pallier
288 12 Etienne Pallier
	public/
289 34 Etienne Pallier
		static/
290 34 Etienne Pallier
291 12 Etienne Pallier
	private/
292 1 Etienne Pallier
		requirements.txt
293 50 Etienne Pallier
294 50 Etienne Pallier
	venv_py35_pyros/
295 50 Etienne Pallier
296 1 Etienne Pallier
</pre>
297 1 Etienne Pallier
298 1 Etienne Pallier
299 37 Etienne Pallier
Set needed folders:
300 37 Etienne Pallier
<pre>
301 37 Etienne Pallier
$ cd pyros/
302 12 Etienne Pallier
$ mkdir private public
303 12 Etienne Pallier
$ mkdir public/static
304 37 Etienne Pallier
</pre>
305 3 Etienne Pallier
306 7 Etienne Pallier
---
307 3 Etienne Pallier
308 39 Etienne Pallier
h3. Create Django project pyros
309 7 Etienne Pallier
310 38 Etienne Pallier
<pre>
311 38 Etienne Pallier
$ cd pyros/
312 38 Etienne Pallier
313 3 Etienne Pallier
$ django-admin startproject pyros
314 3 Etienne Pallier
315 3 Etienne Pallier
$ tree pyros/
316 3 Etienne Pallier
pyros/
317 3 Etienne Pallier
├── manage.py
318 3 Etienne Pallier
└── pyros
319 3 Etienne Pallier
    ├── __init__.py
320 3 Etienne Pallier
    ├── settings.py
321 3 Etienne Pallier
    ├── urls.py
322 3 Etienne Pallier
    └── wsgi.py
323 3 Etienne Pallier
324 3 Etienne Pallier
$ mv pyros src
325 3 Etienne Pallier
326 3 Etienne Pallier
$ cd src/
327 3 Etienne Pallier
328 3 Etienne Pallier
$ ./manage.py runserver
329 40 Etienne Pallier
(or gunicorn pyros.wsgi)
330 1 Etienne Pallier
==> http://localhost:8000
331 38 Etienne Pallier
</pre>
332 3 Etienne Pallier
333 3 Etienne Pallier
334 7 Etienne Pallier
---
335 3 Etienne Pallier
336 42 Etienne Pallier
h3. Set Database engine as MySql
337 7 Etienne Pallier
338 3 Etienne Pallier
Edit src/pyros/settings.py
339 3 Etienne Pallier
340 41 Etienne Pallier
<pre>
341 3 Etienne Pallier
DATABASES = {
342 3 Etienne Pallier
    'default': {
343 3 Etienne Pallier
        'ENGINE': 'django.db.backends.mysql',
344 1 Etienne Pallier
        'NAME': 'pyros',
345 3 Etienne Pallier
        'USER': 'root',
346 1 Etienne Pallier
        'PASSWORD': ''
347 1 Etienne Pallier
    }
348 1 Etienne Pallier
}
349 41 Etienne Pallier
</pre>
350 3 Etienne Pallier
351 7 Etienne Pallier
---
352 3 Etienne Pallier
353 43 Etienne Pallier
h3. Import database into Django (with inspectdb)
354 7 Etienne Pallier
355 43 Etienne Pallier
$ cd src/
356 3 Etienne Pallier
357 3 Etienne Pallier
$ ./manage.py inspectdb > models.py
358 3 Etienne Pallier
359 44 Etienne Pallier
*Issue on Mac OS X*:
360 44 Etienne Pallier
<pre>
361 3 Etienne Pallier
Traceback (most recent call last):
362 3 Etienne Pallier
  File "/Users/epallier/Documents/_W_more/PROJECTS/GFT/SOFT/PYROS/pyros/venv_py35_pyros/lib/python3.5/site-packages/django/db/backends/mysql/base.py", line 25, in <module>
363 3 Etienne Pallier
    import MySQLdb as Database
364 3 Etienne Pallier
  File "/Users/epallier/Documents/_W_more/PROJECTS/GFT/SOFT/PYROS/pyros/venv_py35_pyros/lib/python3.5/site-packages/MySQLdb/__init__.py", line 19, in <module>
365 3 Etienne Pallier
    import _mysql
366 3 Etienne Pallier
ImportError: dlopen(/Users/epallier/Documents/_W_more/PROJECTS/GFT/SOFT/PYROS/pyros/venv_py35_pyros/lib/python3.5/site-packages/_mysql.cpython-35m-darwin.so, 2): Library not loaded: libmysqlclient.18.dylib
367 3 Etienne Pallier
  Referenced from: /Users/epallier/Documents/_W_more/PROJECTS/GFT/SOFT/PYROS/pyros/venv_py35_pyros/lib/python3.5/site-packages/_mysql.cpython-35m-darwin.so
368 3 Etienne Pallier
  Reason: image not found
369 3 Etienne Pallier
370 3 Etienne Pallier
=> BOUH !!!
371 3 Etienne Pallier
372 3 Etienne Pallier
LA SOLUTION EST ICI : http://stackoverflow.com/questions/6383310/python-mysqldb-library-not-loaded-libmysqlclient-18-dylib
373 3 Etienne Pallier
374 3 Etienne Pallier
(
375 3 Etienne Pallier
Apparemment, ceci aurait dû suffire:
376 3 Etienne Pallier
mkdir -p /usr/local/lib   
377 3 Etienne Pallier
ln -s /usr/local/mysql/lib/libmysql* /usr/local/lib
378 3 Etienne Pallier
)
379 3 Etienne Pallier
380 3 Etienne Pallier
Mais j’ai fait ceci:
381 3 Etienne Pallier
382 3 Etienne Pallier
$ otool -L /Users/epallier/Documents/_W_more/PROJECTS/GFT/SOFT/PYROS/pyros/venv_py35_pyros/lib/python3.5/site-packages/_mysql.cpython-35m-darwin.so
383 3 Etienne Pallier
/Users/epallier/Documents/_W_more/PROJECTS/GFT/SOFT/PYROS/pyros/venv_py35_pyros/lib/python3.5/site-packages/_mysql.cpython-35m-darwin.so:
384 1 Etienne Pallier
	libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0)
385 10 Etienne Pallier
...
386 3 Etienne Pallier
387 3 Etienne Pallier
$ locate libmysqlclient.18.dylib
388 3 Etienne Pallier
/Applications/XAMPP/xamppfiles/lib/libmysqlclient.18.dylib
389 1 Etienne Pallier
/Library/SystemMigration/History/Migration-68137DFB-CB6A-4FBB-81E2-11BDB5D01E48/QuarantineRoot/usr/lib/libmysqlclient.18.dylib
390 1 Etienne Pallier
391 1 Etienne Pallier
$ sudo install_name_tool -change libmysqlclient.18.dylib /Applications/XAMPP/xamppfiles/lib/libmysqlclient.18.dylib /Users/epallier/Documents/_W_more/PROJECTS/GFT/SOFT/PYROS/pyros/venv_py35_pyros/lib/python3.5/site-packages/_mysql.cpython-35m-darwin.so
392 1 Etienne Pallier
393 10 Etienne Pallier
$ otool -L /Users/epallier/Documents/_W_more/PROJECTS/GFT/SOFT/PYROS/pyros/venv_py35_pyros/lib/python3.5/site-packages/_mysql.cpython-35m-darwin.so
394 10 Etienne Pallier
/Users/epallier/Documents/_W_more/PROJECTS/GFT/SOFT/PYROS/pyros/venv_py35_pyros/lib/python3.5/site-packages/_mysql.cpython-35m-darwin.so:
395 10 Etienne Pallier
	/Applications/XAMPP/xamppfiles/lib/libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0)
396 10 Etienne Pallier
...
397 3 Etienne Pallier
398 1 Etienne Pallier
$ ./manage.py inspectdb > models.py
399 1 Etienne Pallier
400 3 Etienne Pallier
=> YES !!!
401 44 Etienne Pallier
</pre>
402 3 Etienne Pallier
403 3 Etienne Pallier
404 7 Etienne Pallier
---
405 3 Etienne Pallier
406 48 Etienne Pallier
h3. Create a Django application pyrosapp
407 7 Etienne Pallier
408 3 Etienne Pallier
$ ./manage.py startapp pyrosapp
409 3 Etienne Pallier
410 3 Etienne Pallier
$ tree src
411 3 Etienne Pallier
src
412 3 Etienne Pallier
├── manage.py
413 3 Etienne Pallier
├── pyros
414 3 Etienne Pallier
│   ├── __init__.py
415 3 Etienne Pallier
│   ├── __pycache__
416 3 Etienne Pallier
│   │   ├── __init__.cpython-35.pyc
417 3 Etienne Pallier
│   │   ├── settings.cpython-35.pyc
418 3 Etienne Pallier
│   │   ├── urls.cpython-35.pyc
419 3 Etienne Pallier
│   │   └── wsgi.cpython-35.pyc
420 3 Etienne Pallier
│   ├── settings.py
421 3 Etienne Pallier
│   ├── urls.py
422 3 Etienne Pallier
│   └── wsgi.py
423 3 Etienne Pallier
└── pyrosapp
424 3 Etienne Pallier
    ├── __init__.py
425 1 Etienne Pallier
    ├── admin.py
426 3 Etienne Pallier
    ├── apps.py
427 1 Etienne Pallier
    ├── migrations
428 1 Etienne Pallier
    │   └── __init__.py
429 3 Etienne Pallier
    ├── models.py
430 3 Etienne Pallier
    ├── tests.py
431 3 Etienne Pallier
    └── views.py
432 1 Etienne Pallier
433 1 Etienne Pallier
434 7 Etienne Pallier
---
435 1 Etienne Pallier
436 7 Etienne Pallier
h3. Replace the default pyrosapp models.py with the inspectdb generated one
437 7 Etienne Pallier
438 3 Etienne Pallier
$ mv models.py pyrosapp/
439 3 Etienne Pallier
440 3 Etienne Pallier
441 3 Etienne Pallier
442 3 Etienne Pallier
443 7 Etienne Pallier
444 1 Etienne Pallier
---
445 9 Etienne Pallier
446 47 Etienne Pallier
h3. *TODO: Fix and improve the inspectdb generated file models.py*
447 3 Etienne Pallier
448 3 Etienne Pallier
$ cd pyrosapp/
449 3 Etienne Pallier
450 8 Etienne Pallier
$ vi models.py