Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
JavaScript send value to the backend (hidden html input or all means)
I have two really simple form that looks like this: <form name='a' id='a'> // form a <input type="text" name="x" id="x"> //input 1 <input type="text" name="y" id="y"> //input 2 <button>submit</button> </form> when the form a is submitted, the URL query string will look like example.com/?x=1&y=2 <form name='b' id='b' method="POST"> //form b <input type="hidden" name="sum" id="sum"> // hidden input sum </form> I have a computation script code that calculates the sum of input 1 and input 2 then stores the sum to hidden "input sum" inside "form b" <script> window.addEventListener("DOMContentLoaded", function(){ function calculate(){ // I want it also to work when someone paste the url example.com/?x=1&y=2 const urlParams = new URLSearchParams(window.location.search); x = urlParams.get('x') y = urlParams.get('y') sum = x+y document.getElementById('sum').value = sum //store sum to hidden input } }); calculate() </script> How do I send value of hidden "input sum" to the backend(Django) when someone submits form a or paste the URL? Also: document.getElementById('b').submit(); // will refresh page indefinitely, tried ajax e.prevetdefault(), didn't work, open to all ideas. -
Find the type of visible field from visible_fields()
I've the following code inside my forms.py. I'm using ModelForm to generate the form view def __init__(self, *args, **kwargs): super(NewPlayerForm, self).__init__(*args, **kwargs) for visible in self.visible_fields(): print(visible) visible.field.widget.attrs['class'] = 'form-control' The aim is to not put the form-control class on a field of type boolen/checkbox. But I'm having a hard time in figuring out how to get the field type from the above lines. print(visible) shows the following in the console I tried using field.type or field.getType(), nothing seems to work. -
Create several objects at once Django Rest Framework Generic Views
I'm using Django Rest Framework. I'm trying to create a listcreateapiview to create several objects at once but nothing I've found so far seems to work and not sure why. #My view class MyListCreateView(ListCreateAPIView): serializer_class = MySerializer def get_queryset(self): return Mymodel.objects.filter(user=self.request.user.id) # tried this with no luck def get_serializer(self, instance=None, data=None, many=False, partial=False): if data is not None: data.is_valid(raise_exception=True) return super(MyListCreateView, self).get_serializer(instance=instance, data=data, many=True, partial=partial) else: return super(MyListCreateView, self).get_serializer(instance=instance, many=True, partial=partial) def perform_create(self, serializer): user_obj = self.request.user serializer.save(user=user_obj) #my serializer class MySerializer(serializers.ModelSerializer): class Meta: model = MyModel fields = '__all__'``` -
'ascii' codec can't encode character '\u2019' in position 609: ordinal not in range(128). Django
I try to make reset password system in django python. so i make this url.py from django.urls import path from app import views from django.conf import settings from django.conf.urls.static import static from django.contrib.auth import views as auth_views from .forms import LoginForm, MyPasswordChangeForm, MyPasswordResetForm urlpatterns = [ path('passwordchange/', auth_views.PasswordChangeView.as_view(template_name='app/passwordchange.html', success_url="/passwordchangedone/", form_class=MyPasswordChangeForm), name='passwordchange'), path('passwordchangedone/', auth_views.PasswordChangeView.as_view(template_name='app/passwordchangedone.html'), name='passwordchangedone'), path('password-reset/', auth_views.PasswordResetView.as_view(template_name='app/password_reset.html',form_class=MyPasswordResetForm), name='password_reset'), path('password-reset/done/', auth_views.PasswordResetDoneView.as_view(template_name='app/password_reset_done.html'), name='password_reset_done'), path('password-reset-confirm/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(template_name='app/password_reset_confirm.html'), name='password_reset_confirm'), path('password-reset-complete/', auth_views.PasswordResetCompleteView.as_view(template_name='app/password_reset_complete.html'), name='password_reset_complete'), ] and this is my settings.py class MyPasswordResetForm(PasswordResetForm): email = forms.EmailField(label=_("Email"), max_length=254,widget=forms.EmailInput(attrs={'autocomplete':'email','class':'form-control'})) i try to import whatever that this system need, but still not working, i try to copy and paste the code from my another project but still not working, i try to match my script and another project script i added that miss in my script but not working. anybody can help -
Django REST Framework: How to use prefetched queriesets in child serializers in nested serializers
I want to call a queryset prefetched from a View from a nested serializer child. I tried the following but it did not work the way I intended. How can I call a prefetched queryset from a child serializer? #views.py class PlaylistListView(generics.ListAPIView): serializer_class = PlaylistSerializer def get_queryset(self): return ( Playlist.objects.all() .prefetch_related("user", "user__emailaddress_set") ) #serializers.py class UserDetailSerializer(serializers.ModelSerializer): is_verified = serializers.SerializerMethodField() class Meta: model = User fields = ("is_verified",) def get_is_verified(self, user): return user.emailaddress_set.filter(verified=1).count() > 0 class PlaylistSerializer(serializers.ModelSerializer): user = UserDetailSerializer(read_only=True) class Meta: model = Playlist fields = ("user",) -
Channels Layers: InMemoryChannelLayer or RedisChannelLayer DRF
I am a channels beginner and I want to know when should I use the channels.layers.InMemoryChannelLayer and channels_redis.core.RedisChannelLayer? I've read that channels.layers.InMemoryChannelLayer should be used when testing applications and channels_redis.core.RedisChannelLayer should be use in the production phase, but what is the reason? What are the advantages of using redis in this case and what role it plays? I would like a reasonably detailed explanation. -
I have a Django project where users can authorize through Github. How can I add github users avatar as well?
My project is a Django blog. Users already can authorize using Github, but avatar does not save. -
Where is the order stored?
I am watching a youtube tutorial, he created a function for placing order, but where is it stored? function order(){ var msg = note.value; var orders = localStorage.getItem('orders'); var ur = '/cart/'; var orderData = {}; orderData['orders'] = orders; orderData['note'] = msg; $.ajax({ url:ur, type: "POST", data: orderData, success: function(data){ window.location.replace('/success') localStorage.setItem('orders', JSON.stringify([])); localStorage.setItem('total', 0); } }) } -
Outlook blocks emails
Something a little strange is happening to me. I created a google email for password-reset, account-activation etc.... On the @outlook emails I can't get the password-reset one while the others arrive. I tried to change the EMAIL_HOST_USER with my personal google email and everything works. Also in the mailbox all the emails are sent but not received. Can someone help me? This is my urls.py: path('reset_password/', auth_views.PasswordResetView.as_view(template_name="password/password_reset.html"), name="reset_password"), path('reset_password_sent/', auth_views.PasswordResetDoneView.as_view(template_name="password/password_reset_sent.html"), name="password_reset_done"), path('reset/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(template_name="password/password_reset_form.html"), name="password_reset_confirm"), path('reset_password_complete/', auth_views.PasswordResetCompleteView.as_view(template_name="password/password_reset_complete.html"), name="password_reset_complete"), and my settings: #SMTP CONFIGURATION EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_USE_TLS = True EMAIL_HOST_USER = 'myemail@gmail.com' EMAIL_HOST_PASSWORD = 'mypsw' -
Server Error (500) after deploying django app
I have to deploy a PyTorch model using Django and I have static files which include images, CSS, and javascript files. After deploying by using whitenoise and disabling COLLECTSTATIC I am getting server errors after deploying using Heroku. need help. I have attached my settings.py file code below for reference from pathlib import Path import os BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = 'django-insecure-2e(@-ilm2ph7sx34c-0^!o4bcjt2#fx^j=l(m$ey@aqe823q62' DEBUG = False ALLOWED_HOSTS = ['labwebsitetest.herokuapp.com','127.0.0.1:8000'] INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'whitenoise.runserver_nostatic', 'django.contrib.staticfiles', 'lab.apps.LabConfig', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'website.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'website.wsgi.application' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } } AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' STATIC_ROOT = os.path.join(BASE_DIR,'static') STATIC_URL = '/static/' DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' -
how to pass data in array to post method in angular and django?
I am trying to pass a list of student IDs but it is not working. from angular I am passing dataas follows let noticeData = this.announceForm.value; if (noticeData.students.includes('all')){ noticeData.students = noticeData.students.filter((s) => s != 'all') } noticeData.students = JSON.stringify(noticeData.students); from django i am reading and trying to store data as Below is the to_internal_value method which I have overridden. def to_internal_value(self, data): tempdict = data.copy() tempdict['students'] = json.loads(data['students']) data = tempdict return super(NoticesSerializer, self).to_internal_value(data) but it always returns the same error {students: [“Incorrect type. Expected pk value, received list.”]} -
How to create multiple types of users in Django without using forms
I want to create 2 types of users - Customer and Company, both having different parameters. I've searched nearly everything but everyone uses OneToOne Field relationship and uses django forms. I'm new to django and just want to create an API and not any HTML. These are my models - class Customer(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True) name = models.CharField(max_length=100) email = models.EmailField(_('email address'), unique=True) class Company(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True) company_name = models.CharField(max_length=100) company_email = models.EmailField(_('email address'), unique=True) I've created a serializer for my custom user named UserSerializer and used it in my model serializer. class CustomerSerializer(serializers.ModelSerializer): user = UserSerializer(many=True, read_only=True) class Meta: model = Customer fields="__all__" class CompanySerializer(serializers.ModelSerializer): user = UserSerializer(many=True, read_only=True) class Meta: model = Company fields="__all__" Below is my views.py file for Customer - class register(APIView): def post(self, request, format=None): user_serializer = UserSerializer(data=request.data) if user_serializer.is_valid(): user = User.objects.create_user(email=request.POST.get('email'), contact=request.POST.get('contact'), is_staff=request.POST.get('is_staff'), is_superuser=request.POST.get('is_superuser')) customer_serializer = CustomerSerializer(data=request.data) if customer_serializer.is_valid(): customer_serializer.save() return Response(customer_serializer.data, status=status.HTTP_200_OK) else: return Response(customer_serializer.errors, status=status.HTTP_400_BAD_REQUEST) else: return Response(user_serializer.errors, status=status.HTTP_400_BAD_REQUEST) In this code, I'm getting an error - "Column 'user_id' cannot be null". user_id is the foreign key in Customer related to users. But while registering, user is created and it is assigned a random id. I … -
Second Session ENGINE without expiry date
I have Product model: class Product(models.Model): title = models.CharField(max_length = 25) description = models.TextField(blank = True, null = True) price = models.IntegerField(default = 0) image = models.ImageField(upload_to = 'products/images', null = True, blank = True) image_url = models.URLField(null = True, blank = True) created_at = models.DateTimeField(auto_now_add = True) updated_at = models.DateTimeField(auto_now = True) product_views = models.IntegerField(default = 0) def __str__(self): return self.title class Meta: ordering = ['title'] In each user view, I add one to product_views. views.py: def product_detail_view(request, id): if 'views' not in request.session: request.session['views'] = [] arr = request.session['views'] # obj = Product.objects.get(id = id) obj = get_object_or_404(Product, id = id) if id not in arr: arr.append(id) request.session['views'] = arr obj.product_views = obj.product_views + 1 obj.save() context = { 'object': obj, } return render(request, 'home/detail.html', context) I set SESSION_COOKIE_AGE = 86400 in settings.py. It works great. But there's one problem. In my app user can log in and after a day, he has to log in again. I wanted to add Remember me checkbox to my log in, but here's problem. I can't set specific expire time for specific key. So I have to make my own 2nd Session Engine. I wrote this: class ProductViews(models.Model): product = models.ForeignKey(Product, … -
Django Rest Framework - Cookies disappear after redirect/refresh
I am first time working with jwt tokens for loggin in and storing that token by backend in http only cookies with one more cookie. The problem is, In login page when i logs in..cookies are setting properly but when page redirects to profile page cookies are lost and login becomes logout. I trid refresh and found same issue. Please help me.. Its only happening in production not in development. My domains are -- In development frontend - 127.0.0.1:5501 backend - 127.0.0.1:8000 In Production frontend - https://xyz.netlify.app backend - https://xyz-web.herokuapp.com My cors setting CSRF_COOKIE_HTTPONLY = False CSRF_COOKIE_SAMESITE = 'None' ACCESS_CONTROL_ALLOW_HEADERS = True CORS_ALLOW_HEADERS = [ 'accept', 'accept-encoding', 'authorization', 'content-type', 'dnt', 'origin', 'user-agent', 'x-csrftoken', 'x-requested-with', 'Access-Control-Allow-Origin' ] # CORS_ORIGIN_ALLOW_ALL=True CORS_ALLOW_METHODS = [ 'DELETE', 'GET', 'OPTIONS', 'PATCH', 'POST', 'PUT', ] CORS_ALLOW_CREDENTIALS = True CORS_ALLOWED_ORIGINS = [ "http://127.0.0.1:5501", "https://xyz.netlify.app" ] My login view setting the cookies after login def get_tokens_for_user(user): refresh = RefreshToken.for_user(user) return { 'refresh': str(refresh), 'access': str(refresh.access_token), } class LoginView(APIView): def post(self,request,format=None): data = request.data response = Response() username = data.get('username', None) password = data.get('password', None) user = authenticate(username=username, password=password) if user is not None: if user.is_active: data = get_tokens_for_user(user) response.set_cookie( key = settings.SIMPLE_JWT['AUTH_COOKIE'], value = data["access"], expires = settings.SIMPLE_JWT['ACCESS_TOKEN_LIFETIME'], secure … -
How to setup a frontend pipeline embedded into Django app
I am following a guide online but I am having an issue with getting my front-end pipeline embedded in my Django app. The steps I took were... create a folder (I called it test-project) create virtual environment python -m venv venv Installed Django while in my virtual environment started Django Project django-admin startproject myapp inside /test-project/myapp/ create folders assets, static, templates inside /test-project/myapp/ ran in command line npm init -y inside /test-project/myapp/ ran in command line yarn add webpack webpack-cli --save-dev inside /test-project/myapp/assets/ created file index.js and added the following code function component() { const element = document.createElement('div'); element.innerHTML = 'Hello webpack'; return element; } document.body.appendChild(component()); created in /test-project/myapp/ file webpack.config.js and added the following const path = require('path'); module.exports = { entry: './assets/index.js', // path to our input file output: { filename: 'index-bundle.js', // output bundle file name path: path.resolve(__dirname, './static'), }, }; added to package.json file in /test-project/myapp/ to the "scripts" key "dev": "webpack --mode development --watch" Ran yarn run dev and /test-project/myapp/static/index-bundle.js file got created in /test-project/myapp/templates/ created file hello_webpack.html and added the following {% load static %} <!doctype html> <html> <head> <title>Getting Started with Django and Webpack</title> </head> <body> <script src="{% static 'index-bundle.js' %}"></script> </body> </html> … -
why filter doesn't change value in iteration in django template
I have custome filter in to_and.py file for getting verbose name from django import template register = template.Library() @register.filter def verbose_name(objects): return objects._meta.verbose_name but when I get the value in view it only give me the first model name in iteration my code queryset has two indivial model {% load to_and %} {{links}} {% for link in links %} {% if link|verbose_name == "Unit" %} {{link|verbose_name}} {{link.id}} {% endif %} {% endfor %} see the out put of this code -
Django admin page with summer note editor causing toggle to expand making it look odd
I currently installed django summer note on a blog. It loads fine, and I see no errors in console, but it looks like this .. The main admin loads fine, it's just the create post page. My admin.py file in the blog looks like this from django.contrib import admin from .models import Post, Newsletter from django_summernote.admin import SummernoteModelAdmin class PostAdmin(SummernoteModelAdmin): list_display = ('title', 'slug', 'status', 'created_on') list_filter = ('status', 'created_on') search_fields = ['title', 'content'] prepopulated_fields = {'slug': ('title',)} summernote_fields = ('content',) admin.site.register(Post, PostAdmin) class NewsletterAdmin(admin.ModelAdmin): list_display = ('email', 'confirmed') admin.site.register(Newsletter, NewsletterAdmin) -
how to get token along with user name in Django
I am getting Token with I use auth API in django when I use API like I create my username and password using createsuperuser in django http://127.0.0.1:8000/auth/ [POST METHOD] Token { "token": "5f8ceaaaeef845bef8474e28192a174d3214124" } I want my token response like { "username":"Gem", "token": "5f8ceaaaeef845bef8474e28192a174d3214124" } How to get like that? My serialiser code class UserSerializer(serializers.ModelSerializer): class Meta: model = User fields = {'id', 'username', 'password'} extra_kwargs = { 'password':{'write_only': True, 'required': True} } -
Sending and render HTML syntax via jinja variable
I need some complicated operations to render some dynamic trees in my front-end. But as I can't find any way to run recursion in my jinja or front-end, I take an approach to make a string in my views.py along with HTML syntax and render them in the front-end to get the desired output something like this (As an example, here I skip the original complicated string because there is no need for it): in views.py: test = "<h2>Hi This is from django</h2><ol><li>abc</li><li>mno</li><li>xyz</li></ol>" mydict={ 'test' : test, } return render(request, 'app\index.html', mydict) In index.html: <div class="container-fluid"> {{ test }} </div> My desired output with this code is: Hi This is from djangoabcmnoxyz But the obtain output is: <h2>Hi This is from django</h2><ol><li>abc</li><li>mno</li><li>xyz</li></ol> Please suggest to me, is there any way to render the jinja string variable along with the effect of HTML in my front-end? If not then how can I take an approach to render any tree dynamically in my front end where the level, leaf node, intermediate node, etc all info come from the database. -
Difference between User.object.create_user() vs User,object.create() in Django
I am making a Django login but has some problems with the User.object.create_user(). My error is django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the NAME value. Views.py from django.http import HttpResponse from django.shortcuts import redirect, render from django.contrib.auth.models import User from django.contrib import messages from django.contrib.auth import authenticate, login, logout def home(request): return render(request, "authentication/index.html") def signup(request): if request.method == "POST": username = request.POST['username'] fname = request.POST['fname'] lname = request.POST['lname'] email = request.POST['email'] pass1 = request.POST['pass1'] pass2 = request.POST['pass2'] myuser = User.objects.create_user(username, email, pass1,) myuser.first_name = fname myuser.last_name = lname myuser.save() messages.success(request, "Your account has been generated") return redirect('signin') return render(request, "authentication/signup.html") def signin(request): if request.method == 'POST': username = request.POST['username'] pass1 = request.POST['pass1'] user = authenticate(username=username, password=pass1) if user is not None: login(request, user) fname = user.first_name return render(request, "authentication/index.html",{'fname': fname}) else: messages.error(request, "Wrong credidentials") return redirect('home') return render(request, "authentication/signin.html") def signout(request): logout(request) messages.success(request, "Logged out Successfully") return redirect('home')``` ** Urls.py ** from django.contrib import admin from django.urls import path,include from . import views urlpatterns = [ path('', views.home, name="home"), path('signup',views.signup, name="signup"), path('signin',views.signin, name="signin"), path('signout',views.signout, name="signout"), ] ** Settings.py ** """ Django settings for gfg project. Generated by 'django-admin startproject' using Django 3.2.3. For more information on this file, … -
Django generic.ListView: do not display Questions that have no specified Choices
The models are: class Question(models.Model): question_text = models.CharField(max_length=200) class Choice(models.Model): question = models.ForeignKey(Question, on_delete=models.CASCADE) choice_text = models.CharField(max_length=200) votes = models.IntegerField(default=0) Some Questions have no Choices specified by the admin. I don't want to display such Questions. If the solution is to override get_queryset, then how to do that? Or is it better to get all Questions (Question.objects.all()) and to filter them in the view? class QuestionList(generic.ListView): model = Question template_name = 'polls/index.html' context_object_name = 'latest_question_list' def get_queryset(self): # How? -
Django Model Admin Import Export Data
I am trying to import order model table from my database. In my admin sqlite3 database it is showing me the name of the user based on order but when I import my csv file it is showing me just the user id. How can I solve this? this is my user serializer class UserSerializer(serializers.ModelSerializer): name = serializers.SerializerMethodField(read_only=True) _id = serializers.SerializerMethodField(read_only=True) isAdmin = serializers.SerializerMethodField(read_only=True) class Meta: model = User fields = ['id', '_id', 'username', 'email', 'name', 'isAdmin'] def get_name(self, obj): name = obj.first_name if name == '': name = obj.email return name def get__id(self, obj): return obj.id def get_isAdmin(self, obj): return obj.is_staff this is my order serializer class OrderSerializer(serializers.ModelSerializer): orderItems = serializers.SerializerMethodField(read_only=True) shippingAddress = serializers.SerializerMethodField(read_only=True) user = serializers.SerializerMethodField(read_only=True) class Meta: model = Order fields = '__all__' def get_orderItems(self, obj): items = obj.orderitem_set.all() serializer = OrderItemSerializer(items, many=True) return serializer.data def get_shippingAddress(self, obj): try: address = ShippingAddressSerializer(obj.shippingaddress, many=False).data except: address = False return address def get_user(self, obj): user = obj.user serializer = UserSerializer(user, many=False) return serializer.data here is the screenshot of my admin and excel sheet -
How to store data in local storage using Django?
I need to set in the login user section. I need to set in the custom user login section and the set of the normal user section also. -
Django - Default Authentication Allowany is not working
Here I am using django with default authentication. My authentication class in settings.py is REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework.authentication.TokenAuthentication', ], 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.IsAuthenticated', ], } I set it as a default authentication but for some API, I don't need Authentication at that time I use allow any but it is not working it required Token like { "detail": "Authentication credentials were not provided." } My code for POST method is class EnquiryCrudPost(APIView): def post(self, request): UserData = request.data authentication_classes = (TokenAuthentication) permission_classes = (AllowAny) if UserData: try: NewUserData = Enquiry.objects.create() .......... Thank you -
populating a tuple with model objects
I have a simple checklist in my personal info form that users can fill. this checklist gets its choices from tuple and that tuple gets its items from another model called field like this: class Field(models.Model): id = models.AutoField(primary_key=True) slug = models.CharField(max_length=16, default='default') title = CharField(max_length=32) INTERESTS = (Field.objects.values_list('slug', 'title')) everything works just fine. however, when I add a new field object, INTERESTS tuple wont get updated without migrations. how can I update my tuple without any migrations? is it even possible?