Answer the question
In order to leave comments, you need to log in
MetaWeblog API + Django?
At one time I had my own blog on WordPress, and used Windows Live Writer to post news. And I liked it so much that when I wrote down a self-written blog while studying Django, I wanted to add support for posting to it through Windows Live Writer (it solves the problem of convenient text formatting, it’s not convenient to do this in the Django admin panel, and it’s generally nice). It was useful to look for information on how to do this, I found out what is most convenient through the MetaWeblog API. Alas, there is really no Russian documentation (and everything is tight with English) - all I found was a couple of posts about organizing support for PHP and .NET, there is no knowledge of what is what. In addition, all this is complicated by the fact that I was practically not familiar with xmlrpc before.
Well, with grief on the floor, I found the xmlrpc server library for Django (django_xmlrpc), opened the MetaWeblog API specification, and started trying to organize at least something. And so this is what I have so far:
@xmlrpc_func(returns='string', args=['string', 'string', 'string',])<br>
def getUsersBlogs(appKey, username, password):<br>
user = mw_authenticate(username, password)<br>
return {'isAdmin': user.is_superuser,<br>
'url': 'http://127.0.0.1:8000/',<br>
'blogid': '1',<br>
'blogName': 'MyWebBlog'}<br><br>
@xmlrpc_func(returns='string', args=['string', 'string', 'string'])<br>
def get_user_info(apikey, username, password):<br>
user= mw_authenticate(username, password)<br>
return {'userid': user.pk,<br>
'email': user.email,<br>
'nickname': user.username,<br>
'lastname': user.last_name,<br>
'firstname': user.first_name,<br>
'url': 'http://127.0.0.1:8000/'}<br>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question