Django: no such table: django_session

no such table: django_session heroku
no such table error in django
django.db.utils.operationalerror: no such table: auth_user
django/db/utils operationalerror no such table: django_content_type
operationalerror exception value: no such table: django_session
attributeerror: 'sessionstore' object has no attribute '_session_cache'
django create superuser
operationalerror at /admin/

I have found several topics with this title, but none of their solutions worked for me. I have two Django sites running on my server, both through Apache using different virtualhosts on two ports fed by my Nginx frontend (using for static files). One site uses MySql and runs just fine. The other uses Sqlite3 and gets the error in the title.

I downloaded a copy of sqlite.exe and looked at the mysite.sqlite3 (SQLite database in this directory) file and there is indeed a django_session table with valid data in it. I have the sqlite.exe in my system32 as well as the site-packages folder in my Python path.

Here is a section of my settings.py file:

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'mysite.sqlite3',         # Or path to database file if using sqlite3.
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}

I did use the python manage.py syncdb with no errors and just a "No Fixtures" comment.

Does anyone have any ideas what else might be going on here? I'm considering just transferring everything over to my old pal MySql and just ignoring Sqlite, as really it's always given me some kind of trouble. I was only using it for the benefit of knowing it anyway. I have no overwhelming reason why I should use it. But again, just for my edification does anyone know what this problem is? I don't like to give up.


It could be that the server uses a different working directory than the manage.py command. Since you provide a relative path to the sqlite database, it is created in the working directory. Try it with an absolute path, e.g.:

'NAME': '/tmp/mysite.sqlite3',

Remember that you have to either run ./manage.py syncdb again or copy your current database with the existing tables to /tmp.

If it resolves the error message, you can look for a better place than /tmp :-)

Why "no such table: django_session" when trying to use admin , __file__: " + __file__ print "ROOT: " + ROOT import django print "django.__path​__: " print (django.__path__) # Contact for error messages etc. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more Why “no such table: django_session” when trying to use admin?


After made any changes in code, run the following commands

manage.py makemigrations
manage.py migrate

it worked for me.

no such table: django_session : Forums : PythonAnywhere, I moved the project to your hosting, but the browser displays the following error message: no such table: django_session. I tried to register the  Basically, the error message is “no such table: django_session”. Basically, the error message informing that there is no table with the name of ‘django_session’. In order to solve the error, the solution is very simple. Just execute the command for migrating the model definition of the Django-based web application.


In case it helps anyone else: the problem for me was that I didn't have the django.contrib.sessions app uncommented in my INSTALLED_APPS. Uncommenting it, and rerunning a syncdb did the trick.

#22701 ('no such table: django_session' with python 3 in os x , OperationalError: no such table: django_session. The above exception was the direct cause of the following exception: Traceback (most recent  Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more Django: MySQL no such table: aidata.django_session


In my case the problem was that I forgot to run manage.py syncdb after I made some changes. When I did that the problem was solved.

no such table: django_session when doing the tutorial, no such table: django_session when doing the tutorial im using python 2.6, django 1.1, eclipse3.4, and pydev 1.6, macbook pro mac os  django.db.utils.OperationalError: no such table: django_session [25/May/2014 14:52:17] "GET / HTTP/1.1" 500 59 Django: Ticket #22701: 'no such table: django_session' with python 3 in os x mavericks status changed from new to closed


run this in command shell:

python manage.py migrate

This fixed for me.

Django: no such table: django_session, Podría ser que el servidor utilice un directorio de trabajo diferente que el comando manage.py . Como usted proporciona una ruta relativa a la base de datos  I'm building a fairly simple application, research, in my Django project that uses Django-CMS. (It's my first ground-up attempt at a project/application.) It's main purpose is to store various


django.db.utils.OperationalError: no such table, django.db.utils.OperationalError: no such table: layer_classification_classificationmethod #121. Open. didaRo opened this issue on Feb 15,  no such table: homework_pupil_assignments after reading this I realised this could be due to django not updating changes to my models as when I do manage.py sqlall homework I see the following:


Django: no such table: django_session, I downloaded a copy of sqlite.exe and looked at the mysite.sqlite3 (SQLite database in this directory) file and there is indeed a django_session table with valid data 


[Django Rest Framework] OperationalError at /api/ no such table , Error: OperationalError at /api/ no such table: django_session. If you want to follow along this blog and want to know how this error has