yourcelf / btb

Codebase that powers Between the Bars, a blogging platform for people in prison. Splitting/parsing/publishing PDFs, managing paper correspondence.
http://betweenthebars.org
GNU Affero General Public License v3.0
13 stars 5 forks source link

Stats doesn't seem to wok in dev mode (sqlite falls short ?) Exception Value: no such function: DATE_TRUNC #17

Closed arthurlutz closed 9 years ago

arthurlutz commented 12 years ago

On http://localhost:8000/moderation/stats/

Traceback: File "/home/arthur/local/virtualenvs/btb/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1. response = callback(request, _callback_args, *_callback_kwargs) File "/home/arthur/local/virtualenvs/btb/local/lib/python2.7/site-packages/django/contrib/auth/decorators .py" in _wrapped_view
  2. return view_func(request, _args, *_kwargs) File "/home/arthur/local/btb/scanblog/moderation/views.py" in stats
  3. 'waitlist': list(_date_aggregate(Profile.objects.bloggers(), 'date_joined')), File "/home/arthur/local/virtualenvs/btb/local/lib/python2.7/site-packages/django/db/models/query.py" in len
  4. self._result_cache.extend(self._iter) File "/home/arthur/local/virtualenvs/btb/local/lib/python2.7/site-packages/django/db/models/query.py" in iterator
  5. for row in self.query.get_compiler(self.db).results_iter(): File "/home/arthur/local/virtualenvs/btb/local/lib/python2.7/site-packages/django/db/models/sql/compiler. py" in results_iter
  6. for rows in self.execute_sql(MULTI): File "/home/arthur/local/virtualenvs/btb/local/lib/python2.7/site-packages/django/db/models/sql/compiler. py" in execute_sql
  7. cursor.execute(sql, params) File "/home/arthur/local/virtualenvs/btb/local/lib/python2.7/site-packages/django/db/backends/util.py" in execute
  8. return self.cursor.execute(sql, params) File "/home/arthur/local/virtualenvs/btb/local/lib/python2.7/site-packages/django/db/backends/sqlite3/bas e.py" in execute
  9. return Database.Cursor.execute(self, query, params)

Exception Type: DatabaseError at /moderation/stats/ Exception Value: no such function: DATE_TRUNC

yourcelf commented 9 years ago

Yes, right now it looks like we need to use postgres even on dev.