-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex2.html
456 lines (414 loc) · 33 KB
/
index2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
<!DOCTYPE html>
<html lang="en">
<head>
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,400italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="http://www.emadmokhtar.com/theme/stylesheet/style.min.css">
<link rel="stylesheet" type="text/css" href="http://www.emadmokhtar.com/theme/stylesheet/pygments.min.css">
<link rel="stylesheet" type="text/css" href="http://www.emadmokhtar.com/theme/stylesheet/font-awesome.min.css">
<link href="http://www.emadmokhtar.com/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Emad Mokhtar's Framework Atom">
<link href="http://www.emadmokhtar.com/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Emad Mokhtar's Framework RSS">
<link rel="shortcut icon" href="http://www.emadmokhtar.com/images/favicon.ico" type="image/x-icon">
<link rel="icon" href="http://www.emadmokhtar.com/images/favicon.ico" type="image/x-icon">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="" />
<meta name="author" content="Emad Mokhtar" />
<meta name="description" content="My thoughts and experince on software development and life." />
<meta property="og:site_name" content="Emad Mokhtar's Framework"/>
<meta property="og:type" content="blog"/>
<meta property="og:title" content="Emad Mokhtar's Framework"/>
<meta property="og:description" content="My thoughts and experince on software development and life."/>
<meta property="og:locale" content="en_US"/>
<meta property="og:url" content="http://www.emadmokhtar.com"/>
<meta property="og:image" content="http://www.emadmokhtar.com/images/profile.jpg">
<title>Emad Mokhtar's Framework</title>
</head>
<body>
<aside>
<div>
<a href="http://www.emadmokhtar.com">
<img src="http://www.emadmokhtar.com/images/profile.jpg" alt="" title="">
</a>
<h1><a href="http://www.emadmokhtar.com"></a></h1>
<p>Geek developer who's in search of code perfection.</p>
<nav>
<ul class="list">
<li><a href="http://www.emadmokhtar.com">Blog</a></li>
<li><a href="http://www.emadmokhtar.com/pages/podcasts.html#podcasts">Podcasts</a></li>
<li><a href="http://www.emadmokhtar.com/pages/projects.html#projects">Projects</a></li>
<li><a href="https://emadmokhtar.github.io/resume" target="_blank">Resume</a></li>
</ul>
</nav>
<ul class="social">
<li><a class="sc-envelope-o" href="mailto:emad@emadmokhtar.com" target="_blank"><i class="fa fa-envelope-o"></i></a></li>
<li><a class="sc-github" href="https://www.github.com/EmadMokhtar" target="_blank"><i class="fa fa-github"></i></a></li>
<li><a class="sc-linkedin" href="https://www.linkedin.com/in/emadmokhtar/" target="_blank"><i class="fa fa-linkedin"></i></a></li>
<li><a class="sc-stack-overflow" href="http://stackoverflow.com/users/373051/emad-mokhtar" target="_blank"><i class="fa fa-stack-overflow"></i></a></li>
<li><a class="sc-facebook" href="https://www.facebook.com/emadmokhtarframework/" target="_blank"><i class="fa fa-facebook"></i></a></li>
<li><a class="sc-twitter" href="https://twitter.com/emadmokhtar" target="_blank"><i class="fa fa-twitter"></i></a></li>
</ul>
</div>
</aside>
<main>
<nav>
<a href="http://www.emadmokhtar.com">Home</a>
<a href="https://emadmokhtar.github.io/resume">Resume</a>
<a href="http://www.emadmokhtar.com/feeds/all.atom.xml">Atom</a>
<a href="http://www.emadmokhtar.com/feeds/all.rss.xml">RSS</a>
</nav>
<article>
<header>
<h2><a href="http://www.emadmokhtar.com/client-side-validation-for-django-forms.html#client-side-validation-for-django-forms">Client side validation for Django Forms</a></h2>
<p>
Posted on Wed 08 March 2017 in <a href="http://www.emadmokhtar.com/category/django.html">Django</a>
• Tagged with
<a href="http://www.emadmokhtar.com/tag/django.html">Django</a>, <a href="http://www.emadmokhtar.com/tag/forms.html">Forms</a> • <a href="http://www.emadmokhtar.com/client-side-validation-for-django-forms.html#disqus_thread">Leave a comment</a>
</p>
</header>
<div>
<p><img alt="Parsley" src="http://www.emadmokhtar.com/images/parsley.jpg"></p>
<p><a href="https://www.lovethegarden.com/sites/default/files/styles/full_width_700/public/images_and_media/parsley.jpg?itok=X7psNkrF">source</a></p>
<p>In DUTH 2016 there was a session for <a href="https://youtu.be/uzTaWKcMzos">Django Validation by Loïc Bistuer</a>, in the session Loïc showed many areas you can validate user inputs from Django Form way to the Database Engine. To be honest validation in Django is a piece of cake and even if there is special validation rules you want to implement, you can still implement it, as I said it is easy and straight forward in Django, all of these validation is server side which happen on web server not on client-side, so what about client side?</p>
<h1>What is client side validation?</h1>
<p>In simple way, client side validation is validation user input on browser before sending the data to sever.</p>
<p>It is good practice to validate user inputs from client side to save roundtrips to server, but it needs extra work to implement your validations using JavaScript or using HTML5 form validation, but there is a way to replicate Django form validation to client side, let’s see how.</p>
<h1>Django Parsley</h1>
<p><a href="https://github.com/agiliq/Django-parsley">Django Parsley</a> is a Django app that replicate Django Form validation to client side using <a href="http://parsleyjs.org">ParsleyJS</a> library, and it’s so easy to use it.</p>
<h1>How to use Django Parsley?</h1>
<ul>
<li>
<p>Install Django Parsley …</p></li></ul>
<a class="btn" href="http://www.emadmokhtar.com/client-side-validation-for-django-forms.html#client-side-validation-for-django-forms">Continue reading</a>
</div>
<hr />
</article>
<article>
<header>
<h2><a href="http://www.emadmokhtar.com/django-is-boring-but-you-can-contribute.html#django-is-boring-but-you-can-contribute">Django is boring but you can contribute</a></h2>
<p>
Posted on Sun 08 January 2017 in <a href="http://www.emadmokhtar.com/category/community.html">Community</a>
• Tagged with
<a href="http://www.emadmokhtar.com/tag/community.html">community</a>, <a href="http://www.emadmokhtar.com/tag/django.html">Django</a>, <a href="http://www.emadmokhtar.com/tag/duth.html">duth</a> • <a href="http://www.emadmokhtar.com/django-is-boring-but-you-can-contribute.html#disqus_thread">Leave a comment</a>
</p>
</header>
<div>
<p><img alt="Bored employee in front of computer" src="http://blog.inf.ed.ac.uk/sapm/files/2014/03/boredom.jpg"></p>
<p>I attended Django Under The Hood 2016, in sprints there is a comment passing around which <a href="https://www.caktusgroup.com/blog/2016/12/14/django-boring-or-why-tech-startups-should-use-django/">Django is boring</a>. Django is boring is actually a good news for the framework users, but it's sad one for developers want to contribute to the framework.</p>
<p>Every time I go to check <a href="https://code.djangoproject.com/">Django tickets</a> to contribute, I found they are difficult and in depth, because Django is a mature project now and the amount of contribution needed to the codebase is rare, but if you want to contribute you can check <a href="https://code.djangoproject.com/query?status=!closed&easy=1">easy pickings</a> tickets. In DUTH before the sprints projects leaders start to ask attendees for contributions, I found this is a good opportunity for me and for anyone wants to help the community and start to contribute to Django community.</p>
<p><img alt="Github duth contributions" src="http://www.emadmokhtar.com/images/duth-contribution.png"></p>
<p>If you want to contribute to Django and help the community, I have some suggestions for you:</p>
<ol>
<li>Write blog posts on How-tos, tips, and tutorials for Django, and <a href="https://djangopackages.org/">Django packages</a> for example Django REST Framework.</li>
<li>Help Django team to <a href="https://docs.djangoproject.com/en/1.10/internals/contributing/triaging-tickets/#triage-workflow">move the ticket from stage to another</a>.</li>
<li>Contribute to one of Django’s packages, specially packages you are using, check their github page and help them.</li>
<li>Tried more than one package for X …</li></ol>
<a class="btn" href="http://www.emadmokhtar.com/django-is-boring-but-you-can-contribute.html#django-is-boring-but-you-can-contribute">Continue reading</a>
</div>
<hr />
</article>
<article>
<header>
<h2><a href="http://www.emadmokhtar.com/yet-another-and-easier-way-to-daemonize-celery.html#yet-another-and-easier-way-to-daemonize-celery">Yet another and easier way to daemonize Celery</a></h2>
<p>
Posted on Mon 21 November 2016 in <a href="http://www.emadmokhtar.com/category/django.html">Django</a>
• Tagged with
<a href="http://www.emadmokhtar.com/tag/django.html">django</a>, <a href="http://www.emadmokhtar.com/tag/python.html">python</a>, <a href="http://www.emadmokhtar.com/tag/celery.html">celery</a> • <a href="http://www.emadmokhtar.com/yet-another-and-easier-way-to-daemonize-celery.html#disqus_thread">Leave a comment</a>
</p>
</header>
<div>
<p>I wrote a post about <a href="http://www.emadmokhtar.com/how-to-run-celery-as-daemon.html">how to run celery as daemon</a> and it has many steps to do, many files to copy to your server, configure permissions, and configure upstart, but after sometime I found another and easier way to daemonize Celery.</p>
<p>In this method we will use <a href="http://supervisord.org">supervisor</a> to daemonize Celery, and this can be achieved by 3 simple steps, so let's do it.</p>
<h1>Step 1</h1>
<p>Install Supervisord <code>sudo apt-get install supervisor</code> on Ubuntu server. For other OSs please visit <a href="http://supervisord.org/installing.html">the official documentation</a></p>
<h1>Step 2</h1>
<p>This is the most important step, and in this step we will create supervisor configuration file to daemonize Celery.</p>
<h2>Supervisor Configuration File</h2>
<p>Celery project provide the basic configuration file in their <a href="https://github.com/celery/celery/blob/3.1/extra/supervisord/celeryd.conf">Github repository</a>.</p>
<p>Supervisor configuration files live in <code>\etc\supervisor\conf\</code></p>
<h3>Celery official configuration file</h3>
<div class="highlight"><pre><span></span><span class="p">;</span> <span class="o">==================================</span>
<span class="p">;</span> celery worker supervisor example
<span class="p">;</span> <span class="o">==================================</span>
<span class="o">[</span>program:celery<span class="o">]</span>
<span class="p">;</span> Set full path to celery program <span class="k">if</span> using virtualenv
<span class="nv">command</span><span class="o">=</span>celery worker -A proj --loglevel<span class="o">=</span>INFO
<span class="nv">directory</span><span class="o">=</span>/path/to/project
<span class="nv">user</span><span class="o">=</span>nobody
<span class="nv">numprocs</span><span class="o">=</span><span class="m">1</span>
<span class="nv">stdout_logfile</span><span class="o">=</span>/var/log/celery/worker.log
<span class="nv">stderr_logfile</span><span class="o">=</span>/var/log/celery/worker.log
<span class="nv">autostart</span><span class="o">=</span><span class="nb">true</span>
<span class="nv">autorestart</span><span class="o">=</span><span class="nb">true</span>
<span class="nv">startsecs</span><span class="o">=</span><span class="m">10</span>
<span class="p">;</span> Need to <span class="nb">wait</span> <span class="k">for</span> currently executing tasks to finish at shutdown.
<span class="p">;</span> Increase this <span class="k">if</span> you have very long running tasks.
<span class="nv">stopwaitsecs …</span></pre></div>
<a class="btn" href="http://www.emadmokhtar.com/yet-another-and-easier-way-to-daemonize-celery.html#yet-another-and-easier-way-to-daemonize-celery">Continue reading</a>
</div>
<hr />
</article>
<article>
<header>
<h2><a href="http://www.emadmokhtar.com/add-isort-and-flake8-test-to-your-django-project.html#add-isort-and-flake8-test-to-your-django-project">Add isort and flake8 test to your Django Project</a></h2>
<p>
Posted on Tue 27 September 2016 in <a href="http://www.emadmokhtar.com/category/django.html">Django</a>
• Tagged with
<a href="http://www.emadmokhtar.com/tag/django.html">django</a>, <a href="http://www.emadmokhtar.com/tag/python.html">python</a>, <a href="http://www.emadmokhtar.com/tag/unittest.html">unittest</a>, <a href="http://www.emadmokhtar.com/tag/howto.html">howto</a> • <a href="http://www.emadmokhtar.com/add-isort-and-flake8-test-to-your-django-project.html#disqus_thread">Leave a comment</a>
</p>
</header>
<div>
<p><img alt="Unit Test Works" src="http://www.emadmokhtar.com/images/unit-test-works.jpg"></p>
<p>In this post I'll tell you how to add isort and flake8 tests to your Django project test suite, this is simple script and you can start from this point and customize you own test suite.</p>
<p>As they said Django is a “batteries included” web application framework, and one of the batteries is Testing framework, <a href="https://docs.djangoproject.com/en/dev/topics/testing/">testing in Django</a> is easy and you can start writing tests even if you didn't do it before.</p>
<p>If you ever work with Django, you will write tests for your project, to test your views, models, forms, etc.. but it's better if you can add <a href="https://github.com/timothycrosley/isort">isort</a> and <a href="http://flake8.pycqa.org/en/latest/">flake8</a> tests to maintain the quality of your Python code.</p>
<h1>Installation</h1>
<p>We need some packages first so we can run the tests</p>
<div class="highlight"><pre><span></span>pip install flake8 isort flake8-isort
</pre></div>
<p><strong>Note:</strong></p>
<p>It's better to create and use sperate virtualenv</p>
<h1>Configurations</h1>
<p>flake8-isort is using <code>.isort.cfg</code> file to run the isort test against it, so let's add our configuration file.</p>
<p><strong>.isort.cfg file</strong></p>
<div class="highlight"><pre><span></span><span class="k">[*.py]</span>
<span class="na">max_line_length</span> <span class="o">=</span> <span class="s">120</span>
<span class="na">indent_style</span> <span class="o">=</span> <span class="s">space</span>
<span class="na">indent_size</span> <span class="o">=</span> <span class="s">4</span>
<span class="na">known_first_party</span> <span class="o">=</span> <span class="s">isort</span>
<span class="na">ignore_frosted_errors</span> <span class="o">=</span> <span class="s">E103</span>
<span class="na">skip</span> <span class="o">=</span> <span class="s">runtests.py,build,.tox</span>
<span class="na">balanced_wrapping</span> <span class="o">=</span> <span class="s">true</span>
<span class="na">not_skip</span> <span class="o">=</span> <span class="s">__init__.py</span>
</pre></div>
<h1>Test Python Script</h1>
<p>Now it's time to write the Python script to run Django, isort, & flake8 tests.</p>
<p><strong>runtests …</strong></p>
<a class="btn" href="http://www.emadmokhtar.com/add-isort-and-flake8-test-to-your-django-project.html#add-isort-and-flake8-test-to-your-django-project">Continue reading</a>
</div>
<hr />
</article>
<article>
<header>
<h2><a href="http://www.emadmokhtar.com/how-to-run-celery-as-daemon.html#how-to-run-celery-as-daemon">How to run Celery as daemon?</a></h2>
<p>
Posted on Tue 20 September 2016 in <a href="http://www.emadmokhtar.com/category/django.html">Django</a>
• Tagged with
<a href="http://www.emadmokhtar.com/tag/django.html">django</a>, <a href="http://www.emadmokhtar.com/tag/python.html">python</a>, <a href="http://www.emadmokhtar.com/tag/celery.html">celery</a> • <a href="http://www.emadmokhtar.com/how-to-run-celery-as-daemon.html#disqus_thread">Leave a comment</a>
</p>
</header>
<div>
<p><img alt="celery smoothy" src="http://www.emadmokhtar.com/images/celerysmoothie.jpg"></p>
<h1>Install upstart script</h1>
<h2>Permissions</h2>
<p>We need to make the user which will be used to run celery an owner of <code>log</code> and <code>run</code> directories.</p>
<div class="highlight"><pre><span></span>sudo chown -R root:root /var/log/celery/
sudo chown -R root:root /var/run/celery/
</pre></div>
<h2>Celery upstart</h2>
<p>1- Download <code>celeryd</code> file from <a href="http://github.com/celery/celery/tree/3.1/extra/generic-init.d/">Celery official github repository</a>.</p>
<p>2- Copy <code>celeryd</code> to <code>/etc/init.d/celeryd</code></p>
<div class="highlight"><pre><span></span>sudo cp celeryd /etc/init.d/
</pre></div>
<p>3- Make it executable</p>
<div class="highlight"><pre><span></span>sudo chmod +x celeryd
</pre></div>
<p>4- Make it run on startup</p>
<div class="highlight"><pre><span></span>sudo update-rc.d celeryd defaults
sudo update-rc.d celeryd <span class="nb">enable</span>
</pre></div>
<p>5- make it owned by root</p>
<div class="highlight"><pre><span></span>sudo chown root:root celeryd
</pre></div>
<p>6- Done, now you can start/stop/restart celeryd as service</p>
<div class="highlight"><pre><span></span>sudo service celeryd start
sudo service celeryd stop
sudo service celeryd restart
</pre></div>
<h2>Celerybeat upstart</h2>
<p>1- Download <code>celerybeat</code> file from <a href="http://github.com/celery/celery/tree/3.1/extra/generic-init.d/">Celery official github repository</a>.</p>
<p>2- Copy <code>celerybeat</code> to <code>/etc/init.d/celerybeat</code></p>
<div class="highlight"><pre><span></span>sudo cp celerybeat /etc/init.d/
</pre></div>
<p>3- Make it executable <code>sudo chmod +x celerybeat</code></p>
<p>4- Make it run on startup</p>
<div class="highlight"><pre><span></span>sudo update-rc.d celerybeat defaults
sudo update-rc.d celerybeat <span class="nb">enable</span>
</pre></div>
<p>5- make it owned by root</p>
<div class="highlight"><pre><span></span>sudo chown root:root celerybeat
</pre></div>
<p>6- Done, now you can start/stop/restart celerd as service</p>
<div class="highlight"><pre><span></span>sudo service celerybeat start
sudo service …</pre></div>
<a class="btn" href="http://www.emadmokhtar.com/how-to-run-celery-as-daemon.html#how-to-run-celery-as-daemon">Continue reading</a>
</div>
<hr />
</article>
<article>
<header>
<h2><a href="http://www.emadmokhtar.com/djangocon-europe-2016-me-and-django-sprints.html#djangocon-europe-2016-me-and-django-sprints">DjangoCon Europe 2016, me, and Django Sprints</a></h2>
<p>
Posted on Wed 07 September 2016 in <a href="http://www.emadmokhtar.com/category/community.html">Community</a>
• Tagged with
<a href="http://www.emadmokhtar.com/tag/community.html">community</a>, <a href="http://www.emadmokhtar.com/tag/django.html">Django</a>, <a href="http://www.emadmokhtar.com/tag/djangocon.html">DjangoCon</a> • <a href="http://www.emadmokhtar.com/djangocon-europe-2016-me-and-django-sprints.html#disqus_thread">Leave a comment</a>
</p>
</header>
<div>
<p><img alt="djangocon logo" src="http://www.emadmokhtar.com/images/yay.jpg"></p>
<p><img alt="djangocon name tag" src="http://www.emadmokhtar.com/images/Name-tag.jpg"></p>
<p>Late in 2014 I decided to shift my development stack from Microsoft .NET Framework to <a href="http://www.emadmokhtar.com/my-first-django-app.html">Django/Python stack</a>. It's been almost 2 years now and I'm really enjoying and learning many things. I'm so happy that I've done this leap.
In 2016 I had the change to attend DjangoCon Europe 2016 at Budapest, Hungry. I enjoyed it to the maximum, it's my first time to meet the community, and it's first time attending one of Django community events.</p>
<h1>Django Community</h1>
<p>When I started to learn Django, I found everyone is recommending Django documentation itself as start, from my past experience in .NET framework that its documentation is not enough to get your head around the framework, you need at least to read one book or watch one video course, but after reading Django official documentation, I was shocked that it's enough as start, it's enough for your daily tasks, it's enough to dive in Django framework, or fixing issues. The quality of <a href="https://docs.djangoproject.com/en/dev/">Django official documentation</a> is amazing.</p>
<p>When I went to DjangoCon Europe 2016 I saw people reflecting the philosophy of Django framework, the community is so welcoming as Django documentation, I had the chance to meet <a href="https://github.com/freakboy3742">Russell Keith-Magee</a> and …</p>
<a class="btn" href="http://www.emadmokhtar.com/djangocon-europe-2016-me-and-django-sprints.html#djangocon-europe-2016-me-and-django-sprints">Continue reading</a>
</div>
<hr />
</article>
<article>
<header>
<h2><a href="http://www.emadmokhtar.com/packt-publishing-ebooks-and-videos-50-discount-offer.html#packt-publishing-ebooks-and-videos-50-discount-offer">PACKT publishing ebooks and videos 50% discount offer</a></h2>
<p>
Posted on Wed 17 February 2016 in <a href="http://www.emadmokhtar.com/category/python.html">Python</a>
• Tagged with
<a href="http://www.emadmokhtar.com/tag/django.html">django</a>, <a href="http://www.emadmokhtar.com/tag/python.html">python</a>, <a href="http://www.emadmokhtar.com/tag/ebooks.html">ebooks</a> • <a href="http://www.emadmokhtar.com/packt-publishing-ebooks-and-videos-50-discount-offer.html#disqus_thread">Leave a comment</a>
</p>
</header>
<div>
<p>Generously PACKT publishing is offering 50% discount on Python and Django ebook and videos. PACKT has many Python ebooks and videos from novice to advanced level, it one of the most publishing company that releases books and videos for Python and Django, If you tried to Google a book for Python or Django, you differently will find one of their books in the search results.</p>
<h2>Interesting ebooks and videos for Python:</h2>
<p><a href="https://www.packtpub.com/big-data-and-business-intelligence/python-machine-learning"><img alt="Python Machine Learning" src="https://www.packtpub.com/sites/default/files/5130OS_Python%20Machine%20Learning_.jpg"></a></p>
<p><a href="https://www.packtpub.com/big-data-and-business-intelligence/mastering-python-video"><img alt="Mastering Python" src="https://www.packtpub.com/sites/default/files/bookretailers/9781783988969.jpg"></a></p>
<p><a href="https://www.packtpub.com/big-data-and-business-intelligence/python-data-analysis"><img alt="Python DAta Analysis" src="https://www.packtpub.com/sites/default/files/3358OS_cov.jpg"></a></p>
<p><a href="https://www.packtpub.com/application-development/geospatial-development-example-python"><img alt="Geospatial Development by Example Python" src="https://www.packtpub.com/sites/default/files/2355OS_4558_Geospatial%20Development%20by%20Example%20with%20Python.jpg"></a></p>
<h2>Interesting ebooks and videos for Django:</h2>
<p><a href="https://www.packtpub.com/web-development/web-development-django-cookbook-second-edition"><img alt="Web Development Django Cookbook" src="https://www.packtpub.com/sites/default/files/6775O9S_Web%20Development%20with%20Django%20Cookbook-%20Second%20Edition.jpg"></a></p>
<p><a href="https://www.packtpub.com/web-development/django-example"><img alt="Django By Example" src="https://www.packtpub.com/sites/default/files/B03922_Django%20By%20Example_.jpg"></a></p>
<p><a href="https://www.packtpub.com/web-development/mastering-django-web-development-video"><img alt="Master Django Web Developement" src="https://www.packtpub.com/sites/default/files/bookretailers/9781783989805_new.jpg"></a></p>
<h2>Coupons</h2>
<p>Please take the chance and buy your favorite Python or Django ebooks or videos form PACKT publishing. This offer is valid till <strong>28th of March 2016</strong> so please hurry up</p>
<ul>
<li>For <a href="https://www.packtpub.com/tech/python#/?utm_source=RP-Emadmokhtar&utm_medium=referral&utm_campaign=OMEPython">Python</a> books and videos use <strong>PYTHON50</strong> code.</li>
<li>For <a href="https://www.packtpub.com/tech/django#/?utm_source=RP-Emadmokhtar&utm_medium=referral&utm_campaign=OMEDjango">Django</a> books and videos use <strong>DJANGO50</strong> code.</li>
</ul>
<a class="btn" href="http://www.emadmokhtar.com/packt-publishing-ebooks-and-videos-50-discount-offer.html#packt-publishing-ebooks-and-videos-50-discount-offer">Continue reading</a>
</div>
<hr />
</article>
<article>
<header>
<h2><a href="http://www.emadmokhtar.com/send-emails-asynchronously-from-django.html#send-emails-asynchronously-from-django">Send Emails Asynchronously from Django</a></h2>
<p>
Posted on Sun 24 January 2016 in <a href="http://www.emadmokhtar.com/category/django.html">Django</a>
• Tagged with
<a href="http://www.emadmokhtar.com/tag/django.html">django</a>, <a href="http://www.emadmokhtar.com/tag/python.html">python</a>, <a href="http://www.emadmokhtar.com/tag/celery.html">celery</a>, <a href="http://www.emadmokhtar.com/tag/emails.html">emails</a> • <a href="http://www.emadmokhtar.com/send-emails-asynchronously-from-django.html#disqus_thread">Leave a comment</a>
</p>
</header>
<div>
<p>In this article you will learn:</p>
<ol>
<li>How to send emails from <a href="https://www.djangoproject.com">Django</a>.</li>
<li>How to use <a href="http://www.celeryproject.org/">Celery</a> and <a href="https://github.com/pmclanahan/django-celery-email">Django-Celery-Email</a> to send email asynchronously.</li>
</ol>
<p>Last week I had the chance to get my hand dirty with Celery, I used it to send emails from Django project asynchronously using Django app call djnago-celery-email. What am I mean by sending emails asynchronously? I mean that user doesn’t wait for SMTP/mail server to send email message and give feedback to the web server, instead Django will call the send email procedure, pass it to Celery to do it away from Django application, so that user won’t wait, for example you want to send email to customer once he save customer information, you don’t want to keep user wait for application to save the customer data and send email, by sending email asynchronously user will only wait for saving confirmation and sending email celery will take care of it in the background.</p>
<p><img alt="Alt Text" src="http://www.emadmokhtar.com/images/1442310863_full.png"></p>
<p>Now let’s see how we can do that.</p>
<h2>Step 1: Install and Setup Celery</h2>
<ul>
<li>In terminal, active your <a href="http://www.emadmokhtar.com/2015/03/virtual-environment/">virtualenv</a> and type <code>$ pip install django-celery</code></li>
<li>Now celery and its Django app djcelery are installed into your virtualenv.</li>
<li>Next step is …</li></ul>
<a class="btn" href="http://www.emadmokhtar.com/send-emails-asynchronously-from-django.html#send-emails-asynchronously-from-django">Continue reading</a>
</div>
<hr />
</article>
<article>
<header>
<h2><a href="http://www.emadmokhtar.com/my-experience-with-fitbit-customer-service.html#my-experience-with-fitbit-customer-service">My Experience with Fitbit Customer Service</a></h2>
<p>
Posted on Wed 06 January 2016 in <a href="http://www.emadmokhtar.com/category/review.html">Review</a>
• Tagged with
<a href="http://www.emadmokhtar.com/tag/review.html">review</a> • <a href="http://www.emadmokhtar.com/my-experience-with-fitbit-customer-service.html#disqus_thread">Leave a comment</a>
</p>
</header>
<div>
<p><img alt="fitbit-logo" src="http://www.emadmokhtar.com/images/fitbit-logo.png"></p>
<h2>The start</h2>
<p>I received Fitbit Flex as my birthday gift from my wife and I joined Fitbit community since 2013, I love the device and I love the sleep tracking feature, and with this feature now I can know why I'm feeling sleepy by data. </p>
<h2>First Issue</h2>
<p>Less than one year of using my Fitbit Flex, it started to not charging, and vibrating for alarms and feedback, so I created a support issue on Fibit support portal, and the quick answer was, Oh we are sorry please give us an address so we can send you another one. I got shocked, this reminded me of Amazon Customer Service quality. <img alt="fitbit support 01" src="http://www.emadmokhtar.com/images/Screenshot-2016-01-05-14.15.50.png"></p>
<h2>Second Issue</h2>
<p>After receiving the second Fitbit Flex, I used it for while and the wristband got damaged, I created a support issue again, they request a confirmation that my band is damaged, I replied with images, and boom the same response "Oh we are sorry please give us an address so we can send you another one". <img alt="Fitbit Support 02" src="http://www.emadmokhtar.com/images/Screenshot-2016-01-05-14.22.55.png"></p>
<h2>Third Issue</h2>
<p>My replacement Fitbit Flex got damaged also and again I created support issue, and this time they were more awesome than before, they sent me a replacement though my warranty is …</p>
<a class="btn" href="http://www.emadmokhtar.com/my-experience-with-fitbit-customer-service.html#my-experience-with-fitbit-customer-service">Continue reading</a>
</div>
<hr />
</article>
<article>
<header>
<h2><a href="http://www.emadmokhtar.com/dotpen-review.html#dotpen-review">DotPen review</a></h2>
<p>
Posted on Mon 28 December 2015 in <a href="http://www.emadmokhtar.com/category/review.html">Review</a>
• Tagged with
<a href="http://www.emadmokhtar.com/tag/review.html">review</a> • <a href="http://www.emadmokhtar.com/dotpen-review.html#disqus_thread">Leave a comment</a>
</p>
</header>
<div>
<p>I bought an iPad Mini 2 to write paper-less/eletronic notes instead of having notebook and a pen always inside my pockets, I <a href="/2015/12/paperless-notes/">blogged about it before</a>, but I upgraded my stylus from <a href="http://www.moshi.com/peripheral-stylus-pen-stanza-duo">Moshi Stanza Duo</a> to <a href="http://dot-tec.com/">DotPen</a>, and I want to share my experince with you. </p>
<h1>My Experience</h1>
<blockquote>
<h2>TL;DR</h2>
<p>If you want a stylus that is perfect for hand writing, buy <a href="http://amzn.to/1OmUCfX">DotPen</a>. </p>
</blockquote>
<p><img alt="dotpen" src="http://dot-tec.com/wp-content/uploads/2014/09/dot-pen-blown.png"> I'm using DotPen now for two month, and I'm so happy about it, it feel like writing on paper but instead I'm writing on my iPad mini 2, and best part that it can support any note taking app, I'm using it with GoodNotes and Penultimate and it's perfectly working with them. Here is comparison between my handwriting on paper and on iPad using dotPen. <img alt="paper-less Note" src="/wp-content/uploads/IMG_4280.jpg"></p>
<h2>Some Features</h2>
<ul>
<li>It's not bluetooth stylus which can sync with apps to enable plam rejection feature, so that why I recommned using it with Goodnotes becasue of the writing panel. </li>
<li>It has On/Off button which I found it's taking it really off, my iPad mini 2 can't recognize its tip if it's off.</li>
<li>It take AAA battery which can run it for 2 weeks at least, you won't change the …</li></ul>
<a class="btn" href="http://www.emadmokhtar.com/dotpen-review.html#dotpen-review">Continue reading</a>
</div>
</article>
<div class="pagination">
<a class="btn" href="http://www.emadmokhtar.com/index3.html">
<i class="fa fa-angle-left"></i> Older Posts
</a>
<a class="btn float-right" href="http://www.emadmokhtar.com/index.html">
Newer Posts <i class="fa fa-angle-right"></i>
</a>
</div>
<footer>
<p>© Emad Mokhtar </p>
<p>Built using <a href="http://getpelican.com" target="_blank">Pelican</a> - <a href="https://github.com/alexandrevicenzi/flex" target="_blank">Flex</a> theme by <a href="http://alexandrevicenzi.com" target="_blank">Alexandre Vicenzi</a></p> </footer>
</main>
<!-- Google Analytics -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-11401860-2', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Blog",
"name": " Emad Mokhtar's Framework ",
"url" : "http://www.emadmokhtar.com",
"image": "http://www.emadmokhtar.com/images/profile.jpg",
"description": "My thoughts and experince on software development and life."
}
</script><script type="text/javascript">
var disqus_shortname = 'emadmokhtarsframework';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
</body>
</html>