Skip to content

Commit 98ee067

Browse files
author
Jakub Dorňák
committed
Fedora 22 compatibility
1 parent 52c9a70 commit 98ee067

30 files changed

+192
-2211
lines changed

README.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,43 @@ softwarecollections
44
Software Collections Management Website
55

66

7+
Date migration from Django-1.6.x (Fedora-20) to Django-1.8.x (Fedora 22)
8+
-------------------------------------------------------------------
9+
10+
1. With Django 1.6.x dump the data:
11+
12+
softwarecollections dumpdata scls tagging auth.user > data.json
13+
14+
2. Remove the database and upgrade the system or move data.json to the new system.
15+
16+
3. Check the new id of ContentType SoftwareCollection:
17+
18+
softwarecollections shell
19+
>>> from django.contrib.contenttypes.models import ContentType
20+
>>> ContentType.objects.get(app_label='scls', model='softwarecollection').id
21+
2
22+
23+
4. Fix the id in data.json:
24+
25+
sed -i -r 's/"content_type": [0-9]+,/"content_type": 2,/g' data.json
26+
27+
5. Load updated data:
28+
29+
softwarecollections loaddata data.json
30+
31+
Voilà!
32+
33+
734
Installation
835
------------
936

1037
Enable yum repository from copr:
1138

12-
sudo wget -O /etc/yum.repos.d/SoftwareCollections.repo http://copr-fe.cloud.fedoraproject.org/coprs/mstuchli/SoftwareCollections/repo/fedora-20-x86_64/
39+
sudo dnf copr enable jdornak/SoftwareCollections
1340

1441
Install package softwarecollections:
1542

16-
sudo yum -y install softwarecollections
43+
sudo dnf install softwarecollections
1744

1845

1946
Configuration (production instance)
@@ -27,7 +54,7 @@ Check the configuration in config files:
2754
If you have changed the configuration of database connection
2855
(which is recommended for production), initialize the database with:
2956

30-
sudo softwarecollections syncdb --migrate --noinput
57+
sudo softwarecollections migrate
3158

3259

3360
Development instance
@@ -56,8 +83,7 @@ Create local configuration:
5683

5784
Initialize development database:
5885

59-
./manage.py syncdb --all
60-
./manage.py migrate --fake
86+
./manage.py migrate
6187

6288
Run development server:
6389

@@ -77,7 +103,7 @@ first make Yourself a superuser:
77103
To update your code and database to the last available version run:
78104

79105
git pull --rebase
80-
./manage.py syncdb --migrate --noinput
106+
./manage.py migrate
81107

82108
You may also need to install some new requirements (see the spec file).
83109

@@ -104,10 +130,8 @@ Help
104130
----
105131

106132
If this is Your first time working with Django application, read through the
107-
[Django Tutorial](https://docs.djangoproject.com/en/1.6/intro/tutorial01/).
133+
[Django Tutorial](https://docs.djangoproject.com/en/1.8/intro/tutorial01/).
108134

109135
For the detailed information about all aspect of using Django see the
110-
[Django Documentation](https://docs.djangoproject.com/en/1.6/).
136+
[Django Documentation](https://docs.djangoproject.com/en/1.8/).
111137

112-
If You have changed some model and You want to create migrations, see the
113-
[South Tutorial](http://south.readthedocs.org/en/latest/tutorial/part1.html).

rel-eng/releasers.conf.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[copr]
22
releaser = tito.release.CoprReleaser
3-
project_name = mstuchli/SoftwareCollections
3+
project_name = jdornak/SoftwareCollections
44
upload_command = chmod 0644 %(srpm)s; rsync -p %(srpm)s fedorapeople.org:public_html/
55
remote_location = http://<USERNAME>.fedorapeople.org/
66

77
[copr-test]
88
releaser = tito.release.CoprReleaser
99
builder.test = 1
10-
project_name = mstuchli/SoftwareCollections
10+
project_name = jdornak/SoftwareCollections
1111
upload_command = chmod 0644 %(srpm)s; rsync -p %(srpm)s fedorapeople.org:public_html/
1212
remote_location = http://<USERNAME>.fedorapeople.org/
1313

softwarecollections.spec

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ Requires: python3-django-fas
3636
Requires: python3-django-markdown2
3737
Requires: python3-django-sekizai
3838
Requires: python3-django-simple-captcha
39-
Requires: python3-django-south
4039
Requires: python3-django-tagging
4140
Requires: python3-flock
4241
Requires: python3-memcached
@@ -148,14 +147,8 @@ if [ ! -e %{_sysconfdir}/pki/tls/certs/softwarecollections.org.CA.
148147
fi
149148

150149
service httpd condrestart
151-
if [ -e %{scls_statedir}/data/db.sqlite3 ]; then
152-
# update database
153-
softwarecollections syncdb --migrate --noinput || :
154-
else
155-
# install database
156-
softwarecollections syncdb --all --noinput || :
157-
softwarecollections migrate --fake || :
158-
fi
150+
151+
softwarecollections syncdb migrate || :
159152
softwarecollections collectstatic --noinput || :
160153
softwarecollections makeerrorpages || :
161154

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
default_app_config = 'softwarecollections.auth.apps.SoftwarecollectionsAuthConfig'
3+

softwarecollections/auth/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
class SoftwarecollectionsAuthConfig(AppConfig):
4+
name = 'softwarecollections.auth'
5+
label = 'softwarecollections.auth'
6+

softwarecollections/auth/models.py

Whitespace-only changes.

softwarecollections/localsettings-development.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
"""
55
Django settings for softwarecollections project.
66
7+
Generated by 'django-admin startproject' using Django 1.8.2.
8+
79
For more information on this file, see
8-
https://docs.djangoproject.com/en/1.6/topics/settings/
10+
https://docs.djangoproject.com/en/1.8/topics/settings/
911
1012
For the full list of settings and their values, see
11-
https://docs.djangoproject.com/en/1.6/ref/settings/
13+
https://docs.djangoproject.com/en/1.8/ref/settings/
1214
"""
1315

1416
# import ugettext_lazy to avoid circular module import
@@ -20,7 +22,7 @@
2022

2123

2224
# Quick-start development settings - unsuitable for production
23-
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
25+
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
2426

2527
# SECURITY WARNING: keep the secret key used in production secret!
2628
SECRET_KEY = 'm0zn_p7x*o(xvk^9p8_$6n7o)dn$bh-*_*xu*b!mg9$ihh0xu+'
@@ -32,9 +34,9 @@
3234
ALLOWED_HOSTS = []
3335

3436
# Emails
35-
# https://docs.djangoproject.com/en/1.6/ref/settings/#std:setting-ADMINS
36-
# https://docs.djangoproject.com/en/1.6/ref/settings/#std:setting-MANAGERS
37-
# https://docs.djangoproject.com/en/1.6/ref/settings/#std:setting-SERVER_EMAIL
37+
# https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-ADMINS
38+
# https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-MANAGERS
39+
# https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-SERVER_EMAIL
3840
ADMINS = ()
3941
MANAGERS = ADMINS
4042
SERVER_EMAIL = 'SoftwareCollections @ {} <admin@softwarecollections.org>'.format(os.uname()[1])
@@ -45,7 +47,7 @@
4547
COPR_COPRS_URL = COPR_URL + '/coprs'
4648

4749
# Database
48-
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
50+
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
4951

5052
DATABASES = {
5153
'default': {
@@ -55,7 +57,7 @@
5557
}
5658

5759
# Internationalization
58-
# https://docs.djangoproject.com/en/1.6/topics/i18n/
60+
# https://docs.djangoproject.com/en/1.8/topics/i18n/
5961

6062
LANGUAGE_CODE = 'en'
6163

softwarecollections/localsettings-production.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
"""
55
Django settings for softwarecollections project.
66
7+
Generated by 'django-admin startproject' using Django 1.8.2.
8+
79
For more information on this file, see
8-
https://docs.djangoproject.com/en/1.6/topics/settings/
10+
https://docs.djangoproject.com/en/1.8/topics/settings/
911
1012
For the full list of settings and their values, see
11-
https://docs.djangoproject.com/en/1.6/ref/settings/
13+
https://docs.djangoproject.com/en/1.8/ref/settings/
1214
"""
1315

1416
# import ugettext_lazy to avoid circular module import
@@ -29,9 +31,9 @@
2931
ALLOWED_HOSTS = ['www.softwarecollections.org']
3032

3133
# Emails
32-
# https://docs.djangoproject.com/en/1.6/ref/settings/#std:setting-ADMINS
33-
# https://docs.djangoproject.com/en/1.6/ref/settings/#std:setting-MANAGERS
34-
# https://docs.djangoproject.com/en/1.6/ref/settings/#std:setting-SERVER_EMAIL
34+
# https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-ADMINS
35+
# https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-MANAGERS
36+
# https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-SERVER_EMAIL
3537
ADMINS = (
3638
('Jakub Dorňák', 'jdornak@redhat.com'),
3739
('Miroslav Suchý', 'msuchy@redhat.com'),
@@ -46,7 +48,7 @@
4648
COPR_COPRS_URL = COPR_URL + '/coprs'
4749

4850
# Database
49-
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
51+
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
5052

5153
DATABASES = {
5254
'default': {
@@ -56,7 +58,7 @@
5658
}
5759

5860
# Internationalization
59-
# https://docs.djangoproject.com/en/1.6/topics/i18n/
61+
# https://docs.djangoproject.com/en/1.8/topics/i18n/
6062

6163
LANGUAGE_CODE = 'en'
6264

0 commit comments

Comments
 (0)