Changes for upgrade to Django 1.7.8

- Removed south from installed apps.
- Moved migrations to south_migrations.
- Added new migrations directories.
- MIGRATION_MODULES setting.
- Added initial migrations
- Added TEST_RUNNER setting.
- Updated wsgi file.
- Changed mimetype arg in HttpResponse to content_type.
parent f49d58c5
This diff is collapsed.
This diff is collapsed.
......@@ -581,7 +581,7 @@ def jqgridResponse(request, objects):
pass
def flexigridResponse(request, objects):
response = HttpResponse(mimetype='application/json')
response = HttpResponse(content_type='application/json')
#sortname = request.POST.get('sortname', None)
#sortorder = request.POST.get('sortorder', 'desc')
......
......@@ -109,13 +109,13 @@ def create(request):
# XXX Risky. msg should be json, not str.
# str(x) is *often* the same as json(x), but not always.
# It's not, because we don't reliably have json on the client side.
response = HttpResponse(mimetype='application/json')
response = HttpResponse(content_type='application/json')
if 'graceid' in d:
d['output'] = "%s" % d['graceid']
d['graceid'] = "%s" % d['graceid']
msg = str(d)
else: # Old client
response = HttpResponse(mimetype='text/plain')
response = HttpResponse(content_type='text/plain')
if 'error' in d:
msg = "ERROR: " + d['error']
elif 'warning' in d:
......@@ -374,7 +374,7 @@ def search(request, format=""):
msg = "An error occured while trying to compile LigoLw results: %s" % str(e)
return HttpResponseServerError(msg)
response = HttpResponse(mimetype='application/xml')
response = HttpResponse(content_type='application/xml')
response['Content-Disposition'] = 'attachment; filename=gracedb-query.xml'
utils.write_fileobj(xmldoc, response)
return response
......
# -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'LigoLdapUser'
db.create_table('ligoauth_ligoldapuser', (
('user_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True, primary_key=True)),
('ldap_dn', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100)),
))
db.send_create_signal('ligoauth', ['LigoLdapUser'])
class Migration(migrations.Migration):
# Adding model 'LocalUser'
db.create_table('ligoauth_localuser', (
('user_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True, primary_key=True)),
))
db.send_create_signal('ligoauth', ['LocalUser'])
dependencies = [
('auth', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
# Adding model 'X509Cert'
db.create_table('ligoauth_x509cert', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('subject', self.gf('django.db.models.fields.CharField')(max_length=200)),
))
db.send_create_signal('ligoauth', ['X509Cert'])
# Adding M2M table for field users on 'X509Cert'
db.create_table('ligoauth_x509cert_users', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('x509cert', models.ForeignKey(orm['ligoauth.x509cert'], null=False)),
('user', models.ForeignKey(orm['auth.user'], null=False))
))
db.create_unique('ligoauth_x509cert_users', ['x509cert_id', 'user_id'])
def backwards(self, orm):
# Deleting model 'LigoLdapUser'
db.delete_table('ligoauth_ligoldapuser')
# Deleting model 'LocalUser'
db.delete_table('ligoauth_localuser')
# Deleting model 'X509Cert'
db.delete_table('ligoauth_x509cert')
# Removing M2M table for field users on 'X509Cert'
db.delete_table('ligoauth_x509cert_users')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'ligoauth.ligoldapuser': {
'Meta': {'object_name': 'LigoLdapUser', '_ormbases': ['auth.User']},
'ldap_dn': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'})
},
'ligoauth.localuser': {
'Meta': {'object_name': 'LocalUser', '_ormbases': ['auth.User']},
'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'})
},
'ligoauth.x509cert': {
'Meta': {'object_name': 'X509Cert'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'subject': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'symmetrical': 'False'})
}
}
complete_apps = ['ligoauth']
operations = [
migrations.CreateModel(
name='AlternateEmail',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('email', models.EmailField(max_length=254)),
],
options={
},
bases=(models.Model,),
),
migrations.CreateModel(
name='LigoLdapUser',
fields=[
('user_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
('ldap_dn', models.CharField(unique=True, max_length=100)),
],
options={
'abstract': False,
'verbose_name': 'user',
'verbose_name_plural': 'users',
},
bases=('auth.user',),
),
migrations.CreateModel(
name='LocalUser',
fields=[
('user_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
'verbose_name': 'user',
'verbose_name_plural': 'users',
},
bases=('auth.user',),
),
migrations.CreateModel(
name='X509Cert',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('subject', models.CharField(max_length=200)),
('users', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
],
options={
},
bases=(models.Model,),
),
migrations.AddField(
model_name='alternateemail',
name='user',
field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
preserve_default=True,
),
]
# -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'LigoLdapUser'
db.create_table('ligoauth_ligoldapuser', (
('user_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True, primary_key=True)),
('ldap_dn', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100)),
))
db.send_create_signal('ligoauth', ['LigoLdapUser'])
# Adding model 'LocalUser'
db.create_table('ligoauth_localuser', (
('user_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True, primary_key=True)),
))
db.send_create_signal('ligoauth', ['LocalUser'])
# Adding model 'X509Cert'
db.create_table('ligoauth_x509cert', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('subject', self.gf('django.db.models.fields.CharField')(max_length=200)),
))
db.send_create_signal('ligoauth', ['X509Cert'])
# Adding M2M table for field users on 'X509Cert'
db.create_table('ligoauth_x509cert_users', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('x509cert', models.ForeignKey(orm['ligoauth.x509cert'], null=False)),
('user', models.ForeignKey(orm['auth.user'], null=False))
))
db.create_unique('ligoauth_x509cert_users', ['x509cert_id', 'user_id'])
def backwards(self, orm):
# Deleting model 'LigoLdapUser'
db.delete_table('ligoauth_ligoldapuser')
# Deleting model 'LocalUser'
db.delete_table('ligoauth_localuser')
# Deleting model 'X509Cert'
db.delete_table('ligoauth_x509cert')
# Removing M2M table for field users on 'X509Cert'
db.delete_table('ligoauth_x509cert_users')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'ligoauth.ligoldapuser': {
'Meta': {'object_name': 'LigoLdapUser', '_ormbases': ['auth.User']},
'ldap_dn': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'})
},
'ligoauth.localuser': {
'Meta': {'object_name': 'LocalUser', '_ormbases': ['auth.User']},
'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'})
},
'ligoauth.x509cert': {
'Meta': {'object_name': 'X509Cert'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'subject': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'symmetrical': 'False'})
}
}
complete_apps = ['ligoauth']
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(default=django.utils.timezone.now, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.', unique=True, max_length=30, verbose_name='username', validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid username.', 'invalid')])),
('first_name', models.CharField(max_length=30, verbose_name='first name', blank=True)),
('last_name', models.CharField(max_length=30, verbose_name='last name', blank=True)),
('email', models.EmailField(max_length=75, verbose_name='email address', blank=True)),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
],
options={
'abstract': False,
'verbose_name': 'user',
'swappable': 'AUTH_USER_MODEL',
'verbose_name_plural': 'users',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Group',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(unique=True, max_length=80, verbose_name='name')),
],
options={
'verbose_name': 'group',
'verbose_name_plural': 'groups',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Permission',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=50, verbose_name='name')),
('codename', models.CharField(max_length=100, verbose_name='codename')),
('content_type', models.ForeignKey(to='contenttypes.ContentType')),
],
options={
'ordering': ('content_type__app_label', 'content_type__model', 'codename'),
'verbose_name': 'permission',
'verbose_name_plural': 'permissions',
},
bases=(models.Model,),
),
migrations.AlterUniqueTogether(
name='permission',
unique_together=set([('content_type', 'codename')]),
),
migrations.AddField(
model_name='group',
name='permissions',
field=models.ManyToManyField(to='auth.Permission', verbose_name='permissions', blank=True),
preserve_default=True,
),
migrations.AddField(
model_name='user',
name='groups',
field=models.ManyToManyField(related_query_name='user', related_name='user_set', to='auth.Group', blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of his/her group.', verbose_name='groups'),
preserve_default=True,
),
migrations.AddField(
model_name='user',
name='user_permissions',
field=models.ManyToManyField(related_query_name='user', related_name='user_set', to='auth.Permission', blank=True, help_text='Specific permissions for this user.', verbose_name='user permissions'),
preserve_default=True,
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='GroupObjectPermission',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('object_pk', models.CharField(max_length=255, verbose_name='object ID')),
('content_type', models.ForeignKey(to='contenttypes.ContentType')),
('group', models.ForeignKey(to='auth.Group')),
('permission', models.ForeignKey(to='auth.Permission')),
],
options={
},
bases=(models.Model,),
),
migrations.CreateModel(
name='UserObjectPermission',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('object_pk', models.CharField(max_length=255, verbose_name='object ID')),
('content_type', models.ForeignKey(to='contenttypes.ContentType')),
('permission', models.ForeignKey(to='auth.Permission')),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
],
options={
},
bases=(models.Model,),
),
migrations.AlterUniqueTogether(
name='userobjectpermission',
unique_together=set([('user', 'permission', 'object_pk')]),
),
migrations.AlterUniqueTogether(
name='groupobjectpermission',
unique_together=set([('group', 'permission', 'object_pk')]),
),
]
......@@ -44,6 +44,9 @@ EMBB_SMTP_SERVER = 'localhost'
EMBB_MAIL_ADMINS = ['branson@gravity.phys.uwm.edu','roy.williams@ligo.org',]
EMBB_IGNORE_ADDRESSES = ['Mailer-Daemon@gracedb.phys.uwm.edu',]
# Added for django 1.7.8
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
# 11/18/14. No longer checking XMPP_ALERT_CHANNELS. This is not necessary.
# If someone sends out an event, an alert should go out. Listerers have the
# option to unsubscribe from nodes if so desired.
......@@ -298,7 +301,6 @@ INSTALLED_APPS = (
'userprofile',
'ligoauth',
'rest_framework',
'south',
'guardian',
)
......@@ -322,7 +324,7 @@ STATICFILES_FINDERS = (
STATICFILES_DIRS = ()
# Added in order to perform data migrations on the auth app
SOUTH_MIGRATION_MODULES = {
MIGRATION_MODULES = {
'auth' : 'migrations.auth',
'guardian' : 'migrations.guardian',
}
......
......@@ -148,7 +148,7 @@ INSTALLED_APPS = (
'userprofile',
'ligoauth',
'rest_framework',
'south',
# 'south',
'guardian',
)
......
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'AnalysisType'
db.create_table('userprofile_analysistype', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('code', self.gf('django.db.models.fields.CharField')(unique=True, max_length=20)),
('display', self.gf('django.db.models.fields.CharField')(unique=True, max_length=20)),
))
db.send_create_signal('userprofile', ['AnalysisType'])