jrief / djangocms-cascade

Build Single Page Applications using the Django-CMS plugin system
MIT License
165 stars 85 forks source link

Relation cmsplugin_cascade_segmentation does not exist #167

Closed ramonwenger closed 8 years ago

ramonwenger commented 8 years ago

When I'm trying to do a data dump via python manage.py dumpdata I get an error message saying

CommandError: Unable to serialize database: relation "cmsplugin_cascade_segmentation" does not exist LINE 1: SELECT "cmsplugin_cascade_segmentation"."id" FROM "cmsplugin...

I cannot find any reference to this relation anywhere in the migrations of the plugin. Did I mess up the installation of the module, or might this be a bug?

This is on version 0.8.4 of the plugin.

ramonwenger commented 8 years ago

Yeah, disregard that, I just found out that I might be stupid.

javcasas commented 8 years ago

Hi @DonHaron , I'm having this problem right now. What did you do to fix it?

jrief commented 8 years ago

When I dump fixtures, I use --exclude cmsplugin_cascade.segmentation. This is because the segmentation model is a faked model.

ramonwenger commented 8 years ago

@javcasas If memory serves right I found out that I did not migrate the plugin correctly. I think I reset the migrations for the plugin, and went through them one by one. The ones that already were in the database, I 'faked'. After all migrations were applied, everything worked since.

But @jrief's solution probably is better :)

javcasas commented 8 years ago

@jrief @DonHaron Thank you very much. I didn't know about faked modules, no wonder I couldn't migrate or back them up properly.

fabiancastano commented 7 years ago

Dear sirs, I have good results trying with explanation of mr jrief.

Mr Jrief is a master on Django-Shop.

I have a docker django-shop "i18n_polymorphic" , changed my seting file and put on postgres.

  1. have file setting with sqllite, and dumpdata with --exclude cmsplugin_cascade.segmentation.

  2. ./manager migrate and load data with laoddata json file.

¿why not migrate home page: example inside docker?

All is fine with all data, But only error when all migrated data is that webpage "HOME" dont show, following error show when I try to access localhost:9001/en/

Excuse my einglish. All another pages operate good.

django-shop log:

[2017-06-16 02:01:16,963 exception] ERROR: Internal Server Error: /en/ Traceback (most recent call last): File "/usr/lib/python3.5/site-packages/django/core/handlers/exception.py", line 39, in inner response = get_response(request) File "/usr/lib/python3.5/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response response = self._get_response(request) File "/usr/lib/python3.5/site-packages/django/core/handlers/base.py", line 217, in _get_response response = self.process_exception_by_middleware(e, request) File "/usr/lib/python3.5/site-packages/django/core/handlers/base.py", line 215, in _get_response response = response.render() File "/usr/lib/python3.5/site-packages/django/template/response.py", line 109, in render self.content = self.rendered_content File "/usr/lib/python3.5/site-packages/django/template/response.py", line 86, in rendered_content content = template.render(context, self._request) File "/usr/lib/python3.5/site-packages/django/template/backends/django.py", line 66, in render return self.template.render(context) File "/usr/lib/python3.5/site-packages/django/template/base.py", line 208, in render return self._render(context) File "/usr/lib/python3.5/site-packages/django/template/base.py", line 199, in _render return self.nodelist.render(context) File "/usr/lib/python3.5/site-packages/django/template/base.py", line 994, in render bit = node.render_annotated(context) File "/usr/lib/python3.5/site-packages/django/template/base.py", line 961, in render_annotated return self.render(context) File "/usr/lib/python3.5/site-packages/django/template/loader_tags.py", line 174, in render return compiled_parent._render(context) File "/usr/lib/python3.5/site-packages/django/template/base.py", line 199, in _render return self.nodelist.render(context) File "/usr/lib/python3.5/site-packages/django/template/base.py", line 994, in render bit = node.render_annotated(context) File "/usr/lib/python3.5/site-packages/django/template/base.py", line 961, in render_annotated return self.render(context) File "/usr/lib/python3.5/site-packages/classytags/core.py", line 153, in render return self.render_tag(context, kwargs) File "/usr/lib/python3.5/site-packages/sekizai/templatetags/sekizai_tags.py", line 93, in render_tag rendered_contents = nodelist.render(context) File "/usr/lib/python3.5/site-packages/django/template/base.py", line 994, in render bit = node.render_annotated(context) File "/usr/lib/python3.5/site-packages/django/template/base.py", line 961, in render_annotated return self.render(context) File "/usr/lib/python3.5/site-packages/classytags/core.py", line 153, in render return self.render_tag(context, kwargs) File "/usr/lib/python3.5/site-packages/cms/templatetags/cms_tags.py", line 487, in render_tag rendered_contents = nodelist.render(context) File "/usr/lib/python3.5/site-packages/django/template/base.py", line 994, in render bit = node.render_annotated(context) File "/usr/lib/python3.5/site-packages/django/template/base.py", line 961, in render_annotated return self.render(context) File "/usr/lib/python3.5/site-packages/django/template/loader_tags.py", line 70, in render result = block.nodelist.render(context) File "/usr/lib/python3.5/site-packages/django/template/base.py", line 994, in render bit = node.render_annotated(context) File "/usr/lib/python3.5/site-packages/django/template/base.py", line 961, in render_annotated return self.render(context) File "/usr/lib/python3.5/site-packages/classytags/core.py", line 153, in render return self.render_tag(context, **kwargs) File "/usr/lib/python3.5/site-packages/cms/templatetags/cms_tags.py", line 220, in render_tag nodelist=nodelist, File "/usr/lib/python3.5/site-packages/cms/plugin_rendering.py", line 266, in render_page_placeholder nodelist=nodelist, File "/usr/lib/python3.5/site-packages/cms/plugin_rendering.py", line 499, in _render_page_placeholder nodelist=nodelist, File "/usr/lib/python3.5/site-packages/cms/plugin_rendering.py", line 205, in render_placeholder placeholder_content = ''.join(plugin_content) File "/usr/lib/python3.5/site-packages/cms/plugin_rendering.py", line 432, in render_plugins yield self.render_plugin(plugin, context, placeholder, editable) File "/usr/lib/python3.5/site-packages/cms/plugin_rendering.py", line 341, in render_plugin context = plugin.render(context, instance, placeholder.slot) File "/usr/lib/python3.5/site-packages/cmsplugin_cascade/bootstrap3/jumbotron.py", line 182, in render elements = get_picture_elements(context, instance) File "/usr/lib/python3.5/site-packages/cmsplugin_cascade/bootstrap3/utils.py", line 185, in get_picture_elements aspect_ratio = compute_aspect_ratio(instance.image) File "/usr/lib/python3.5/site-packages/cmsplugin_cascade/bootstrap3/utils.py", line 93, in compute_aspect_ratio return float(image.height) / float(image.width) ZeroDivisionError: float division by zero [pid: 73|app: 0|req: 34/55] 172.17.0.1 () {38 vars in 816 bytes} [Fri Jun 16 02:00:43 2017] GET /en/ => generated 27 bytes in 33179 msecs (HTTP/1.1 500) 7 headers in 402 bytes (1 switches on core 0)

jrief commented 7 years ago

@fabiancastano This ZeroDivisionError is caused by a bug in django-filer, which has been fixed in https://github.com/divio/django-filer/pull/970 and shall be released in version 1.2.8. Unfortunately the maintainers of django-filer did not push a new version on PyPI yet, so feel free to remind them.

As a workaround django-shop is shipped with a management command ./manage.py fix_filer_bug_965, which hopefully will be obsolete soon.

fabiancastano commented 7 years ago

Mr. @jrief Let me tell you again thanks. I have fixed it with ./manage.py fix_filer_bug_965.

Last days, we chose way of modify a docker instead of create a virtual env plataform. And way to modifying django-shop more quicky. I will use Postgres.

I will put this one on IBM docker, and too we will do a app for OS: android and ios done on framework called ionic 3.

¿Can you recoment us any way to integrate app do in this framework (ionic 3 same core of phonegap) to use autentication to django-shop and put more secure information using rest framework for example?. ¿ any idea?. any sample.

I have two groups of developper work same time that can not see between they, but I help to integrate development beetween those groups, I help to get more pure python django-shop tecnology inside project, and avoid another api and others framework diferent and keep security.

Best regards, Mr. @jrief, you are a gentleman

jrief commented 7 years ago

@fabiancastano Unfortunately I don't have any experience with native mobile app development yet, therefore I can not recommend any framework or interface howtos. Something I would definitely look at is BeeWare which is a native (unlike Kywi) implementation for mobile applications written in Python for both iOS and Android.

fabiancastano commented 7 years ago

Hello Mr. @jrief: Thank you very much for your response. I'm working on finding how to integrate django-shop with three-part applications, do API or api access that exist with the framework REST.

I can found that you and your team are making it easy with the rest framework, like views and rest framework serializer class or method for django-shop.

Problem:

We need to access others methods like add, delete, update of the product, ¿are these ready like views are ready of productcatalog of django-shop?: info say "15.2. Every URL is a REST endpoint"

  1. ¿how we can post a Product polimorphy way REST framework?, like others function pre estableshed like AddSmartPhoneToCartSerializer for example but for publicate a new product.

Now only can see: rest framework onlye Allow GET, HEAD, OPTIONS. (?format=api)

With REST framework How can get or show (serialized and json) all cms pages (id of page and name) to assign when I post a product (by REST) and set all or some of these with the api way REST?.

We need to accessl all funtionality with REST Framework: like "Post_office" and add, delete, update products for example.

Thanks again.

jrief commented 7 years ago

how we can post a Product polymorphic way REST framework?

this is the issue tracker for djangocms-cascade, not django-shop. Please ask questions on stackoverflow

racitup commented 7 years ago

I think the python manage.py dumpdata --exclude cmsplugin_cascade.segmentation .. solution should be added to the README or documentation as a known issue.