Views
Ploneにまとめてユーザ登録
こんな Python スクリプトがつかえるかもしれない。# -*- coding: cp932 -*- # import time from urllib import urlopen, urlencode registerurl = 'http://host.example.net/join_form' now = time.strftime('%Y/%m/%d %H:%M:%S GMT+9', time.localtime()) submits = {'last_visit:date': now, 'prev_visit:date': now, 'fullname': '日暮かごめ', 'username': 'kagome', 'email': '[email protected]', 'password': 'inuyasha', 'confirm': 'inuyasha', 'submit': 'register', 'form.submitted': '1', } datafile = 'register.txt' for d in file(datafile): username, fullname, email, password = d.strip().split(':') fullname = unicode(fullname, 'cp932').encode('utf-8') submits['username'] = username submits['fullname'] = fullname submits['email'] = email submits['password'] = password submits['confirm'] = password data = urlencode(submits) f = urlopen(registerurl, data) f.close() time.sleep(5)time.sleep() は、サーバの負荷を考えて入れてるが、そんなには必要ないかもしれない。
ユーザデータファイルはこんな形で入れておく。
kagome:日暮かごめ:[email protected]:inuyasha akane:天道あかね:[email protected]:ranma1/2