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