django cms - integrate cms and differentiate content via something other than language - django

New to django...
I have a site with structure /[flavor]/[page] where there are many different flavors and each flavor has roughly the same set of pages. At least at a simple level, this seems to work fine as a django app - flavor can easily become an input to the template for a page.
Now I'm trying to integrate some cms mojo so someone non-technical can easily add/modify content or pages per flavor, and it's not clear how/if django-cms supports this. As far as I can tell, what I want seems similar or equivalent to how django-cms handles languages - in the admin there's a separate tab for each language where you can specify content per language.
For now, my site is English only, so I suppose one option (that doesn't seem too attractive or permanent) is to handle the flavors by pretending they're languages.
I know I can host an arbitrary django app on a cms page that could handle the flavor portion, but the hosted apps don't seem to support adding cms page within them in the same way that languages do.
Being new to django, I'm not wedded to a particular cms, and am open to any suggestions about approach, site structure, etc. as well - the main requirement is to support someone non-technical easily adding/modifying different content/pages for the different flavors.
Thanks!

One option would be to bypass the CMS for the flavor pages and create a Flavor model instead. You could use django-tinymce's HTMLField (https://github.com/aljosa/django-tinymce/blob/master/docs/usage.rst) to allow rich text editing on Flavor fields.

Related

Can I extend django admin to one of the good looking bootstrap admin templates?

I am trying to use django as the platform for a website development. I was using wordpress so far. I liked its CMS and admin system. Can I make a function rich admin backend with django that has; pages, menus, categories, tags, posts, images etc. as the wordpress. In order to make it look good, is it possible to use boostrap or similar dashboard templates? How much of difficulty are you expecting for this project?
Looking forward for your opinions
Thanks
Django admin is a great utility that comes with django, which helps to create basic CRUD application very quickly.
Now customizing it can be somewhat difficult because it is tightly coupled.
Thought the docs are awesome and you can see if the customization will get your work done. There are many themes available such as django-suit, django-jet etc. which makes it even more awesome.
You might also want to have a look at django-cms and wagtail.
Hope it helps!

Robust Rails CMS

Im doing development in Rails that requires a good bit of friendly hand off to the client. For a bit, I have used Active Admin and out of the box it seems to work for the use cases I have run into like CRUD actions on model resources. However, a new app I am building involves the the ability for the client to essentially edit everything on the website and add new pages. It seems that I could get Active Admin to do this but it would take an incredibly long time. So, here are my thoughts: Try and extend Active Admin and see where that goes, build a CMS from scratch and wrap it around an Admin namespace or something similar, or see if there is a more robust CMS (does not have to be free), that comes with rich features, i.e. templating, new page creation, wyswig editor, rich text editor, etc. Think more Wordpress style CMS. What are your guys thoughts? Thanks everyone!
I can recommend this CMS, worked with it for some years now.

Mezzanine web content language translations

I have been looking for documentation and information as to how to translate web site content?
We've been using Django CMS for a long time and it gives us two tabs in the admin, i.e : English, Francais and we can toggle between the two to write content in the specific language.
In Mezzanine, I have my LANGUAGES tuple set up with en,fr as well as USE_I18N = True but I don't see how my content editors will be able to create bilingual pages. Any advice?
Mezzanine doesn't support multiple languages by default as Django-CMS does. You need to use 3th party app that can translate models which code you can't touch like django-modeltranslation.
There is an open issue for Mezzanine about Multilanguage support https://github.com/stephenmcd/mezzanine/issues/106
I was created two multilingual sites with my custom app https://github.com/vstoykov/django-magic-translation

Does django-cms really integrate with django and models

I am migrating an existing small business admin system that uses a variety of spreadsheets and access databases to a Linux server to provide both intranet and internet access to our own office staff, to external partners and to customers.
There is some fairly complex database work which will be using postgreSQL and python.
There needs to be a professional looking public website which can access some of the database content both to generic "customers" and tailored data visibility to actual clients.
None of the traditional CMS offerings like wordpress, drupal, joomla etc seemed flexible enough, so I found my way to django.
I've built models, populated data tables, built some basic views to manipulate the data and started to play a bit with html layout tags and css, and I've started looking at forms including crispy-forms.
I need to work with pdf files - scanning, uploading, splitting into single pages, displaying on the site alongside form data entry etc.
I was hoping that I could use django-cms to handle the aspects of the public facing words and pictures and dealing with the jpgs pdfs etc, and to do the page layout stuff, while using django models and python to simplify the database access and provide the intelligence.
When I read the django-cms docs around integrating models I get the impression that there is not really a proper integration - that you can build a site that switches between cms pages and django pages or maybe embeds a django view into a cms page, but I'm not sure if I can do the look and feel and static bits in cms and the dynamic bits on the same page in django without still having to do the work in django as well.
the django system revolves around the models, the django-cms docs read as if models are some sort of extra bit you might want to use.
There's talk of the different ways to integrate django models but they all treat the django model as a foreign item that can be added.
I've found other people who've asked "how does django-cms work with django models" and the answers seem to be no different from those that ask "how do I ad a django model to a drupal site"
So my question really is - does django-cms integrate with django to provide ease of building sites with good integration between cms features and model features or are they really two separate systems that can share space on the same page with a bit of work but don't play nice together in any useful way?
Is there another tool I can use for my static stuff and page formatting and navigation to integrate with my models and python code?
Yes
Yes, it does integrate with django and it does provide ease of building sites with good integration between cms features and model features. Like comment by Simeon Visser hinted - you can create your own plugins to add managing different features into django cms part. And most often - most things will not need such integration - simple django admin views and models will suffice.

preventing XSS/JS attacks on hosted CMS

I am working on a hosted CMS, and am thinking about allow site editors to add custom javascript and html (a much requested feature).
I am concerned that this will open up an attack vector - nasty js could make calls to the functions that our hosted CMS exposes (see the Samy worm for an example of what user scripts did to myspace), but I really want to give users control over their site (what's the point of a CMS you can't add your own clever stuff to?)
What is a good approach to fixing this issue? I can think of several which I would like commentary on, but am not going to list them for fear of the 'no list questions mods'!
I suspect that Caja is on your list, so I'll mention that this is squarely in Caja's use cases; for example, Google Sites is very like a CMS and uses Caja to embed arbitrary JS and HTML.
Caja host pages can provide arbitrary additional interfaces for use by the sandboxed content, which can include, for example, embedding widgets provided by your CMS inside the user-supplied HTML while maintaining encapsulation.
(Disclosure: I work for Google on the Caja team.)