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