Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added migration

Added manage.py helper
Version 0.2
  • Loading branch information...
commit 896f36a438ebe2d9192a24e0842ff75a435a7f86 1 parent 91e06d6
@ojii ojii authored
View
36 manage.py
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+from django.conf.urls.defaults import patterns
+from django.core.management import execute_manager
+
+urlpatterns = patterns('',
+)
+
+INSTALLED_APPS = [
+ 'django.contrib.contenttypes',
+ 'django.contrib.auth',
+ 'django.contrib.sessions',
+ 'django.contrib.admin',
+ 'simple_sso.sso_server',
+ 'simple_sso',
+ 'south',
+]
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': ':memory:',
+ }
+}
+
+ROOT_URLCONF = 'manage'
+
+if __name__ == "__main__":
+ from django.conf import settings
+ settings.configure(
+ INSTALLED_APPS = INSTALLED_APPS,
+ ROOT_URLCONF = ROOT_URLCONF,
+ DATABASES = DATABASES,
+ TEST_RUNNER = 'django.test.simple.DjangoTestSuiteRunner',
+ SIMPLE_SSO_SERVER = '/server/',
+ )
+ execute_manager(settings)
View
2  setup.py
@@ -25,7 +25,7 @@
url='http://github.com/ojii/django-simple-sso',
license='BSD',
packages=['simple_sso', 'simple_sso.sso_client', 'simple_sso.sso_server'],
- install_requires=['Django>=1.3', 'django-load', 'requests'],
+ install_requires=['Django>=1.3', 'django-load', 'requests', 'south'],
include_package_data=True,
zip_safe=False
)
View
2  simple_sso/__init__.py
@@ -1 +1 @@
-__version__ = '0.1'
+__version__ = '0.2'
View
94 simple_sso/sso_server/migrations/0001_initial.py
@@ -0,0 +1,94 @@
+# 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 model 'Client'
+ db.create_table('sso_server_client', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('secret', self.gf('django.db.models.fields.CharField')(unique=True, max_length=64)),
+ ('key', self.gf('django.db.models.fields.CharField')(unique=True, max_length=64)),
+ ('root_url', self.gf('django.db.models.fields.URLField')(max_length=200)),
+ ))
+ db.send_create_signal('sso_server', ['Client'])
+
+ # Adding model 'Token'
+ db.create_table('sso_server_token', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('client', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['sso_server.Client'])),
+ ('request_token', self.gf('django.db.models.fields.CharField')(unique=True, max_length=64)),
+ ('auth_token', self.gf('django.db.models.fields.CharField')(unique=True, max_length=64)),
+ ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)),
+ ))
+ db.send_create_signal('sso_server', ['Token'])
+
+
+ def backwards(self, orm):
+
+ # Deleting model 'Client'
+ db.delete_table('sso_server_client')
+
+ # Deleting model 'Token'
+ db.delete_table('sso_server_token')
+
+
+ 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'})
+ },
+ 'sso_server.client': {
+ 'Meta': {'object_name': 'Client'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}),
+ 'root_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
+ 'secret': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'})
+ },
+ 'sso_server.token': {
+ 'Meta': {'object_name': 'Token'},
+ 'auth_token': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}),
+ 'client': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sso_server.Client']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'request_token': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'})
+ }
+ }
+
+ complete_apps = ['sso_server']
View
0  simple_sso/sso_server/migrations/__init__.py
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.