facebook - Difficulty using Django All-Auth in my own project - url/migration problems -
i'm having difficulty using django-allauth in own project, title suggests. i'm using south, new south, can source of problems. below i'll detail steps took , right now.
first, moved allauth folder root of project. then, moved example code's templates our startup app - made "plain/example/index.html" template our startup template (127.0.0.1:8000).
in our project's urls, added:
#allauth stuff: url(r'^accounts/profile/$', templateview.as_view(template_name='plain/example/profile.html')), url(r'^accounts/', include('allauth.urls')),
and project settings this:
# django settings penguin project. import os debug = true template_debug = debug admins = ( # ('your name', 'your_email@example.com'), ) managers = admins db_path = os.path.abspath(os.path.join(os.path.abspath(__file__),'..','..','..','db','peng.db')) databases = { 'default': { 'engine': 'django.db.backends.sqlite3', # add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'name': db_path,# or path database file if using sqlite3. 'user': '', # not used sqlite3. 'password': '', # not used sqlite3. 'host': '', # set empty string localhost. not used sqlite3. 'port': '', # set empty string default. not used sqlite3. } } # local time zone installation. choices can found here: # http://en.wikipedia.org/wiki/list_of_tz_zones_by_name # although not choices may available on operating systems. # in windows environment must set system time zone. time_zone = 'america/chicago' # language code installation. choices can found here: # http://www.i18nguy.com/unicode/language-identifiers.html language_code = 'en-us' site_id = 1 # if set false, django make optimizations not # load internationalization machinery. use_i18n = true # if set false, django not format dates, numbers , # calendars according current locale. use_l10n = true # if set false, django not use timezone-aware datetimes. use_tz = true # absolute filesystem path directory hold user-uploaded files. # example: "/home/media/media.lawrence.com/media/" media_root = '' # url handles media served media_root. make sure use # trailing slash. # examples: "http://media.lawrence.com/media/", "http://example.com/media/" media_url = '' # absolute path directory static files should collected to. # don't put in directory yourself; store static files # in apps' "static/" subdirectories , in staticfiles_dirs. # example: "/home/media/media.lawrence.com/static/" static_root = '' # url prefix static files. # example: "http://media.lawrence.com/static/" static_url = '/static/' # additional locations of static files staticfiles_dirs = ( # put strings here, "/home/html/static" or "c:/www/django/static". # use forward slashes, on windows. # don't forget use absolute paths, not relative paths. os.path.abspath(os.path.join(os.path.dirname(__file__),'..', '..', 'static')).replace('\\','/'), ) # list of finder classes know how find static files in # various locations. staticfiles_finders = ( 'django.contrib.staticfiles.finders.filesystemfinder', 'django.contrib.staticfiles.finders.appdirectoriesfinder', # 'django.contrib.staticfiles.finders.defaultstoragefinder', ) # make unique, , don't share anybody. secret_key = '' # list of callables know how import templates various sources. template_loaders = ( 'django.template.loaders.filesystem.loader', 'django.template.loaders.app_directories.loader', # 'django.template.loaders.eggs.loader', ) middleware_classes = ( 'django.middleware.common.commonmiddleware', 'django.contrib.sessions.middleware.sessionmiddleware', 'django.middleware.csrf.csrfviewmiddleware', 'django.contrib.auth.middleware.authenticationmiddleware', 'django.contrib.messages.middleware.messagemiddleware', # uncomment next line simple clickjacking protection: # 'django.middleware.clickjacking.xframeoptionsmiddleware', 'penguin.libs.utilities.import_middle.importxmlmiddleware', ) root_urlconf = 'penguin.urls' authentication_backends = ( "allauth.account.auth_backends.authenticationbackend", ) # python dotted path wsgi application used django's runserver. wsgi_application = 'penguin.wsgi.application' template_dirs = ( #absolute path, use / on windows os.path.abspath(os.path.join(os.path.dirname(__file__),'..','..')).replace('\\','/') ) installed_apps = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', # uncomment next line enable admin: 'django.contrib.admin', # uncomment next line enable admin documentation: # 'django.contrib.admindocs', 'penguin.apps.royal', 'penguin.apps.blackboard', 'penguin.libs.topic', 'penguin.libs.sidebar', 'penguin.libs.module', #'penguin.libs.users', 'penguin.apps.messages', 'penguin.apps.profiles', 'penguin.libs.users', 'south', 'allauth', 'allauth.account', 'allauth.socialaccount', #'allauth.socialaccount.providers.dropbox', 'allauth.socialaccount.providers.facebook', #'allauth.socialaccount.providers.google', #'allauth.socialaccount.providers.github', #'allauth.socialaccount.providers.linkedin', #'allauth.socialaccount.providers.openid', #'allauth.socialaccount.providers.persona', #'allauth.socialaccount.providers.soundcloud', #'allauth.socialaccount.providers.stackexchange', #'allauth.socialaccount.providers.twitch', #'allauth.socialaccount.providers.twitter', #'allauth.socialaccount.providers.vimeo', #'allauth.socialaccount.providers.weibo', ) template_context_processors = ( "django.contrib.auth.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", "django.core.context_processors.static", "django.core.context_processors.request", "django.contrib.messages.context_processors.messages", "allauth.account.context_processors.account", "allauth.socialaccount.context_processors.socialaccount", ) # sample logging configuration. tangible logging # performed configuration send email # site admins on every http 500 error when debug=false. # see http://docs.djangoproject.com/en/dev/topics/logging # more details on how customize logging configuration. logging = { 'version': 1, 'disable_existing_loggers': false, 'filters': { 'require_debug_false': { '()': 'django.utils.log.requiredebugfalse' } }, 'handlers': { 'mail_admins': { 'level': 'error', 'filters': ['require_debug_false'], 'class': 'django.utils.log.adminemailhandler' } }, 'loggers': { 'django.request': { 'handlers': ['mail_admins'], 'level': 'error', 'propagate': true, }, } }
i syncdb, , run project.
when try go social accounts on admin, though, i'm getting following error:
databaseerror @ /admin/socialaccount/socialaccount/ no such table: socialaccount_socialaccount
i believe problem being caused problem south. when syncdb, following response:
syncing... creating tables ... installing custom sql ... installing indexes ... installed 0 object(s) 0 fixture(s) synced: > django.contrib.auth > django.contrib.contenttypes > django.contrib.sessions > django.contrib.sites > django.contrib.messages > django.contrib.staticfiles > django.contrib.admin > penguin.apps.royal > penguin.apps.blackboard > penguin.libs.topic > penguin.libs.sidebar > penguin.libs.module > penguin.apps.messages > penguin.apps.profiles > penguin.libs.users > south > allauth > allauth.account not synced (use migrations): - allauth.socialaccount - allauth.socialaccount.providers.facebook
as new south (but have use project), don't know how solve exactly. read online do:
migrate socialaccount 0007 --fake
but after doing this, problem persists.
does know how solve problem, or causes it? if has more questions, can provide information needed.
Comments
Post a Comment