Diamanda 2008-TEST-1.1 released
I've released a new version of Diamanda Application Set - 2008-TEST-1.1. It's a small update against 1.0 stable release. Most changes affected layout (new look, fixes in templates, CSS and JS files), but also more generic use of forum topics as comments systems. Also password change has been fixed to work with Django 1.0.*.
ContentBBcode examples
Some examples and info about CBC
Extra PyQt4 extra widgets
I've started a new project: pyqt4-extrawidgets, that gathers my PyQt4 bindings for Qt4 widgets. Currently there is only QTermWidget, but soon there will be more.
Making PyQt4 widgets with SIP
Tutorial on making PyQt4 widgets from Qt4 widgets using SIP.
Nginx and Cherokee wars
Admin asked me what's the best way to host a Django app. The answer is Nginx or Cherokee (if he likes something "new"). I've been playing with Cherokee a long time ago, before Cherokee Admin and other goodies. To refresh info about Django on Cherokee I've installed ver 0.9.4 and configured it to host a Django project (local copy of this site) with SCGI. I've compared this configuration with Nginx 0.6.32 running the same application with FastCGI.
Test was simple - hit the main page few times:Total: connections 5 requests 500 replies 500 test-duration 46.861 s CPU time [s]: user 2.51 system 17.27 (user 5.3% system 36.9% total 42.2%)Nginx:
Total: connections 5 requests 500 replies 500 test-duration 48.677 s CPU time [s]: user 2.53 system 16.15 (user 5.2% system 33.2% total 38.4%)
Results are nearly equal. For now I would choose Nginx, as it can be easily configured. With cherokee-admin I had some issues with saving config for round-robin balancer - so I'm waiting for the incoming next stable Cherokee release (with new features). Some more serious tests to come :)
Fun with Google App Engine
I've made a small GAE application called PythonMore, which is currently a set of Google Custom Search Engines flavored for Python searches, and also for Django, Pylons, GAE and PyQt. I'm planning to add Google Code Search with GData.
Diamanda 2008 Stable 1.0
Diamanda 2008 Stable release is here and requires Django 1.0.
Visit documentation section for more info about Diamanda.Password reset in Django 1.0
Resetting password changed in 1.0, and the documentation for this is missing. The basic way of using new views is to add this set to urlconf:
import django.contrib.auth.views
....
(r'^password_reset/$', 'django.contrib.auth.views.password_reset'),
(r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done'),
(r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm'),
(r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete'),
(r'^password_reset/$', 'django.contrib.auth.views.password_reset', {'template_name':'userpanel/password_reset_form.html', 'email_template_name':'userpanel/password_reset_email.html'}),
(r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done', {'template_name':'userpanel/password_reset_done.html'}),
(r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm', {'template_name':'userpanel/password_reset_confirm.html'}),
(r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete', {'template_name':'userpanel/password_reset_complete.html'}),
- password_reset - URL for password_reset_done view
- password_reset_confirm - URL for password_reset_complete view
- password_reset_email.html - You have add in some way URL to password_reset_confirm in URL tag:
{% url django.contrib.auth.views.password_reset_confirm uidb36=uid, token=token %}
def password_reset(request):
"""
django.contrib.auth.views.password_reset view (forgotten password)
"""
if not request.user.is_authenticated():
return django.contrib.auth.views.password_reset(request,
template_name='userpanel/password_reset_form.html',
email_template_name= 'userpanel/password_reset_email.html',
post_reset_redirect='/user/password_reset/done/')
else:
return HttpResponseRedirect("/user/")
Power in Google CSE - how to make Google Python search engine :)
Google has a public service called Custom Search Engine - CSE. It's not very popular - if you want google powered search for your site you use Google Ajax search or other services. Google CSE is much more complex, and it's hart to see the "cool part" until you get the dreamed result.
Google CSE allows you to tune the Google search results against some keywords, sites etc. If you want a search engine for Python frameworks then Rainhard Django or construction pylons aren't the things you look for...
Diamanda 2008 Test 4 for Django 1.0
Last test release of Diamanda 2008 is here. Test 4 requires and is compatible with Django 1.0. Compared to Test 3 contains few minor fixes plus compatibility fixes (newforms-admin, newforms as forms etc.). Upgrade from pre-NFA to 1.0 took about 30 minutes :)