Exception Type: ImportError at /
Exception Value: No module named conf.settings
を投げたら
cp -r .../source/schedule/conf .../site-packages/django_schedule-0.5b-py2.6.egg/schedule/
ここ
2010年8月29日日曜日
Django-cmsでapphookpageをスクリプトで挿入
するには
site = Site.objects.get_current()
#cms_page
pageTop = Page(site=Site.objects.get_current(), navigation_extenders='',
template='body1Column.html', published=True,
publisher_state=1, publisher_is_draft=True,
login_required=True, limit_visibility_in_menu=1)
pageTop.save()
#cms_title ja
title_ja = Title(page=pageTop, language=settings.LANGUAGES[0][0],
slug='alumni', title='同窓会', application_urls='AccountsApphook')
title_ja.save()
#cms_title en
title_en = Title(page=pageTop, language=settings.LANGUAGES[1][0],
slug='alumni-en', title='Alumni', application_urls='AccountsApphook')
title_en.save()
Django-cmsで子pageをスクリプトで挿入
するには
site = Site.objects.get_current()
#cms_page
pageTop = Page(site=Site.objects.get_current(), navigation_extenders='',
template='body1Column.html', published=True,
publisher_state=1, publisher_is_draft=True)
pageTop.save()
#cms_title ja
title_ja = Title(page=pageTop, language=settings.LANGUAGES[0][0],
slug='news-top-page', title='ニューストップページ')
title_ja.save()
#cms_title en
title_en = Title(page=pageTop, language=settings.LANGUAGES[1][0],
slug='news-top-page-en', title='News Top Page')
title_en.save()
#0
page = Page(parent=pageTop, site=Site.objects.get_current(), navigation_extenders='',
template='body1Column.html', published=True,
publisher_state=1, publisher_is_draft=True)
page.save()
#cms_title ja
title_ja = Title(page=page, language=settings.LANGUAGES[0][0],
slug='news-top-page0', title='ニュースページ0')
title_ja.save()
#cms_title en
title_en = Title(page=page, language=settings.LANGUAGES[1][0],
slug='news-top-page0-en', title='News Page0')
title_en.save()
#1
page = Page(parent=pageTop, site=Site.objects.get_current(), navigation_extenders='',
template='body1Column.html', published=True,
publisher_state=1, publisher_is_draft=True)
page.save()
#cms_title ja
title_ja = Title(page=page, language=settings.LANGUAGES[0][0],
slug='news-top-page1', title='ニュースページ1')
title_ja.save()
#cms_title en
title_en = Title(page=page, language=settings.LANGUAGES[1][0],
slug='news-top-page1-en', title='News Page1')
title_en.save()
#2
page = Page(parent=pageTop, site=Site.objects.get_current(), navigation_extenders='',
template='body1Column.html', published=True,
publisher_state=1, publisher_is_draft=True)
page.save()
#cms_title ja
title_ja = Title(page=page, language=settings.LANGUAGES[0][0],
slug='news-top-page2', title='ニュースページ2')
title_ja.save()
#cms_title en
title_en = Title(page=page, language=settings.LANGUAGES[1][0],
slug='news-top-page2-en', title='News Page2')
title_en.save()
#3
page = Page(parent=pageTop, site=Site.objects.get_current(), navigation_extenders='',
template='body1Column.html', published=True,
publisher_state=1, publisher_is_draft=True)
page.save()
#cms_title ja
title_ja = Title(page=page, language=settings.LANGUAGES[0][0],
slug='news-top-page3', title='ニュースページ3')
title_ja.save()
#cms_title en
title_en = Title(page=page, language=settings.LANGUAGES[1][0],
slug='news-top-page3-en', title='News Page3')
title_en.save()
Django-cmsでpageをスクリプトで挿入
するには
site = Site.objects.get_current()追記:django-cms 2.2ではここを見よ
#cms_page
page = Page(site=Site.objects.get_current(), navigation_extenders='',
template='body1Column.html', published=True,
publisher_state=1, publisher_is_draft=True)
page.save()
#cms_title ja
title_ja = Title(page=page, language=settings.LANGUAGES[0][0],
slug='top-page', title='トップページ')
title_ja.save()
#cms_title en
title_en = Title(page=page, language=settings.LANGUAGES[1][0],
slug='top-page-en', title='Top Page')
title_en.save()
#placeholder
placeholders = {}
for placeholder in page.placeholders.all():
placeholders[placeholder.slot] = placeholder
#plugins
pluginText = Text(plugin_type='TextPlugin', page=page, language=settings.LANGUAGES[0][0],
position=0, body='
トップページ
', placeholder=placeholders['body'],
publisher_state=1, publisher_is_draft=True)
pluginText.insert_at(None, commit=True)
pluginText = Text(plugin_type='TextPlugin', page=page, language=settings.LANGUAGES[1][0],
position=0, body='
Top Page
', placeholder=placeholders['body'],
publisher_state=1, publisher_is_draft=True)
pluginText.insert_at(None, commit=True)
2010年8月27日金曜日
Django-cmsでdbの内容をすべて破棄
Django-cmsでdbの内容をすべて破棄するには
#cms_pageでいける。たぶん…
objects = Page.objects.all()
objects.delete()
#cms_placeholder
objects = Placeholder.objects.all()
objects.delete()
#django_sessions
objects = Session.objects.all()
objects.delete()
#django_admin_log
objects = LogEntry.objects.all()
objects.delete()
2010年8月25日水曜日
placeholderは自動で挿入?
Django-cmsでdefault pageをprogramから挿入するとき、Page, Titleをインスタンス化して保存すればplaceholderは自動でやってくれる?
templateを適切に指定したとき?
templateを適切に指定したとき?
#cms_page ja
p = Page()
p.publisher_is_draft = True
p.publisher_public_id = None
p.publisher_state = 1
p.created_by = 'tosh'
p.changed_by = 'tosh'
p.parent_id = None
p.creation_date = datetime.datetime.now()
p.publication_date = datetime.datetime.now()
p.publication_end_date = None
p.in_navigation = True
p.soft_root = False
p.reverse_id = None
p.navigation_extenders = ''
p.published = True
p.template = 'body1Column.html'
p.site_id = 1
p.moderator_state = 1
p.level = 0
p.lft = 1
p.rght = 2
p.tree_id = 1
p.login_required = False
p.limit_visibility_in_menu = None
p.save()
#cms_title ja
tj = Title()
tj.publisher_is_draft = True
tj.publisher_public_id = None
tj.publisher_state = 1
tj.language = 'ja'
tj.title = 'トップページ'
tj.menu_title = ''
tj.slug = 'top-page'
tj.path = 'top-Page'
tj.has_url_overwrite = False
tj.application_urls = None
tj.redirect = None
tj.meta_description = None
tj.meta_keywords = None
tj.page_title = None
tj.page_id = 1
tj.creation_date = datetime.datetime.now()
tj.save()
#cms_title en
te = Title()
te.publisher_is_draft = True
te.publisher_public_id = None
te.publisher_state = 1
te.language = 'en'
te.title = 'Top Page'
te.menu_title = ''
te.slug = 'top-page-en'
te.path = 'top-page-en'
te.has_url_overwrite = False
te.application_urls = None
te.redirect = None
te.meta_description = None
te.meta_keywords = None
te.page_title = None
te.page_id = 1
te.creation_date = datetime.datetime.now()
te.save()
#plugins
#cms_cmsplugin (text) ja
plg = Text()
plg.publisher_is_draft = True
plg.publisher_public_id = None
plg.publisher_state = 1
plg.placeholder_id = 1
plg.parent_id = None
plg.position = 0
plg.language= 'ja'
plg.plugin_type = 'TextPlugin'
plg.creation_date = datetime.datetime.now()
plg.level = 0
plg.lft = 1
plg.rght= 2
plg.tree_id = 1
plg.body = '
トップページ
'
plg.save()
#cms_cmsplugin en
plg = Text()
plg.publisher_is_draft = True
plg.publisher_public_id = None
plg.publisher_state = 1
plg.placeholder_id = 1
plg.parent_id = None
plg.position = 0
plg.language= 'en'
plg.plugin_type = 'TextPlugin'
plg.creation_date = datetime.datetime.now()
plg.level = 0
plg.lft = 1
plg.rght= 2
plg.tree_id = 2
plg.body = '
Top Page
'
plg.save()
p.save()
2010年8月24日火曜日
EclipseでDjango Debug
eclipse起動
workspaceを上位のディレクトリに
file->new->Other(ctrl+N)でNew dialog
PydevフォルダのPydev Project
next
[Project Name]を書き入れ[Create default 'src' folder ...]をアンチエック
[Please configure an interpreter ...]を押してPython Iterpreter dialog
[New]を押してInterpreter Name, Interpreter Executableを設定Interpreter Executableはdjangoが設定してあるものを選択
Selection Needed dialogで[OK],Preferenceで[apply][OK]
PyDev ProjectでInterpreterを選択
[debug]->[Debug Configurations]で[Pydev Django]を選択して新規作成
Nameを記入し[Main]タブのProjectを選択、Main Moduleはmanage.pyを選択。
[Arguments]タブのProgram argumentsに[runserver --noreload]
[Interpreter]タブのInterpreterで先ほど設定したInterpreterを[Apply][Debug]
sqliteのパスは忘れないように。(泣き)
'NAME': PROJECT_ROOT + '/cms.db',
workspaceを上位のディレクトリに
file->new->Other(ctrl+N)でNew dialog
PydevフォルダのPydev Project
next
[Project Name]を書き入れ[Create default 'src' folder ...]をアンチエック
[Please configure an interpreter ...]を押してPython Iterpreter dialog
[New]を押してInterpreter Name, Interpreter Executableを設定Interpreter Executableはdjangoが設定してあるものを選択
Selection Needed dialogで[OK],Preferenceで[apply][OK]
PyDev ProjectでInterpreterを選択
[debug]->[Debug Configurations]で[Pydev Django]を選択して新規作成
Nameを記入し[Main]タブのProjectを選択、Main Moduleはmanage.pyを選択。
[Arguments]タブのProgram argumentsに[runserver --noreload]
[Interpreter]タブのInterpreterで先ほど設定したInterpreterを[Apply][Debug]
sqliteのパスは忘れないように。(泣き)
'NAME': PROJECT_ROOT + '/cms.db',
2010年8月10日火曜日
2010年8月8日日曜日
pdfのfontを確認
pdffonts *.pdf
Usage: pdffonts [options]
-f : first page to examine
-l : last page to examine
-opw : owner password (for encrypted files)
-upw : user password (for encrypted files)
-v : print copyright and version info
-h : print usage information
-help : print usage information
--help : print usage information
-? : print usage information
Usage: pdffonts [options]
-f
-l
-opw
-upw
-v : print copyright and version info
-h : print usage information
-help : print usage information
--help : print usage information
-? : print usage information
2010年8月4日水曜日
登録:
投稿 (Atom)