upgrade-from-0.8-notes.txt 4.21 KB
Newer Older
Kroustouris Stauros's avatar
Kroustouris Stauros committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
packages:
- apache 2.2 (web-server::apache2-worker) (first remove nginx)
- memcached
- mysql-server (mysql::server)
- mysql-client
- libapache2-mod-wsgi
- libapache2-mod-shib2
# (major) packages instead of pip
- python-memcache
- python-mysqldb
- python-django-auth-ldap (and therefore python-django)
- python-lxml
- python-yaml
# for PSA
- python-httplib2
- python-oauth2
- python-openid
# djnro requirements
#- libxml2-dev ***not necessary***
#- libxslt1-dev ***not necessary***
- gettext (for translation dev)
# to use pip/venv
- python-pip
- python-virtualenv
#- python-dev ***not necessary***
# irrelevant
- ipython
- patch
- mercurial
- winpdb


djnro-old virtualenv:
- Django==1.2.3
- South==0.7.5 (due to issue affecting migration edumanage:0028 https://lists.grnet.gr/wws/arc/djnro/2013-02/msg00001.html )
- django-extensions==0.5
- django-registration==0.7
- django-tinymce==1.5 ***with patch[1]***
- django-fixture-magic==0.0.7 (order fixtures with forward references)
#- httplib2==0.9.1 ***not necessary***
- ipaddr==2.1.11
- oauth==1.0.1
#- python-openid==2.2.4 ***not necessary***
- ipython (for shell_plus, some conflict with deb version)
- yolk


djnro-new virtualenv:
- South==1.0
- django-registration==1.0
- django-tinymce==1.5.3
- ipaddr==2.1.11
- longerusername==0.4
- python-social-auth==0.2.10
- requests==2.7.0 (also required by PSA)
- yolk


** virtualenv creation (relocatable):
- virtualenv --python=/usr/bin/python2.7 --system-site-packages /venvpath
- patch[3] /venvpath/bin/activate
- virtualenv --relocatable /venvpath


procedure
- install venv djnro-old
- patch[1] tinymce/widgets.py
- checkout branch oldstable
- patch[2] manage.py
- adjust paths/imports in settings.py/urls.py/django.wsgi
- create database:
    create database eduroam character set = 'utf8' collate = 'utf8_unicode_ci';
- manage.py syncdb --setings='settings'
- manage.py migrate --setings='settings'
- (on network.grnet.gr) manage.py dumpdata --indent=4 --natural --exclude=contenttypes --exclude=auth.Permission > /tmp/eduroam_production.json
- add 'fixture_magic' to INSTALLED_APPS in settings.py
- manage.py reorder_fixtures --settings='settings' /tmp/eduroam_production.json edumanage.name_i18n edumanage.url_i18n edumanage.contact edumanage.realm edumanage.realmdata edumanage.institution edumanage.institutiondetails edumanage.institutioncontactpool edumanage.serviceloc edumanage.instserver edumanage.instrealm edumanage.instrealmmon edumanage.monlocalauthnparam edumanage.monproxybackclient > /tmp/eduroam_production.ordered.json
- manage.py loaddata --settings='settings' /tmp/eduroam_production_20150927b.ordered.json
- apache setup vhost
### confirm working oldstable
- install venv djnro-new
- checkout manage.py
- checkout branch master
- adjust djnro/local_settings.py
- manage.py migrate default 0001_initial --fake
(add accounts/migrations/0004_migrate_google_accounts.py)
- manage.py migrate
- apache setup vhost





[1] patch:
Index: widgets.py
===================================================================
--- widgets.py
+++ widgets.py
@@ -11,7 +11,7 @@
 from django.contrib.admin import widgets as admin_widgets
 from django.core.urlresolvers import reverse
 from django.forms.widgets import flatatt
-from django.forms.util import smart_unicode
+from django.utils.encoding import smart_unicode
 from django.utils.html import escape
 from django.utils import simplejson
 from django.utils.datastructures import SortedDict

[2] patch:
diff --git a/manage.py b/manage.py
index bcdd55e..5e78ea9 100755
--- a/manage.py
+++ b/manage.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 from django.core.management import execute_manager
 try:
     import settings # Assumed to be in the same directory.

[3] patch:
--- a/activate        2015-09-28 03:12:24.000000000 +0300
+++ b/activate        2015-09-28 03:12:57.000000000 +0300
@@ -37,7 +37,16 @@
 # unset irrelavent variables
 deactivate nondestructive

-VIRTUAL_ENV="/venvpath"
+if [ -n "$BASH" ]; then
+    VIRTUAL_ENV=$(readlink -f "${BASH_SOURCE}" | sed 's#/bin/activate[^/]*$##')
+elif [ -n "$ZSH_VERSION" ]; then
+    VIRTUAL_ENV=$(readlink -f "${(%):-%N}" | sed 's#/bin/activate[^/]*$##')
+else
+    return 1
+fi
+if [ -z "$VIRTUAL_ENV" ]; then
+    return 1
+fi
 export VIRTUAL_ENV

 _OLD_VIRTUAL_PATH="$PATH"