| Django http://www.rkblog.rk.edu.pl/ Site/Blog about Django, Python and some Linux and PHP stuff. pl | Django http://www.rkblog.rk.edu.pl/site_media/layout/tux.png http://www.rkblog.rk.edu.pl/ 132 124 http://www.rkblog.rk.edu.pl/w/p/code-snapshot-ice-isle-django-web-crpg-game/ http://www.rkblog.rk.edu.pl/w/p/code-snapshot-ice-isle-django-web-crpg-game/ <![CDATA[Code snapshot of Ice Isle - Django web cRPG Game ;)]]> I've decided to release a snapshot of my Django powered web based cRPG game, code name "Ice Isle" ("Wyspa Mrozu"). The package contains fully working Django application (uses also PIL, simplejson, and jQuery library), however the game is far from finished, polished, documented and so on. This release is licensed under Creative Commons license BY NC SA and further releases on more liberal and/or GPL, LGPL license depend on the feedback ;) The snapshot contains Legendora Icons, some graphics from Baldurs Gate and Icewind Dale, and graphics from dreamweavedworlds.com - which have their own licenses (used temporary at this stage of development)

ice1.png
ice2.jpg
ice3.jpg
ice4.jpg

Download Ice Isle ZIP - extract and check the readme]]>
2009-06-25 22:20:55.112945
http://www.rkblog.rk.edu.pl/w/p/cwiczenia-django-soon-hit-book-stores-poland/ http://www.rkblog.rk.edu.pl/w/p/cwiczenia-django-soon-hit-book-stores-poland/ <![CDATA["Ćwiczenia Django" - soon to hit the book stores in Poland]]> Django, Ćwiczenia" is a book written by me for Helion (publisher). Is a small book covering the introduction to Django (sample app that covers in steps most of the framework components) with some extras about GAE and Django + GAE (88 pages).]]> 2009-06-19 23:16:23.834219 http://www.rkblog.rk.edu.pl/w/p/work-django-codder/ http://www.rkblog.rk.edu.pl/w/p/work-django-codder/ <![CDATA[Work for a Django developer?]]> riklaunim@gmail.com.]]> 2009-06-19 23:13:24.705490 http://www.rkblog.rk.edu.pl/w/p/browser-based-rpg-game-django/ http://www.rkblog.rk.edu.pl/w/p/browser-based-rpg-game-django/ <![CDATA[Browser based RPG game in Django]]> autogenerated fights and character statistics/inventory. Tile based maps (like this) are on their way. The code isn't available at the moment but it will be when I'll finish the maps more or less and polish the templates/code (add i18n, and so on). The ease of use of Django models is really useful in this project as it allows to easily implement needed flexibility (item model has a relation to effect model which describes every effect the item has like damage or armor class bonus. When a character equips such item all effects are assigned to the character and denormalised to get character final stats). Premade maps (few tiles) can be described with JSONs objects in the Admin Panel - zones of movement (x,y boxes), spawn points, actions points (and what's the action etc) and so on :) It won't super long and complex code, but it will make a good based for RPG browser games ;)]]> 2009-05-12 09:48:16.187520 http://www.rkblog.rk.edu.pl/w/p/diamanda-bugfix-release/ http://www.rkblog.rk.edu.pl/w/p/diamanda-bugfix-release/ <![CDATA[Diamanda bugfix release]]> code.google.com with latest code from SVN, which contains few minor fixes to the Feedupdate, Pages and forum (Myghtyboard) apps. ]]> 2009-04-05 20:05:07.314823 http://www.rkblog.rk.edu.pl/w/p/nginx-and-cherokee-wars/ http://www.rkblog.rk.edu.pl/w/p/nginx-and-cherokee-wars/ <![CDATA[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:
httperf --client=0/1 --server=localhost --port=80 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=5 --num-calls=100
Cherokee:
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 :)

]]>
2008-10-28 10:24:52.398772
http://www.rkblog.rk.edu.pl/w/p/fun-google-app-engine/ http://www.rkblog.rk.edu.pl/w/p/fun-google-app-engine/ <![CDATA[Fun with Google App Engine]]> 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.]]> 2008-10-05 12:14:57.407230 http://www.rkblog.rk.edu.pl/w/p/diamanda-2008-stable-10/ http://www.rkblog.rk.edu.pl/w/p/diamanda-2008-stable-10/ <![CDATA[Diamanda 2008 Stable 1.0]]>
  • ZIP package
  • Tar.bz2 package
  • Visit documentation section for more info about Diamanda.]]>
    2008-09-29 16:30:28.402335
    http://www.rkblog.rk.edu.pl/w/p/password-reset-django-10/ http://www.rkblog.rk.edu.pl/w/p/password-reset-django-10/ <![CDATA[Password reset in Django 1.0]]>
    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'),
    
    Default templates are in django/contrib/admin/templates/registration and can be used out of the box, but they have Admin Panel like look. You can set paths to your custom templates (copy & edit the original ones):
    (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'}),
    
    If you want to use those views wrapped in your own views, then you will get few NoReverseMatch: Reverse for 'yourapp.django.contrib.auth.views.password_reset_confirm' with arguments '()' and keyword arguments... exceptions. You have to pass to the views also a post_reset_redirect argument with URLs to other password reset views:
    • 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 %}
      
    Example:
    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/")
    
    For the links in the email domain name from Sites app is used. If you change the domain in Admin Panel/Sites, then you will have to restart the server to see the changes in emails.]]>
    2008-09-26 10:38:43.279960
    http://www.rkblog.rk.edu.pl/w/p/power-google-cse-how-make-google-python-search-engine/ http://www.rkblog.rk.edu.pl/w/p/power-google-cse-how-make-google-python-search-engine/ <![CDATA[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...

    ]]>
    2008-09-21 16:43:30.767789