aldryn / aldryn-blog

aldryn-blog IS DEPRECATED. PLEASE USE aldryn-newsblog!
Other
20 stars 35 forks source link

Can not add Latest Blog Entries plugin, crashes on "save" and is created empty #49

Open neaai opened 10 years ago

neaai commented 10 years ago

I have tried this several times and in different installations. How I replicate this everytime with the same results is like this:

  1. Create a virtual environment and activate it.
  2. Install 'djangocms-installer' via pip.
  3. Run 'djangocms' to create a demo project. sqlite database, bootstrap and demo homepage selected.
  4. Install aldryn-blog via pip. Add the relevant for it to INSTALLED_APPS and then perform "manage syncdb" and also "manage migrate".
  5. Create a page which is then connected to the Blog App. Add 2-3 blog posts for testing.
  6. Add a plugin "Latest blog Entries" somewhere in the pages at the 'content' section. When selecting "save", there is an error message: "Share this trace at a public site" but which disappears after one second and I am returned to 'structure' mode of the page. I can actually see the Latest Blog Entries plugin where I was to place it, but it is non functional and it shows the word . There are no messages at all generated at the console where I have launched "manage runserver".

I tried this also (but I don't know if this is related to the above):

  1. Opened a django shell via "manage shell".
  2. Issued: >>> from aldryn_blog.models import LatestEntriesPlugin
  3. Issued: >>> LatestEntriesPlugin.objects.all()

I got the following error lines:

Traceback (most recent call last): File "", line 1, in File "/usr/local/marvian/lessons/zarfi/env_zarfi/local/lib/python2.7/site-packages/django/db/models/query.py", line 71, in repr data = list(self[:REPR_OUTPUT_SIZE + 1]) File "/usr/local/marvian/lessons/zarfi/env_zarfi/local/lib/python2.7/site-packages/django/db/models/query.py", line 96, in iter self._fetch_all() File "/usr/local/marvian/lessons/zarfi/env_zarfi/local/lib/python2.7/site-packages/django/db/models/query.py", line 854, in _fetch_all self._result_cache = list(self.iterator()) File "/usr/local/marvian/lessons/zarfi/env_zarfi/local/lib/python2.7/site-packages/django/db/models/query.py", line 220, in iterator for row in compiler.results_iter(): File "/usr/local/marvian/lessons/zarfi/env_zarfi/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 709, in results_iter for rows in self.execute_sql(MULTI): File "/usr/local/marvian/lessons/zarfi/env_zarfi/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 782, in execute_sql cursor.execute(sql, params) File "/usr/local/marvian/lessons/zarfi/env_zarfi/local/lib/python2.7/site-packages/django/db/backends/util.py", line 69, in execute return super(CursorDebugWrapper, self).execute(sql, params) File "/usr/local/marvian/lessons/zarfi/env_zarfi/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute return self.cursor.execute(sql, params) File "/usr/local/marvian/lessons/zarfi/env_zarfi/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in exit six.reraise(dj_exc_type, dj_exc_value, traceback) File "/usr/local/marvian/lessons/zarfi/env_zarfi/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute return self.cursor.execute(sql, params) File "/usr/local/marvian/lessons/zarfi/env_zarfi/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 450, in execute return Database.Cursor.execute(self, query, params) OperationalError: no such table: aldryn_blog_latestentriesplugin

I hope this helps. Regards.

mkoistinen commented 10 years ago

@neaai I too have run into this issue. The way the authors have chosen to implement this plugin, it will fail with stock installs with SQLite or MySQL. However, for MySQL, you can fix this issue by installing Time Zone Support into the database server. See here for a blog post I've found useful in addressing this: http://www.larryullman.com/2011/05/27/utc-and-time-zone-support-in-mysql/

Once you've installed TZ support in MySQL, it works like a champ. I don't know if it is possible to fix SQLite to work with this plugin, sorry.

neaai commented 10 years ago

@mkoistinen I tried to change the database from sqlite to mysql and followed the article mentioned to check and provide TimeZone support into the database server. Switching to mysql and adding timezone support, did not make a difference for me, still the "latest entries plugin" is created empty and broken. I will verify again whether I properly installed the timezone support into mysql, but on the other hand, the plugin was working two weeks ago, more or less, and I was using sqlite for the tests at the time.

Thank you and regards.

neaai commented 10 years ago

More on this issue, If one uses Django 1.5.5 then this trouble is not there. When one uses Django 1.6 then there is the mentioned behaviour. I have also tried with Django 1.7b and the situation is the same as with 1.6. so in all, of all these tests that I have been able to perform, the combination for full functionality discussed, is achieved by:
Django-1.5.5 + CMS-3.0 + aldryn-blog-0.3.7

The database used in the tests was sqlite, unchanged from what the cms installer put there initially. I hope this to be of help. Thank you and regards.

temaput commented 10 years ago

The troublemaker is line 136 in models.py Adding from future import unicode_literals was enough for me to make it work