Newbie operational error with Django db tables

152 views
Skip to first unread message

Mr. crazy

unread,
Nov 6, 2014, 6:54:41 AM11/6/14
to django...@googlegroups.com
Hello,

I'm working in a project where I use DionaeaFR to visualize my data collected by Dionaea and the tutorial I followed uses Django Framework.

Later I go and try to access the DionaeaFR graphs through my web browser, However instead of seeing my graphs I see error "Operational error"  :'(

I searched online to look up for an answer on my issue bu I failed maybe due to my knowledge being not very deep in this matter 

here goes the traceback of the error :

Environment:


Request Method: GET

Django Version: 1.7.1
Python Version: 2.7.6
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'compressor',
 'django_tables2',
 'django_tables2_simplefilter',
 'pagination',
 'django.contrib.humanize',
 'Web')
Installed Middleware:
('django.middleware.gzip.GZipMiddleware',
 'htmlmin.middleware.HtmlMinifyMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'pagination.middleware.PaginationMiddleware')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  98.                 resolver_match = resolver.resolve(request.path_info)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in resolve
  343.             for pattern in self.url_patterns:
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in url_patterns
  372.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in urlconf_module
  366.             self._urlconf_module = import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/__init__.py" in import_module
  37.     __import__(name)
File "/opt/DionaeaFR/DionaeaFR/urls.py" in <module>
  5. from Web.views.download import downloadIndex
File "/opt/DionaeaFR/Web/views/download.py" in <module>
  11. length = len(Download.objects.all())
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in __len__
  122.         self._fetch_all()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in _fetch_all
  966.             self._result_cache = list(self.iterator())
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in iterator
  265.         for row in compiler.results_iter():
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py" in results_iter
  700.         for rows in self.execute_sql(MULTI):
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py" in execute_sql
  786.             cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py" in execute
  81.             return super(CursorDebugWrapper, self).execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py" in execute
  65.                 return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py" in __exit__
  94.                 six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py" in execute
  65.                 return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py" in execute
  485.         return Database.Cursor.execute(self, query, params)

Exception Type: OperationalError at /
Exception Value: no such table: downloads


I decided to drop a post here and hopefully you folks can help me, this is my course's final project and I have to finish it pretty soon.

Thanx dudes

Avraham Serour

unread,
Nov 6, 2014, 1:04:05 PM11/6/14
to django...@googlegroups.com
it looks like django is trying to access a table named downloads which doesn't seems to exists in the db

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/152a29ac-afd6-4177-95d2-3c3378b191d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mr. crazy

unread,
Nov 6, 2014, 2:31:08 PM11/6/14
to django...@googlegroups.com
well,

That is totally true.This is the problem which I need to find it's solution.
Do I have to make the table?? How?
I looked for the DB tables and I didn't  find it-Maybe I did not searched the correct place 

I need help 

donarb

unread,
Nov 6, 2014, 4:55:37 PM11/6/14
to django...@googlegroups.com
Have you followed the Django documentation for creating tables? You need to run syncdb in order for django to create all the tables for your app. 

Adailton Nascimento

unread,
Nov 6, 2014, 5:31:44 PM11/6/14
to django...@googlegroups.com
Mr.crazy

whenever you add content to the model or form run syncdb will have to be added to the database.

or

delete your database, and run: python manage.py syncdb

Mr. crazy

unread,
Nov 7, 2014, 2:52:40 AM11/7/14
to django...@googlegroups.com
well, as I asid in my question I'm following at tutorial on the installation steps of my visualization tool, it does not sat anything about tables creation I have also checked the tool in github but I can't see anything there. and if I want to build the table my self I don't know what fields should it have. if any of you have installed DionaeaFR I guess he/she have something to share with me 

thanx

Adailton Nascimento

unread,
Nov 7, 2014, 11:14:09 AM11/7/14
to django...@googlegroups.com
The error that is giving and following this saying in your settings.py in APPS not contain the "downloads" or if you already have to add it only in the database, delete your database and run the shell [1].

or just run the command in the shell [1] I believe that updates the database without having to delete it.

[2] this by saying that there is not a table in your database, then you have to add it in settings.py and run the command, the error's there.

If the error persists, place your project in git so we can take a look deeper.

[1] python manage.py syncdb

[2] ( Exception Value: no such table: downloads )

Mr. crazy

unread,
Nov 7, 2014, 5:11:47 PM11/7/14
to django...@googlegroups.com
I have executed [1] and tried again but no luck, the issues persists

I know that "downloads" table is missing yet I didn't in DionaraFR guithub anything regarding that table. That what specifically makes me wonder if I have to build that missing table, what would I have to name its fields, 

Collin Anderson

unread,
Nov 12, 2014, 9:02:21 PM11/12/14
to django...@googlegroups.com
Hello,

Very interesting. I wonder if the model isn't being noticed in syncdb because it's in models/downloads.py, and it's not referenced in models/__init__.py.

Collin

Reply all
Reply to author
Forward
0 new messages