python - Addition to INSTALLED_APPS creating problems -
i've done: pip install django-oauth-toolkit python-social-auth, when add following installed_apps, , doing python manage.py makemigrations
installed_apps = ( ... 'social.apps.django_app.default', 'oauth2_provider', )
its showing me following errors:
traceback (most recent call last): file "manage.py", line 10, in <module> execute_from_command_line(sys.argv) file "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line utility.execute() file "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 377, in execute self.fetch_command(subcommand).run_from_argv(self.argv) file "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 288, in run_from_argv self.execute(*args, **options.__dict__) file "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 338, in execute output = self.handle(*args, **options) file "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 533, in handle return self.handle_noargs(**options) file "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 27, in handle_noargs call_command("migrate", **options) file "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 115, in call_command return klass.execute(*args, **defaults) file "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 338, in execute output = self.handle(*args, **options) file "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 63, in handle executor = migrationexecutor(connection, self.migration_progress_callback) file "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 17, in __init__ self.loader = migrationloader(self.connection) file "/usr/local/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 48, in __init__ self.build_graph() file "/usr/local/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 173, in build_graph self.load_disk() file "/usr/local/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 103, in load_disk migration_module = import_module("%s.%s" % (module_name, migration_name)) file "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) file "/home/apurva/.virtualenvs/auth2/local/lib/python2.7/site-packages/oauth2_provider/migrations/0002_08_updates.py", line 11, in <module> class migration(migrations.migration): file "/home/apurva/.virtualenvs/auth2/local/lib/python2.7/site-packages/oauth2_provider/migrations/0002_08_updates.py", line 28, in migration preserve_default=true, typeerror: __init__() got unexpected keyword argument 'preserve_default'
how can fix it?
my entire settings.py file:
""" django settings beerstash project. more information on file, see https://docs.djangoproject.com/en/1.7/topics/settings/ full list of settings , values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # build paths inside project this: os.path.join(base_dir, ...) import os base_dir = os.path.dirname(os.path.dirname(__file__)) # quick-start development settings - unsuitable production # see https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ # security warning: keep secret key used in production secret! secret_key = '^7syi&)&mp36m5exn9azhc*l(lp0n!pbwseaup)-tm!zdj*dwe' # security warning: don't run debug turned on in production! debug = true template_debug = true allowed_hosts = [] # application definition installed_apps = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'beers', 'social.apps.django_app.default', 'oauth2_provider', ) #new additions authentication_backends = ( 'social.backends.facebook.facebookoauth2', 'django.contrib.auth.backends.modelbackend', ) rest_framework = { 'default_authentication_classes': ( 'oauth2_provider.ext.rest_framework.oauth2authentication', ) } oauth2_provider = { # list of available scopes 'scopes': {'read': 'read scope', 'write': 'write scope'} } middleware_classes = ( 'django.contrib.sessions.middleware.sessionmiddleware', 'django.middleware.common.commonmiddleware', 'django.middleware.csrf.csrfviewmiddleware', 'django.contrib.auth.middleware.authenticationmiddleware', 'django.contrib.auth.middleware.sessionauthenticationmiddleware', 'django.contrib.messages.middleware.messagemiddleware', 'django.middleware.clickjacking.xframeoptionsmiddleware', ) root_urlconf = 'beerstash.urls' wsgi_application = 'beerstash.wsgi.application' # database # https://docs.djangoproject.com/en/1.7/ref/settings/#databases databases = { 'default': { 'engine': 'django.db.backends.sqlite3', 'name': os.path.join(base_dir, 'db.sqlite3'), } } # internationalization # https://docs.djangoproject.com/en/1.7/topics/i18n/ language_code = 'en-us' time_zone = 'utc' use_i18n = true use_l10n = true use_tz = true # static files (css, javascript, images) # https://docs.djangoproject.com/en/1.7/howto/static-files/ static_url = '/static/'
Comments
Post a Comment