Django models and multilingual websites - python

I have a model that has multiple text properties - title, short and long description etc. I want to have multilanguage site so I need a way to easy by able to add new languages and translations for this field for every item. What is the best way to achieve this?

Django has built-in support for I18N (read internationalization):
http://docs.djangoproject.com/en/dev/topics/i18n/internationalization/
Some possible multilingual model candidates:
http://code.google.com/p/django-multilingual-model/
http://and-other-things.blogspot.com/2009/04/list-of-django-multilingual-model.html

I found that django transmeta, also listed by The Myyn is actually quite right for what llian is looking for. We have a very similar setup in production for some of our high traffic websites.

Related

Make related articles feature with python and django or react

I have a blog website backend is Python + Django + DRF. On frontend I have React.
At the article page I want to have "related articles" section and "popular articles". The same I want to have for the root page. For me is so important that these sections will be "user specefic". For example if user have been reading a lot about "France" it would influence to recommended articles and this topic will have more weight than other.
How can I do that?
Can I do that with python?
What technology should I use?
Thank you!
It's a bit more complex than that. You can show similar topics with whatever front end you have, once you have those topics. I don't know of an out-of-the-box library that returns the similar topics, but there are some pretty complex natural language processing tools that you can use to create some on your own (for example, gensim).
This Question has nothing to do with Django or Reactjs. What you are looking for are algorithms for recommender systems.

Django 2 language site once again

I've already created my simple blog in Python Django.
For now, I am interested how to maintain two languages on my blog.
I know about Django internationalization but I do not want to translate button text in my templates.
I've created post model with several fields for different languages: description_ru, description_en. At the end of the day, I want to show fields based on user language preference.
What best practices now (in 2017) to that. Many projects seem to be out of date now;-(
Maybe I should create separate apps for different languages?
Thanks in advance.

Best way to build a custom Django CMS

I am new to Django, but heard it was promising when attempting to create a a custom CMS.
I am looking to get started, but their seems to be a lack of documentation, tutorials, etc on how to actually get something like this going.
I am curious if their are any books/tutorials/guides that can help me get started with CMS django building.
PS- I have heard of django-cms, but am unsure what exactly it is and how it is different from django.
Here is a list of tutorials that has been put together by authors of Two Scoops of Django. http://twoscoopspress.com/pages/django-tutorials
django CMS is a CMS on top of django. It supports multiple languages really well and plays nice together with your own django apps. The basic idea is that you define placeholders in your template and then are able to fill those placeholders with content plugins. A content plugin can be a anything from text, picture, twitter stream, multi column layout etc.
You can look into this, it's about creating placeholder that can be replaced later, which is what CMS is, technically
https://docs.django-cms.org/en/latest/introduction/02-templates_placeholders.html

Using Django CMS

I know python and have just read a basic intro of django. I have to built something like a travel website with real time updates. Will django be sufficent for this? Somebody advised me to look at django-CMS, I couldn't find a very beginner's tutorial there. Should I opt for django-CMS? Also how much of django should i know before i can try out django-cms?
Edit: Not too much real time stuff but just updates on the fly, like availibilty etc. Do i really need CMS?
Thanks
From your brief description it sounds like the main part of you project will be something that manages travel information and displays it to visitors to a website. This definitely sounds like something Django would be perfect for.
Django projects tend to be very modular, so the content management part of you code would likely be completely distinct from the travel parts of your project. Personally I'd start with the core travel functionality, rather than start out with worrying about content management. Then once you have that in place you'll be better positioned to decide whether django-cms fits your content needs, or whether something hand rolled will do.
Start by defining your models for the travel application. Then register those models with the admin. Get happy with how the data is modelled and then try and create one of the basic views. You should have something up and running pretty quickly.
You might also be interested in the GeoDjango project http://code.djangoproject.com/wiki/GeoDjango which provides lots of geographical and mapping tools - which sounds pretty relevant to your project.
I would say no. Django CMS is well designed, if you change content frequently. It has nice features to build up a page. But that means it only shows its benefits, when you create a lot pages/subpages and so on.
For a simple website that only presents data, without adding new pages/views, Django will suffice.
And from my experience, you should at lest be familiar with Views and URLs in order to use Django CMS well. But the same applies to Django itself. Everything else can be found on google.
Hope that helps.

Multiple-instance Django forum software

Does anyone know of a django forum plugin that allows each member to have his own forum? If there isn't anything, than what would be the best way to accomplish this with a "regular" forum plugin for Django?
I once created a feature matrix of all Django forum apps I could find. It might be a bit outdated now, though (contributions welcome).
At least django-threadedcomments uses generic foreign keys, so you can attach a message thread to any database object, including users.
Look at DjangoBB.
Yep, the forum app of SCT can be used for this - simply set it up and create multiple "community Groups" (these are similar to vhosts) and map them to subdomains - each community group would have separate forum categories, can have separate templates, separate user permissions, etc. (but they will obviously share the same django users and their profiles) - as an example.. the following websites are all hosted on the same instance:
SCT website
My personal website/blog (the blog is also based on SCTs forum)
ShelfShare Community
Check out diamanda. I'm not sure it does what you need as far as the each user having its forums, but that's probably not too hard to hack on top. Probably as simple as adding a few ForeignKeys into auth.User to the diamanda models. In general django pluggables and djangoapps are good places to look for django stuff that is already written. Also, check out pinax.
I believe the Sphene Community Tools can do this.

Categories