ImportError: cannot import name social_auth_usersocialauth: Accessing Python social auth data in django via shell -


i getting log in data twitter. in sqlite database, following tables:

sqlite> .tables auth_group                  django_content_type        auth_group_permissions      django_migrations          auth_permission             django_session             auth_user                   social_auth_association    auth_user_groups            social_auth_code           auth_user_user_permissions  social_auth_nonce          django_admin_log            social_auth_usersocialauth 

my data saved social_auth_usersocialauth table. query table using sqlite3 shell gives me data fetched website.

1|twitter|xx|1|{"access_token": {"oauth_token_secret": "xx", "oauth_token": "xx", "x_auth_expires": "0", "user_id": "xx", "screen_name": "xx"}, "id": xx} 

now want display oauth_token_secret , oauth_token in template.

i trying run following query django shell check whether can fetch data or not. since app name social.apps.django_app.default ran following code:

>>> social.apps.django_app.default.models import social_auth_usersocialauth 

but giving

traceback (most recent call last): file "<console>", line 1, in <module> importerror: cannot import name social_auth_usersocialauth 

trying name, twitter, app name, got same thing.

there's problem in model import

is model in models.py file? if you've written match ? post models.py file , folder structure.

is app name social.apps.django_app...

typically django project structured thus

project name - app name --- models.py - app name ...

references in django shell appname.models import modelname

django name database table appname_modelname


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -