Database Error At /admin/ No Such Table Django_session
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us django.db.utils.operationalerror: no such table: django_session Learn more about Stack Overflow the company Business Learn more about hiring developers or
Table Django_session Doesn T Exist
posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow heroku no such table django_session Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Django: MySQL no such table: aidata.django_session up vote 7
Django_session Does Not Exist
down vote favorite 1 I'm running Django 1.4 on Windows 7 in Pycharm and I installed WAMP because I need to have my data in a MySQL table. This is from setting.py DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'aidata', 'USER': 'root' } } From installed_apps I uncommented: 'django.contrib.sessions' Running manage.py syncdb does not create any tables ( even models) in my mysqldb. I get the graphite no such table: account_profile error when trying to acces /admin/ DatabaseError at /admin/ (1146, "Table 'aidata.django_session' doesn't exist") django django-models share|improve this question edited May 9 '12 at 12:29 okm 16.6k44765 asked May 9 '12 at 12:11 GaberSetina 15218 What's the output from syncdb? –santiagobasulto May 9 '12 at 12:32 what does your settings.INSTALLED_APPS look like, too? And if you're using South, what does ./manage.py migrate --list show? –Steve Jalim May 9 '12 at 13:03 snycdb outputs Creating tables ... Installing cutom SQL Installing indexes ... No fixures found –GaberSetina May 9 '12 at 14:31 INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'intq', #my app name 'django.contrib.admin', ) –GaberSetina May 9 '12 at 14:45 add a comment| 2 Answers 2 active oldest votes up vote 4 down vote accepted Double check the db credentials make sure you uncommented this line in your middleware: MIDDLEWARE_CLASSES = ( .... 'django.contrib.sessions.middleware.SessionMiddleware', ) then try to python manage.py syncdb. if you are still having issues post any output EDIT -- NEXT CHECK: do you have a "django_content_type" table? if so, does that table have a "session" record? if so, delete the session record and try to python manage.py sync
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or
Operationalerror: No Such Table: Account_profile
posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
Django Operationalerror No Such Table
Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only graphite operationalerror: no such table: account_profile takes a minute: Sign up Django: no such table: django_session when using with postgres up vote 1 down vote favorite I'm building a blog with Django and I have configured my server with nginx and uwsgi. Everything works fine on http://stackoverflow.com/questions/10515808/django-mysql-no-such-table-aidata-django-session the test server from manage.py but when I try to access it externally I get OperationalError at /admin/ no such table: django_session when I try to login to the admin console. Before this I was getting a similiar error but with auth_user instead of django_session. I have configured the server using postgres and when I log in using the blogs user to the database all the tables appear to be there. I noticed this line on the error page /srv/blogenv/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py which http://stackoverflow.com/questions/28095195/django-no-such-table-django-session-when-using-with-postgres I thought to be strange given that the database is in postgres. I tried running syncdb but it returned that there were unmigrated changes and performing makemigrations and migrate didn't fix the problem. python django postgresql share|improve this question asked Jan 22 '15 at 17:38 stmfunk 429214 do you have site in INSTALLED_APPS ? –karthikr Jan 22 '15 at 17:41 Well my app is called mainblog not site but it is in there yes –stmfunk Jan 22 '15 at 19:58 add a comment| 1 Answer 1 active oldest votes up vote 4 down vote accepted So I managed to solve the problem by deleting the existing database and migrating again. share|improve this answer answered Jan 22 '15 at 20:33 stmfunk 429214 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged python django postgresql or ask your own question. asked 1 year ago viewed 1938 times active 1 year ago Related 25Django: no such table: django_session2django, postgres 8.4, psycopg 2.2.2, python 2.7, mod_wsgi0Django: no such table: django_session under Apache, but works with manage.py runserver0Django: Missing tables for profiles when conv
your hosting, but the browser displays the following error message: no https://www.pythonanywhere.com/forums/topic/1814/ such table: django_session I tried to register the absolute path http://community.onemonth.com/t/heroku-is-not-ignoring-sqlite3-bombing-out-after-syncdb-in-project-3-lesson-14/3003?page=2 in the config file: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'project.db', #'NAME': os.path.join(BASE_DIR,'kinopom.project.db'), #'NAME': '/home/kinopomoika/kinopomoika/kinopom/project.db', 'HOST': 'localhost', 'USER': '', 'PASSWORD': '', 'PORT': '' } } just tried syncdb: 17:32 ~/kinopomoika (master)$ python manage.py syncdb Syncing... Creating tables ... Creating no such table django_summernote_attachment Installing custom SQL ... Installing indexes ... Installed 0 object(s) from 0 fixture(s) Synced: > djangocms_admin_style > django.contrib.auth > django.contrib.contenttypes > django.contrib.sessions > django.contrib.admin > django.contrib.sites > django.contrib.sitemaps > django.contrib.staticfiles > django.contrib.messages > mptt > south > sekizai > django_summernote > app_accounts > app_video Not synced (use migrations): - djangocms_text_ckeditor no such table - cms - menus - djangocms_style - djangocms_column - djangocms_file - djangocms_flash - djangocms_googlemap - djangocms_inherit - djangocms_link - djangocms_picture - djangocms_teaser - djangocms_video - reversion - kinopom - app_comments - app_menu (use ./manage.py migrate to migrate these) 17:35 ~/kinopomoika (master)$ python manage.py migrate Running migrations for djangocms_text_ckeditor: - Nothing to migrate. - Loading initial data for djangocms_text_ckeditor. Installed 0 object(s) from 0 fixture(s) Running migrations for cms: - Nothing to migrate. - Loading initial data for cms. Installed 0 object(s) from 0 fixture(s) Running migrations for menus: - Nothing to migrate. - Loading initial data for menus. Installed 0 object(s) from 0 fixture(s) Running migrations for djangocms_style: - Nothing to migrate. - Loading initial data for djangocms_style. Installed 0 object(s) from 0 fixture(s) Running migrations for djangocms_column: - Nothing to migrate. - Loading initial data for djangocms_column. Installed 0 object(s) from 0 fixture(s) Running migrations for djangocms_file: - Nothing to migrate. - Loa
you've done everything I have tried and copied code exactly as I have been able to get it to work, then I'm not sure. You'll have to let us see some of your code to double check. Maybe there's a syntax error or something? Check every parenthesis and every comma. Make sure your white space is all good. You say ON_HEROKU is showing up...but what is it saying? Are you seeing ON_HEROKU=1 ? jaspindersingh83 2015-04-14 05:18:46 UTC #22 @ethanrubio: Pls pass link to your Git.Also did you try what @robert had recommended for settings file: ethanrubio 2015-04-14 15:00:41 UTC #23 Hi @robert and @jaspindersingh83 My github is https://github.com/ethanrubio/coffeedapp. ON_HEROKU=1 is showing up. I've tried a lot of different things in the settings.py such as following @robert's recommended settings file, but now I'm unsure where to proceed. Thanks for all your help! jaspindersingh83 2015-04-14 17:33:25 UTC #24 Here is the bug: In your settings.py file: Replace This if ON_HEROKU == True: import dj_database_url DATABASES = {'default': dj_database_url.config()}else: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(MAIN_DIR, 'db.sqlite3'), } } by if ON_HEROKU == True: import dj_database_url DATABASES = {'default': dj_database_url.config()}else: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } After doing this change you will have to sync your databases:1)Go to terminal2) python manage.py syncdb3)heroku run python manage.py syncdb ethanrubio 2015-04-14 18:01:25 UTC #25 Hi @jaspindersingh83, I made the changes, but I still get the same error. Any other ideas? Thanks again for all your help! I really appreciate it. jaspindersingh83 2015-04-14 19:14:53 UTC #26 Can you push db.sqlite3 also to gitCan I doctor changes in your Git?Email me at jaspindersingh83@gmail.com foxan_ng 2015-04-17 10:32:30 UTC #27 For those who still get stuck after trying the above methods, you may try to implement the codes below to see if it works for you: (I tried the above methods for 2+ hours but still no luck ) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } if ON_HEROKU == '1': # Parse database configuration from $DATABASE_URL import dj_database_url DATABASES['default'] = dj_d