django-cms

How to unit test Django-CMS extensions?

倾然丶 夕夏残阳落幕 提交于 2019-12-04 00:05:26
I am trying to get some test coverage for a Django-CMS implementation I'm working on and I'm unsure how to unit test plugins/extensions. Has anyone done this before, and if so, how? Some examples would be awesome. Tests as shown by cms/tests/plugins.py is rather integration tests than unit tests, and that's quite heavy-weight and requires a sometimes too large part of the entire system up and running (not neccessary wrong, just impractical when debugging). DjangoCMS is tightly integrated so what I have here are a few techniques to get 'closer to the metal' rather than a complete solution: You

Getting “Error loading MySQLdb module: No module named MySQLdb” in django-cms

痴心易碎 提交于 2019-12-03 21:43:39
I can't connect with mysql and I can't do "python manage.py syncdb" on it how to connect with mysql in django and django-cms without any error? to connect to mysql with django sudo apt-get install git # to install git sudo apt-get install python-pip # to install pip sudo pip install Django # to install Django to your system After that you should go to project path and then execute the following command, the same path of 'manage.py' file pip install mysql-python Finally you may synchronous your database without problem python manage.py syncdb This is an error message you get if MySQLdb isn't

custom views within Djangocms?

China☆狼群 提交于 2019-12-03 16:23:23
I haven't found a satisfactory way of doing this: I have a djangocms setup that is working fine. But I need to add content from a table outside the CMS to my homepage and render that content on the template. I can do this, but editing the urls.py within CMS to use my views like so... url(r'^', 'myapp.views.slideshow_info'), ... excludes any content from CMS. I understand that I just get my custom views to accommodate what CMS' views is doing, but how do I achieve this? at the moment my app's views says: from myapp.models import model1, model2 def slideshow_info(request): return render_to

Django CMS - check if placeholder is empty

无人久伴 提交于 2019-12-03 12:55:56
I use: DjangoCMS 2.4 Django 1.5.1 Python 2.7.3 I would like to check if my placeholder is empty. <div> {% placeholder "my_placeholder" or %} {% endplaceholder %} </div> I don't want the html between the placeholder to be created if the placeholder is empty. {% if placeholder "my_placeholder" %} <div> {% placeholder "my_placeholder" or %} {% endplaceholder %} </div> {% endif %} There is no built-in way to do this at the moment in django-cms, so you have to write a custom template tag. There are some old discussions about this on the django-cms Google Group: https://groups.google.com/forum/#

Django CMS Page Title Doesn't Render

…衆ロ難τιáo~ 提交于 2019-12-03 12:47:38
I'm currently working on a project that uses django-registration and Django CMS. When display the pages that implement django-registration my page titles do not render. Currently have <title>{% page_attribute page_title %}</title> in base.html which all my templates inherit from. In the pages that do not use django-registration the titles display just fine, but django-registration display as <title></title> My pages are all created within the CMS and everything else is rendering correctly. If I set the title explicitly within the template, the title will render, but I'd rather have it set

How can I copy CMS pages from a development site to a live site?

﹥>﹥吖頭↗ 提交于 2019-12-03 09:10:36
I've been integrating Django CMS to a Django project that has been in production already for over a year. As part of my development activities, I've converted to CMS pages those pages that used to be static content before I added Django CMS. My development database now contains pages that I would like to copy to the live site rather than require that project staff recreate these pages on the live site. I have searched the Django CMS documentation but did not find a command for this. I've also searched the issues on github, the questions on SO and the Django CMS google groups. The only thing I

how to use forms in django-cms?

匆匆过客 提交于 2019-12-03 05:26:38
I am an absolute novice to django-cms. I have gone through the tutorial and configured it exactly the same as mentioned in the documentation. Now, I have to build an application which uses a form to upload products. I dont have a clue as to how to move ahead with it. I want to start it with simple forms as if now, say, a username and password textbox kind of. How can I use django forms in the django-cms page? I have snippet plugin enabled in it too. I need some guidance for this. Any suggestions plsss. thanks I've recently ran across django-form-designer It's quite nice and lets you design

How to render django-cms plugin in every page?

风流意气都作罢 提交于 2019-12-03 05:13:35
问题 I have a latest news plugin for django-cms. I want to show 5 latest news in footer. Footer placed on every page of site. How can I render this plugin on every page? 回答1: There are some template tags that should help you achieve what you are trying to do: {% placeholder "footer" inherit %} should inherit its content from pages above in the hierarchy, or you can render a place holder from another page with {% show_placeholder "footer" "home" %} you can also make a combination like {%

How to render django-cms plugin in every page?

喜你入骨 提交于 2019-12-02 19:38:37
I have a latest news plugin for django-cms. I want to show 5 latest news in footer. Footer placed on every page of site. How can I render this plugin on every page? There are some template tags that should help you achieve what you are trying to do: {% placeholder "footer" inherit %} should inherit its content from pages above in the hierarchy, or you can render a place holder from another page with {% show_placeholder "footer" "home" %} you can also make a combination like {% placeholder "footer" or %} {% show_placeholder "footer" "home" %} {% endplaceholder %} which will normally render the

How to completely dump the data for Django-CMS

时间秒杀一切 提交于 2019-12-02 16:46:43
I have an instance of Django-CMS already running in a production environment. I would like to dump all the data related to the CMS (PAGES and PLUGINS) so that I may load it back into my development environment. When I do python manage.py dumpdata cms it dumps most of the data, but not all of it. None of the content for the plugins is dumped. When I look at the django-cms source, I see that the plugins are organized in a different folder than the rest of the models - I'm sure this has something to do with the behavior of dumpdata . Does anyone know how they would achieve what I am trying to do?