django-pingback
diff README.md @ 32:6ca8eadcd22d
fix relative urls and some additional logging
| author | Alexander Artemenko <svetlyak.40wt@gmail.com> |
|---|---|
| date | Sun Dec 14 18:10:11 2008 +0200 |
| parents | f3bc8c661309 |
| children | f06451c79457 |
line diff
1.1 --- a/README.md Tue Nov 25 05:20:24 2008 +0300 1.2 +++ b/README.md Sun Dec 14 18:10:11 2008 +0200 1.3 @@ -3,26 +3,24 @@ 1.4 1.5 This two applications provide 3 connected services: 1.6 pingback server, pingback client and directory ping client. 1.7 -It depends on the [django-xmlrpc][]. 1.8 + 1.9 +Depends on the [django-xmlrpc][]. 1.10 1.11 Configuration 1.12 ------------- 1.13 1.14 -First, install the [django-xmlrpc][] app. You download it 1.15 -from [my bzr repository][django-xmlrpc] (it based on the 1.16 -https://launchpad.net/django-xmlrpc with minor changes 1.17 -for setuptools packaging), or just use setuptools: 1.18 +First, install the [django-xmlrpc][] application. You can download it either 1.19 +from [repo][django-xmlrpc] or just use setuptools: 1.20 1.21 easy_install -f http://pypi.aartemenko.com django-xmlrpc 1.22 1.23 Next, download and install `django-pingback`: 1.24 1.25 -* download sources from [my branch at github][github-pingback] 1.26 - (this version is based on [Alexander Solovyov's][piranha-version] code). 1.27 -* or use `easy_install -f http://pypi.aartemenko.com django-pingback` 1.28 -* add `pingback` to your `INSTALLED_APPS` 1.29 -* run `./manage.py syncdb` 1.30 -* setup client and server callbacks. 1.31 + * download sources from main [repository][django-pingback] 1.32 + * or use `easy_install django-pingback` 1.33 + * add `pingback` to your `INSTALLED_APPS` 1.34 + * run `./manage.py syncdb` 1.35 + * setup client and server callbacks. 1.36 1.37 1.38 Connecting server 1.39 @@ -38,20 +36,20 @@ 1.40 It is a handler for all xmlrpc requests. 1.41 1.42 Usually, blog has a detailed view for each post. Suppose that 1.43 -out view has name `post_detail` and accepts one keyword arguments 1.44 +our view has name `post_detail` and accepts one keyword arguments 1.45 `slug`. 1.46 1.47 Here is simple example, how to make Post objects pingable: 1.48 1.49 from datetime import time, date, datetime 1.50 from time import strptime 1.51 + 1.52 from blog.models import Post 1.53 from pingback import create_ping_func 1.54 from django_xmlrpc import xmlrpcdispatcher 1.55 1.56 - # create simple function which returns 1.57 - # Post object and accepts exactly same 1.58 - # arguments as 'details' view. 1.59 + # create simple function which returns Post object and accepts 1.60 + # exactly same arguments as 'details' view. 1.61 def pingback_blog_handler(slug, **kwargs): 1.62 return Post.objects.get(slug=slug) 1.63 1.64 @@ -104,6 +102,7 @@ 1.65 from django.db.models import signals 1.66 from pingback.client import ping_external_links, ping_directories 1.67 from blog.models import Post 1.68 + 1.69 signals.post_save.connect( 1.70 ping_external_links(content_attr = 'html', 1.71 url_attr = 'get_absolute_url'), 1.72 @@ -114,18 +113,18 @@ 1.73 url_attr = 'get_absolute_url'), 1.74 sender = Post, weak = False) 1.75 1.76 -Please, note, that in the content_attr you must give either attr's or 1.77 -method's name, which returns HTML content of the object. 1.78 +Please note, that in the `content_attr` you must give either attribute or method 1.79 +name, which returns HTML content of the object. 1.80 1.81 -If you don't have such attr or method, for example if you apply 1.82 -markdown filter in the template, then `content_func` attr can be used 1.83 -instead of the `content_attr`. 1.84 +If you don't have such attribute or method, for example if you apply markdown 1.85 +filter in the template, then `content_func` argument can be used instead of the 1.86 +`content_attr`. 1.87 1.88 -`content_func` also must return HTML, but it accepts an instance as it's 1.89 -single argument. 1.90 +`content_func` must return HTML, and must accepts an instance as a single 1.91 +argument. 1.92 1.93 -Pay attention to the `weak = False` attribute. If you forget about it, 1.94 -django's event dispatcher remove you signal handler. 1.95 +Pay attention to the `weak = False` argument. If case of omitting django's event 1.96 +dispatcher will remove your signal. 1.97 1.98 Template tags 1.99 ------------- 1.100 @@ -148,9 +147,8 @@ 1.101 {% endfor %} 1.102 {% endif %} 1.103 1.104 -Also, for can use `{% get_pingback_count for object as cnt %}`, to save 1.105 +Also you can use `{% get_pingback_count for object as cnt %}`, to save 1.106 pingbacks' count in the context variable. 1.107 1.108 [django-xmlrpc]: https://code.launchpad.net/~aartemenko/django-xmlrpc/svetlyak40wt 1.109 -[github-pingback]: http://github.com/svetlyak40wt/django-pingback/tree/svetlyak40wt 1.110 -[piranha-version]: http://hg.piranha.org.ua/django-pingback/ 1.111 +[django-pingback]: http://hg.piranha.org.ua/django-pingback/
