I import the module TinyMCE and the django isnt working

I think I have a outdated verison of TinyMCE and i was wondering how to fix the ImportError: cannot import name ‘TinyMCE’ from ‘tinymce’. It was working before i form.py from django import forms from tinymce import TinyMCE from .models import Post, Comment class TinyMCEWidget(TinyMCE): def use_required_attribute(self, *args): return False class PostForm(forms.ModelForm): content = forms.CharField(…

Synonymous many to many model relationship in Django

I’m trying to achieve what you could call a “synonymous” relationship on a self referencing many to many field in Django. Take this model for example (in reality I don’t use real words, but category tags instead): class Word(models.Model): name = models.CharField(max_length=30, unique=True) synonymous = models.ManyToManyField(‘self’, blank=True, related_name=’synonymous’) def __str__(self): return self.name What I want…

Querying datetime object in django doesn’t work because of time zone

I’m facing the issue of wrong query result due to timezone issue. I’ve read several answers, but most of them suggest USE_TZ = False. But we can’t do that because of several dependencies on time zone. blog = Post.objects.filter(date_posted__year=2019, date_posted__month=11) blog[0] Post: asfd random new india safasfd adf hey blog[0].date_posted datetime.datetime(2019, 11, 26, 20, 33,…