mezzanine
が4.2
にversion up
したので、
当ブログのmezzanine
を4.1
から4.2
にupdate
してみました。
そんなにversion
上げた
実施した
0. 前提
以下の
CentOS release 6.7 (Final)
Python Version
Python 2.7.8Package (必要そうな
ものだけ 抜粋)
Django (1.9.6)
Mezzanine (4.1.0)
1. UPGRADE
現状Versionの 確認
UPGRADE
前のpip list
[0.]の内容とも 重複しますが、 UPGRADE
前の構成情報に なります。
pip list ------------------------------------ beautifulsoup4 (4.4.1) bleach (1.4.2) chardet (2.3.0) Django (1.9.6) django-appconf (1.0.2) django-compressor (2.0) django-contrib-comments (1.7.1) django-crontab (0.7.1) django-grappelli (2.8.1) django-htmlmin (0.9.1) django-request (1.4.0) django-robots (2.0) django-sites (0.9) filebrowser-safe (0.4.3) future (0.15.2) grappelli-safe (0.4.2) html5lib (0.9999999) importlib (1.0.3) Markdown (2.6.6) Mezzanine (4.1.0) mezzanine-pagedown (1.0) oauthlib (1.1.1) Pillow (3.2.0) pip (8.1.2) psycopg2 (2.6.1) Pygments (2.0.2) pytz (2016.4) rcssmin (1.0.6) requests (2.10.0) requests-oauthlib (0.6.1) rjsmin (1.0.12) setuptools (21.0.0) six (1.10.0) tzlocal (1.2.2) wheel (0.26.0) -----------------------------------
UPGRADE
pip install Mezzanine -U ----------------------------------- Successfully installed Mezzanine-4.2.0 beautifulsoup4-4.5.1 bleach-1.4.3 django-1.10 django-contrib-comments-1.7.2 oauthlib-1.1.2 pillow-3.3.0 pytz-2016.6.1 requests-2.11.0 requests-oauthlib-0.6.2 -----------------------------------
2. check コマンドに よる 確認
django
にcheck
とcomammd
が
* は
に、
もし興味が
あれば python manage.py check を 実行する こともできます
これはマイグレーションを 作成したり データベースに ふれる ことなく プロジェクトに なんの 問題が ないか 確認します 。
と記載がcheck
してくれます。
エンプラだったら、
python2.7 manage.py check
実行
python2.7 manage.py check ----------------------------------- File {$MEZZANINE_PROJECT_HOME}/urls.py", line 10, in <module> import mezzanine_pagedown.urls File "/usr/local/lib/python2.7/site-packages/mezzanine_pagedown/urls.py", line 1, in <module> from django.conf.urls import patterns, url ImportError: cannot import name patterns -----------------------------------
mezzanine_pagedown
プラグインで
パッケージのUPGRADE
を
pip install mezzanine-pagedown -U ----------------------------------- 変化なし -----------------------------------
変化が
/usr/local/lib/python2.7/site-packages/mezzanine_pagedown/urls.py
で、
エラーに
Bitbucket でissue
の
そのうち
以下の
from django.conf.urls import url from .views import MarkupPreview urlpatterns = [ url(r'^preview/$', MarkupPreview.as_view(), name='preview'), ] #urlpatterns = patterns('', # url(r'^preview/$', MarkupPreview.as_view(), name='preview'), #)
python2.7 manage.py check
再度実行
python2.7 manage.py check ----------------------------------- File "/var/www/site/blog/blog/urls.py", line 20, in <module> url("^xyz_monotalk_admin/backup/$", "admin_backup.views.admin_backup", name="admin_backup"), File "/usr/local/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 85, in url raise TypeError('view must be a callable or a list/tuple in the case of include().') TypeError: view must be a callable or a list/tuple in the case of include(). -----------------------------------
urls.py
の
文字列参照ではなくて、
from admin_backup.views import admin_backup urlpatterns = i18n_patterns( # MEZZANINE ADMIN BACKUP # ---------------------- #url("^admin/backup/$", "admin_backup.views.admin_backup", name="admin_backup"), url("^admin/backup/$", admin_backup, name="admin_backup"), # ---------------------- # Change the admin prefix here to use an alternate URL for the # admin interface, which would be marginally more secure. url("^admin/", include(admin.site.urls)), )
python2.7 manage.py check
再々 実行
File "/usr/local/lib/python2.7/site-packages/request/admin.py", line 63, in get_urls return patterns('', UnboundLocalError: local variable 'patterns' referenced before assignment
django-request (1.4.0)
でurl
関連で
Github上の
それを/usr/local/lib/python2.7/site-packages/request/admin.py
を、
以下の
- 1箇所目
43 def get_urls(self): 44 try: 45 from django.conf.urls import url 46 #from django.conf.urls import patterns, url 47 except ImportError: 48 # to keep backward (Django <= 1.4) compatibility 49 from django.conf.urls.defaults import patterns, url 50
- 2箇所目
return [ url(r'^overview/$', wrap(self.overview), name='%s_%s_overview' % info), url(r'^overview/traffic/$', wrap(self.traffic), name='%s_%s_traffic' % info), ] + super(RequestAdmin, self).get_urls() #return patterns('', # url(r'^overview/$', wrap(self.overview), name='%s_%s_overview' % info), # url(r'^overview/traffic.json$', wrap(self.traffic), name='%s_%s_traffic' % info), #) + super(RequestAdmin, self).get_urls()
3. サーバー 起動後の 確認
[2].の
service httpd restart
を実行し
1つ目 テーマ内使っていたfuture
の 記述を 削除
Internal Server Error: / TemplateSyntaxError at / 'future' is not a registered tag library. Must be one of:
template内の
古い
mezzaninne 3
のを
django1.9
からfuture
タグが
future
のtemplate
から
- テーマ内使っていた
future
の記述を 削除
find ./ -name *.html | xargs grep 'future' -------------- ./templates/pages/index.html:{% load pages_tags mezzanine_tags i18n future staticfiles blog_tags keyword_tags %} ./templates/pages/menus/footer.html:{% load i18n future pages_tags blog_tags keyword_tags mezzanine_tags %} ./templates/pages/menus/breadcrumb.html:{% load i18n future pages_tags %} ./templates/pages/menus/footer_tree.html:{% load i18n future pages_tags %} ./templates/pages/menus/admin.html:{% load pages_tags i18n future staticfiles %} ./templates/pages/menus/dropdown.html:{% load i18n future pages_tags mezzanine_tags%} ./templates/pages/menus/mobile.html:{% load i18n future pages_tags %} ./templates/pages/menus/tree.html:{% load i18n future pages_tags %} ./templates/pages/menus/primary.html:{% load pages_tags i18n future %} ./templates/accounts/includes/user_panel_nav.html:{% load i18n future mezzanine_tags accounts_tags %} ./templates/accounts/includes/user_panel.html:{% load i18n future mezzanine_tags accounts_tags %} ./templates/accounts/account_profile.html:{% load i18n future mezzanine_tags accounts_tags %} ./templates/accounts/account_login.html:{% load i18n future %} ./templates/includes/search_form.html:{% load mezzanine_tags i18n future %} ./templates/includes/editable_toolbar.html:{% load i18n future staticfiles %} ./templates/includes/editable_form.html:{% load i18n future %} ./templates/includes/editable_loader.html:{% load i18n future staticfiles %} ./templates/generic/includes/rating.html:{% load mezzanine_tags rating_tags i18n future %} --------------
2つ目 No module named context_processors
で エラー
Exception Type: ImportError at /wp-login.php/ Exception Value: No module named context_processors Request information: USER: AnonymousUser
Upgrading templates to Django 1.8 | Django documentation | Django に、
Furthermore you should replace django.core.context_processors with django.template.context_processors in the names of context processors.
と記載されています。TEMPLATES
を
context_processors
の
settings.py
内の、TEMPLATES
で
context_processors
の
'context_processors': ( 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', #'django.core.context_processors.debug', #'django.core.context_processors.i18n', #'django.core.context_processors.static', #'django.core.context_processors.media', #'django.core.context_processors.request', #'django.core.context_processors.tz', "django.template.context_processors.debug", "django.template.context_processors.i18n", "django.template.context_processors.static", "django.template.context_processors.media", "django.template.context_processors.request", "django.template.context_processors.tz", 'mezzanine.conf.context_processors.settings', 'mezzanine.pages.context_processors.page'),
これで、
Django110Warning
で
軒並み
以上です。
コメント