django-cms

Django CMS Multi-Level Dropdown Menu

早过忘川 提交于 2019-12-05 16:43:59
Im kinda new to Django CMS and im trying my best to avoid asking, but this one drives me crazy. I made a Wiki app with a Topic, and Category model. I hooked it to a Site on my CMS and added it to my Menu. Now i would like to be able to show all Top-Level categories, their Child Categories & Topics, and the Child categories of these, and so on, on my menu. Menu/Navigation should look like this: Wiki Category1 Category1.1 Topic Category1.2 Topic Category2 Topic Category3 ... Right now i can only show the Top categories: Wiki Category1 Category2 Category3 I Already created a menu.py to get a

How to unit test Django-CMS extensions?

こ雲淡風輕ζ 提交于 2019-12-05 13:32:48
问题 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. 回答1: 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

How to integrate Django-CMS into an existing project

不打扰是莪最后的温柔 提交于 2019-12-05 11:24:20
I need to integrate Django-CMS 3.x into an existing project ( mypjc hereafter). I already checked this question (and other similar) but they point to a tutorial page that is no longer available. I'm a bit confused by the tons of infos you can find online and I have not really understood if Django-CMS can be integrated as an app into an existing and independently running Django project. mypjc (using Django 1.8) would benefit from a user friendly CMS. Basically I'd the user to be able to write texts and to load in their posts images stored in the (common) database, images that are created by the

Can't silence warnings that django-cms produces

半城伤御伤魂 提交于 2019-12-05 11:12:06
I installed Django-cms with the djangocms-installer script, and all works fine except that I get a bunch of RemovedInDjango18Warning warnings in the shell every time I start the server, do anything with manage.py, or even do a manage.py tab-autocomplete (most annoying)! So thought I'd silence the warnings, using warnings module: # in manage.py, just after `import os; import sys`: import warnings warnings.filterwarnings("ignore") I would like to get more specific with the silencing, but it turns out that even this simple case does not do anything, the warnings are still displayed! What am I

Django CMS 3 Detect if I am facing 'structure' or 'content'

徘徊边缘 提交于 2019-12-05 10:27:20
Django CMS 3 has two modes: structure and content . I need to detect if the user is using one or the other in order to apply specific css. Is there a way to to this? ojii You can detect the current mode via request.toolbar.build_mode and request.toolbar.edit_mode like this: {% if request.toolbar.build_mode %} We're in structure mode! {% elif request.toolbar.edit_mode %} We're in content mode ! {% else %} We're not in edit mode! {% endif %} 来源: https://stackoverflow.com/questions/28191037/django-cms-3-detect-if-i-am-facing-structure-or-content

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

纵饮孤独 提交于 2019-12-05 10:12:45
问题 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? 回答1: 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

how to use forms in django-cms?

╄→гoц情女王★ 提交于 2019-12-04 10:32:00
问题 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

How to link to language's homepage for untranslated page in django-cms?

陌路散爱 提交于 2019-12-04 10:21:22
Within django-cms I have two languages, with one page in Dutch currently not translated into English. When viewing this page, language_chooser does not provide a link for the English translation (as there is not). However, I would like to link the link to the English translation to link to the homepage (or some other English page if it makes sense). Now I could create the needed template tag myself, or some template trickery, but I think this problem has been solved before. Sadly though, I could not find any example of such a solution. Language chooser is used like this: <p><small>Choose your

django_cms ImproperlyConfigured: Error importing middleware cms.middleware.media

旧城冷巷雨未停 提交于 2019-12-04 05:09:37
I'm moving an application that uses django_cms from one server, where everything worked, to another and have spent the last 4 hours trying to find the cause of this error. A suggestions very welcome! mod_wsgi (pid=21972): Exception occurred within WSGI script '/var/www/vhosts/compdoctest.com/django/compdoc/django.wsgi'. Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 230, in __call__ self.load_middleware() File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py", line 42, in load_middleware raise exceptions

how to customize menu template in django-cms?

ぃ、小莉子 提交于 2019-12-04 02:54:39
Can anyone supply me a sample of customizing the django-cms menu template, please? I have tried to look for the default menu.html in the cms package folder, but can't find anything. Thanks. It's in the menus package. See https://github.com/divio/django-cms/blob/develop/menus/templates/menu/menu.html 来源: https://stackoverflow.com/questions/6893772/how-to-customize-menu-template-in-django-cms