Commit c452b7f2 authored by Leonidas Poulopoulos's avatar Leonidas Poulopoulos
Browse files

Merged with branding branch

parents 8ec6c22a c666e0f0
settings.py
urls.py
/urls.py
apache/django.wsgi
*.pyc
local.db
......
......@@ -14,6 +14,9 @@
* apache2-mod-rewrite
* apache2-shibboleth : The server should be setup as a Shibboleth SP
* A mail server - Tested with exim
* python-django-social-auth
* OpenId support depends on python-openid
* OAuth support depends on python-oauth2
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
ct, created = orm['contenttypes.ContentType'].objects.get_or_create(
model='userprofile', app_label='accounts') # model must be lowercase!
perm, created = orm['auth.permission'].objects.get_or_create(
content_type=ct, codename='overview', defaults=dict(name=u'Helpdesk/Managerial Overview'))
def backwards(self, orm):
"Write your backwards methods here."
models = {
'accounts.userprofile': {
'Meta': {'object_name': 'UserProfile'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'institution': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edumanage.Institution']"}),
'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
},
'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.message': {
'Meta': {'object_name': 'Message'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'message': ('django.db.models.fields.TextField', [], {}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'_message_set'", 'to': "orm['auth.User']"})
},
'auth.permission': {
'Meta': {'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', 'blank': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'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': '255'})
},
'contenttypes.contenttype': {
'Meta': {'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'})
},
'edumanage.contact': {
'Meta': {'object_name': 'Contact'},
'email': ('django.db.models.fields.CharField', [], {'max_length': '80', 'db_column': "'contact_email'"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_column': "'contact_name'"}),
'phone': ('django.db.models.fields.CharField', [], {'max_length': '80', 'db_column': "'contact_phone'"})
},
'edumanage.institution': {
'Meta': {'object_name': 'Institution'},
'ertype': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '1', 'db_column': "'type'"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'realmid': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edumanage.Realm']"})
},
'edumanage.name_i18n': {
'Meta': {'object_name': 'Name_i18n'},
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'lang': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'})
},
'edumanage.realm': {
'Meta': {'object_name': 'Realm'},
'address_city': ('django.db.models.fields.CharField', [], {'max_length': '24'}),
'address_street': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'contact': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['edumanage.Contact']", 'symmetrical': 'False'}),
'country': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'stype': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0', 'max_length': '1'}),
'ts': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
},
'edumanage.url_i18n': {
'Meta': {'object_name': 'URL_i18n'},
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'lang': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'url': ('django.db.models.fields.CharField', [], {'max_length': '180', 'db_column': "'URL'"}),
'urltype': ('django.db.models.fields.CharField', [], {'max_length': '10', 'db_column': "'type'"})
}
}
complete_apps = ['contenttypes', 'auth', 'accounts']
# encoding: 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 field 'UserProfile.is_social_active'
db.add_column('accounts_userprofile', 'is_social_active', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True), keep_default=False)
def backwards(self, orm):
# Deleting field 'UserProfile.is_social_active'
db.delete_column('accounts_userprofile', 'is_social_active')
models = {
'accounts.userprofile': {
'Meta': {'object_name': 'UserProfile'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'institution': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edumanage.Institution']"}),
'is_social_active': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
},
'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': {'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', 'blank': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'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': '255'})
},
'contenttypes.contenttype': {
'Meta': {'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'})
},
'edumanage.contact': {
'Meta': {'object_name': 'Contact'},
'email': ('django.db.models.fields.CharField', [], {'max_length': '80', 'db_column': "'contact_email'"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_column': "'contact_name'"}),
'phone': ('django.db.models.fields.CharField', [], {'max_length': '80', 'db_column': "'contact_phone'"})
},
'edumanage.institution': {
'Meta': {'object_name': 'Institution'},
'ertype': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '1', 'db_column': "'type'"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'realmid': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edumanage.Realm']"})
},
'edumanage.name_i18n': {
'Meta': {'object_name': 'Name_i18n'},
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'lang': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'})
},
'edumanage.realm': {
'Meta': {'object_name': 'Realm'},
'address_city': ('django.db.models.fields.CharField', [], {'max_length': '24'}),
'address_street': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'contact': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['edumanage.Contact']", 'symmetrical': 'False'}),
'country': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'stype': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0', 'max_length': '1'}),
'ts': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
},
'edumanage.url_i18n': {
'Meta': {'object_name': 'URL_i18n'},
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'lang': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'url': ('django.db.models.fields.CharField', [], {'max_length': '180', 'db_column': "'URL'"}),
'urltype': ('django.db.models.fields.CharField', [], {'max_length': '10', 'db_column': "'type'"})
}
}
complete_apps = ['accounts']
......@@ -6,6 +6,12 @@ from edumanage.models import *
class UserProfile(models.Model):
user = models.OneToOneField(User)
institution = models.ForeignKey(Institution)
is_social_active = models.BooleanField(default=False)
class Meta:
permissions = (
("overview", "Can see registered user and respective institutions"),
)
def __unicode__(self):
return "%s:%s" %(self.user.username, self.institution)
......
......@@ -13,7 +13,9 @@ import logging
import os
logger = logging.getLogger(__name__)
from django.views.decorators.cache import never_cache
@never_cache
def activate(request, activation_key):
account = None
if request.method == "GET":
......@@ -63,6 +65,8 @@ def activate(request, activation_key):
try:
rp = RegistrationProfile.objects.get(activation_key=activation_key)
account = RegistrationProfile.objects.activate_user(activation_key)
up.is_social_active = True
up.save()
logger.info("Activating user %s" %rp.user.username)
except Exception as e:
logger.info("An error occured: %s" %e)
......
# -*- coding: utf-8 -*- vim:encoding=utf-8:
# vim: tabstop=4:shiftwidth=4:softtabstop=4:expandtab
import ldap
from django.contrib.auth.models import User, UserManager, Permission, Group
from django.conf import settings
class ldapBackend:
def authenticate(self, username=None, password=None):
ldap_settings = settings.LDAP_AUTH_SETTINGS
# Authenticate the base user so we can search
# Go through servers using their corresponding DNs
for ldap_setting in ldap_settings:
uri = ldap_setting['url']
base = ldap_setting['base']
try:
l = ldap.initialize(uri)
l.start_tls_s()
except ldap.LDAPError:
continue
else:
l.protocol_version = ldap.VERSION3
l.simple_bind_s()
myUser = self._auth_user(base, username, password, l)
if not myUser:
continue
return myUser
def _auth_user(self, base, username, password, l):
scope = ldap.SCOPE_SUBTREE
filter = "uid=" + username
ret = ['dn', 'mail', 'givenName', 'sn']
try:
result_id = l.search(base, scope, filter, ret)
result_type, result_data = l.result(result_id, 0)
# If the user does not exist in LDAP, Fail.
if (len(result_data) != 1):
return None
# We prevent a situation where binding could raise an exception with empty password
# Plus security...
if (len(password) == 0):
return None
# Attempt to bind to the user's DN
l.simple_bind_s(result_data[0][0], password)
# Checking to see if user has an e-mail
try:
mail = result_data[0][1]['mail'][0]
except:
mail = ''
# The user existed and authenticated. Get the user record
try:
user = User.objects.get(username__exact=username)
user.email = mail
user.first_name = result_data[0][1]['givenName'][0]
user.last_name = result_data[0][1]['sn'][0]
user.is_active = True
user.save()
# The user did not exist. Create one with no privileges
except:
user = User.objects.create_user(username, mail, None)
user.first_name = result_data[0][1]['givenName'][0]
user.last_name = result_data[0][1]['sn'][0]
user.is_staff = settings.LDAP_AUTH_IS_STAFF
user.is_superuser = False
user.is_active = True
if settings.LDAP_AUTH_GROUP:
try:
g = Group.objects.get(name=settings.LDAP_AUTH_GROUP)
user.groups.add(g)
user.save()
except:
pass
return user
except ldap.INVALID_CREDENTIALS:
return None
def get_user(self, user_id):
try:
return User.objects.get(pk=user_id)
except User.DoesNotExist:
return None
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.utils.translation import ugettext as _
from accounts.models import *
from edumanage.forms import *
from edumanage.models import *
def social_active_required(function):
def wrap(request, *args, **kw):
user=request.user
try:
profile = request.user.get_profile()
if profile.is_social_active == True:
return function(request, *args, **kw)
else:
status = _("User account <strong>%s</strong> is pending activation. Administrators have been notified and will activate this account within the next days. <br>If this account has remained inactive for a long time contact your technical coordinator or GRNET Helpdesk") %user.username
return render_to_response('status.html', {'status': status, 'inactive': True},
context_instance=RequestContext(request))
except UserProfile.DoesNotExist:
form = UserProfileForm()
form.fields['user'] = forms.ModelChoiceField(queryset=User.objects.filter(pk=user.pk), empty_label=None)
nomail = False
if not user.email:
nomail = True
form.fields['email'] = forms.CharField()
else:
form.fields['email'] = forms.CharField(initial = user.email)
form.fields['institution'] = forms.ModelChoiceField(queryset=Institution.objects.all(), empty_label=None)
return render_to_response('registration/select_institution.html', {'form': form, 'nomail': nomail}, context_instance=RequestContext(request))
return wrap
\ No newline at end of file
......@@ -27,7 +27,9 @@ class InstRealmMonForm(forms.ModelForm):
model = InstRealmMon
class UserProfileForm(forms.ModelForm):
email = forms.EmailField(required=True)
class Meta:
model = UserProfile
......@@ -67,12 +69,12 @@ class InstServerForm(forms.ModelForm):
else:
raise forms.ValidationError('This field is required.')
def clean_port(self):
port = self.cleaned_data['port']
def clean_auth_port(self):
auth_port = self.cleaned_data['auth_port']
institution = self.cleaned_data['instid']
if institution.ertype in [1,3]:
if port:
return self.cleaned_data["port"]
if auth_port:
return self.cleaned_data["auth_port"]
else:
raise forms.ValidationError(_('This field is required.'))
......@@ -84,34 +86,29 @@ class InstServerForm(forms.ModelForm):
return self.cleaned_data["acct_port"]
else:
raise forms.ValidationError(_('This field is required.'))
def clean_timeout(self):
timeout = self.cleaned_data['timeout']
institution = self.cleaned_data['instid']
if institution.ertype in [1,3]:
if timeout:
return self.cleaned_data["timeout"]
else:
raise forms.ValidationError(_('This field is required.'))
def clean_retry(self):
retry = self.cleaned_data['retry']
def clean_rad_pkt_type(self):
rad_pkt_type = self.cleaned_data['rad_pkt_type']
institution = self.cleaned_data['instid']
if institution.ertype in [1,3]:
if retry:
return self.cleaned_data["retry"]
if rad_pkt_type:
return self.cleaned_data["rad_pkt_type"]
else:
raise forms.ValidationError(_('This field is required.'))
def clean_host(self):
host = self.cleaned_data['host']
addr_type = self.cleaned_data['addr_type']
if host:
match = re.match(FQDN_RE, host)
if not match:
print "not match"
try:
address = ipaddr.IPNetwork(host)
if addr_type == 'any':
address = ipaddr.IPAddress(host)
if addr_type == 'ipv4':
address = ipaddr.IPv4Address(host)
if addr_type == 'ipv6':
address = ipaddr.IPv6Address(host)
except Exception:
error_text = _('Invalid network address/hostname format')
raise forms.ValidationError(error_text)
......@@ -129,6 +126,17 @@ class InstRealmForm(forms.ModelForm):
class Meta:
model = InstRealm
def clean_proxyto(self):
proxied_servers = self.cleaned_data['proxyto']
if proxied_servers:
for server in proxied_servers:
if server.ertype not in [1,3]:
error_text = _('Only IdP and IdP/SP server types are allowed')
raise forms.ValidationError(error_text)
else:
raise forms.ValidationError(_('This field is required.'))
return self.cleaned_data["proxyto"]
class ServiceLocForm(forms.ModelForm):
......
# -*- coding: utf-8 -*- vim:encoding=utf-8:
# vim: tabstop=4:shiftwidth=4:softtabstop=4:expandtab
import warnings
warnings.simplefilter("ignore", DeprecationWarning)
from django.core.management.base import BaseCommand, CommandError
import time
from django.conf import settings
......
# -*- coding: utf-8 -*- vim:fileencoding=utf-8:
# vim: tabstop=4:shiftwidth=4:softtabstop=4:expandtab
# Copyright © 2010-2012 Greek Research and Technology Network (GRNET S.A.)
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
'''
Django management command to import a CSV
'''
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from edumanage.models import InstRealmMon, MonLocalAuthnParam, InstRealm
import sys
import csv
import re
class Command(BaseCommand):
'''
Django management command to import a CSV
'''
help = 'Loads a specific CSV to eduroam models'
args = '<file>'
label = 'file name to be imported'
def handle(self, *args, **options):
'''
Handle command
'''
if args is None or len(args) != 1:
raise CommandError('You must supply a file name')
try:
csvname = sys.argv[2]
except IndexError:
print _('Error in usage. See help')
sys.exit(1)
count = 0
with open(csvname, 'rb') as f:
reader = csv.reader(f)
for row in reader:
print row
(username, password, timeout, port, method, eaptype, eap2type) = row[:7]
realm = username.split('@')[1]
try:
instrealm = InstRealm.objects.get(realm=realm)
instrealmmon = InstRealmMon(realm=instrealm, mon_type='localauthn')
instrealmmon.save()
monlocalauthnparams = MonLocalAuthnParam(
instrealmmonid = instrealmmon,
eap_method = eaptype,
phase2 = eap2type,
username = username,
passwp = password)
monlocalauthnparams.save()
except InstRealm.DoesNotExist:
print "Realm %s does not exit" % realm
print 'OK: realm %s' % ( realm )
count +=1
print 'Total ' + str(count)
# encoding: 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):
# Changing field 'MonProxybackClient.secret'