Django community: Django Q&A RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to translate static slug in Django
Hello I am trying to develop a multilanguage website in Django. I am using django-modeltranslation for this. I can change the dynamic slugs via Django admin this is fine. But how can i change the static slug? For example I am talking about this: mydomain.com/services/my-dynamic-service Here is services is static slug. But when I change the language of website, I want to change /services/ slug to new slug meaning /services/ from the language I switch. -
strange behavior when getting env var in container | Django, Poetry, Docker
I need to get an env var from an docker container. This build is triggered with a docker compose file and I passed also the env variables with env_file. When I login to the container with docker exec -it conatinerName bash I can echo the variable and get correct output. Even when I trigger docker exec -it containerName echo $DEBUG inside the poetry environment, I get the correct answer. When I trigger this command from a terminal session without acitvated environment I get nothing. For me its very confusing, because I thought my docker container has nothing to do with my poetry environment. I just want to get the env var($DEBUG) from inside the container undependend the location I trigger this command. -
Is it a good idea to separate general and user-specific characteristics of the same row in two MySQL tables?
I'm currently making an app for uni in which you can put your clothes and it will select your outfit of the day. We're at the beginning of the project, so a lot of it is barebones, but we had a problem come up when talking with our professor. We talked about databases and we struggled with 2 possible schemas for one reason: clothes might not be unique. If they're not unique, and two users have the same top, pair of pants, etc., then He showed me some stuff that showed how I might be wrong, but he told me to post here just in case. He said it would be preferable to make the database like this: Users user_id (user credentials and others) Possessions possession_id possessor_id (FOREIGN) possession_clothes_id (FOREIGN) (personal parameters, like how many times worn or if it's one of the user's favorite for example) Clothes clothes_id clothes_name clothes_type clothes_size (impersonal parameters, such as color and others) I suggested making a database schema that made the clothes completely unique, whether they're the same or not, which would basically look like this: Users user_id (user credentials and others) Clothes clothes_id possessor_id (FOREIGN) clothes_name clothes_type clothes_color clothes_size (other impersonal parameters) … -
Dynamic creation of Django models
I've developed a frontend constructor for creating data models for users who don't know how to code. The issue I'm encountering is that when the function is executed, migrations are not applied (which is one of the requirements of my task), and after server reboot, the created models disappear. How can I fix this issue? I'm using SQLite with Python 3.12. -
Encountering Race Conditions Despite Using Django's Atomic Transactions and select_for_update
I'm encountering race conditions in my Django application despite implementing atomic transactions and utilizing the select_for_update method. Here's an overview of the problem and the steps I've taken so far: Problem: I have two Django models, Transaction and Account, where Transaction instances affect the balance of associated Account instances. However, due to the large size of transactions, I'm experiencing race conditions, resulting in false outcomes and incorrect balance updates. Database Schema: Transaction: id (Primary Key) amount account_id (Foreign Key referencing Account.id) Account: id (Primary Key) balance Steps Taken Atomic Transactions: I've wrapped the critical sections of my code that involve database operations within Django's atomic transactions using the @transaction.atomic decorator or transaction.atomic context manager. Row-Level Locking: I've utilized the select_for_update method to lock the rows in the Account table during reads, ensuring that concurrent transactions don't interfere with each other's updates. Despite implementing these measures, I'm still encountering race conditions, leading to incorrect balance calculations and data inconsistency. Additional Context: I'm using a PostgreSQL database for my Django application. The race conditions seem to occur when multiple transactions attempt to update the balances of related accounts simultaneously. I've verified that the critical sections of my code are indeed encapsulated within … -
How to dynamically set urls in Django
I have a form that updates the quantity of a product or a custom order, i am currently using "{% if custom_orders %}{% url 'custom_order_update' item.custom_order.id %}{% else %}{% url 'update_bag' item.product_id %}{% endif %}" as the action URL, however Django is complaning with a redirect error for this syntax. Could anyone recommend another way to set the URL dynamically? -
Encountering file not found error in production
I hosted my django project on vercel, every static file is working correctly. django views.py function def view_pdf(request): file_path = os.path.join(settings.BASE_DIR, 'static', 'media', 'Shashank_Joshi_resume.pdf') with open(file_path, 'rb') as pdf: response = HttpResponse(pdf.read(), content_type='application/pdf') instead of mimetype response['Content-Disposition'] = 'inline; filename="Shashank_Joshi_resume.pdf"' return response html template <div class="resume"> <input type="button" value="Resume" class="btn btn-primary" onclick="window.open('view_pdf')"> </div> error im getting FileNotFoundError at /view_pdf [Errno 2] No such file or directory: '/var/task/static/media/Shashank_Joshi_resume.pdf' But i have button in my html template by which a pdf file is shown when i click that its showing file not found error on vercel but when i run it locally its working totally fine. The github repo is also upto date. -
objects in object Django API
Why when I get all products in included_lessons instead of objects I receive only their ID, when I want to receive full object: id, name and so on. What I receive: [ { "id": 5, "author": "author", "name": "math product", "start_time": "2024-03-01T08:25:17Z", "min_users_in_group": 5, "max_users_in_group": 1, "included_lessons": [ 7, 8, 9 ] } ] What I want to receive: [ { "id": 5, "author": "author", "name": "math product", "start_time": "2024-03-01T08:25:17Z", "min_users_in_group": 5, "max_users_in_group": 1, "included_lessons": [ { "id": 1, "name": "some name", "something else": "something else" }, { "id": 2, "name": "some name 2", "something else": "something else 2" } ] } ] Model: class Product(models.Model): author = models.CharField(max_length=64) name = models.CharField(max_length=64) start_time = models.DateTimeField() min_users_in_group = models.IntegerField() max_users_in_group = models.IntegerField() included_lessons = models.ManyToManyField(Lesson, related_name='lessons') class Meta: db_table = 'product' def __str__(self): return self.name Serializer: class ProductSerializer(serializers.ModelSerializer): class Meta: model = Product fields = '__all__' View model: class ProductApiView(viewsets.ReadOnlyModelViewSet): queryset = Product.objects.all() serializer_class = ProductSerializer I tried to change queryset in API View model, but it is useless -
why this error shows when deploying a django projejct on verce;l
Error: Command failed: pip3.9 install --disable-pip-version-check --target . --upgrade -r /vercel/path0/requirements.txt ERROR: Ignored the following versions that require a different python version: 5.0 Requires-Python >=3.10; 5.0.1 Requires-Python >=3.10; 5.0.2 Requires-Python >=3.10; 5.0a1 Requires-Python >=3.10; 5.0b1 Requires-Python >=3.10; 5.0rc1 Requires-Python >=3.10 how do i fix the issue -
How to create a Django decorator that creates a signal for a model?
I want to create a custom decorator in Django that I can put on my model, and it creates a signal with my business logic. The logic is the same for each signal, the only thing changing is the model it is being attached to. I am having trouble understanding how to accomplish this. Given a model such as: class Post(models.Model): company = models.ForeignKey(Company, on_delete=models.CASCADE) title = models.CharField(max_length=100) I ideally would want a functionality with my decorator to put it on my model such as: @custom_signal_decorator() class Post(models.Model): company = models.ForeignKey(Company, on_delete=models.CASCADE) title = models.CharField(max_length=100) And it would create a signal such as this one: @receiver(post_save, sender=sender) def notify_created(sender, instance, created, **kwargs): channel_layer = channels.layers.get_channel_layer() group_name = f'notifications_{instance.company.id}' async_to_sync(channel_layer.group_send)( group_name, { "type": "notify_change", } ) The end goal is tracking changes in real time by sending a notification to the frontend when a new post is created. This all works when creating a signal by hand for each model, but I feel like a decorator would make more sense, to put on models we want to track. Any kind of input to how I would go about implementing this would be helpful, or another way that you think might work … -
Django 5.0.2: TypeError: Cannot filter a query once a slice has been taken
Why is this not working? I get the error "Cannot filter a query once a slice has been taken." What can I do to solve this? class LogbookLastViewSet(viewsets.ReadOnlyModelViewSet): serializer_class = LogbookSerializer permission_classes = [permissions.IsAuthenticated] filterset_fields = ['organizationID'] def get_queryset(self): queryset = Logbook.objects.filter(organizationID='1111').order_by('-created')[:10] return queryset I need something like this: SELECT * FROM logbook WHERE organizationID='1111' ORDER_BY created LIMIT 10; -
Trying to iterate through numbers in a table rather than displayng all the values for each number in each cell
I am currently attempting to make a table which takes the lab number for a sample and returns the 'Value 2' of that number(I know it's a bad name but it's what I'm being made to work with) so far I can retrieve the data when a specific lab number is searched for, however if I just have a list of lab numbers in the table, it either displays as 'None' or it starts listing every lab number in order in each cell, as a dictionary. The code that isn't displaying the data properly: def GetValue2(self, _pageOfWorkflowCases): _resultsDict = {} for row in _pageOfWorkflowCases: LabNumber = row['LABNO'] with connection.cursor() as _cursor: _cursor.execute("{CALL dbo.uspShireXGetValue2(%s)}", [LabNumber]) _results = self.utilities.ConvertCursorListToDict(_cursor) if _results: _resultsDict[LabNumber] = _results.get['VALUE2'] return _resultsDict The code that displays a lab number when it's searched for: def GetValue2(self, _LabNumber): with connection.cursor() as _cursor: _cursor.execute("{CALL dbo.uspShireXGetValue2(%s)}", [_LabNumber]) _results = self.utilities.ConvertCursorListToDict(_cursor) if _results: _results = self.utilities.ConvertCursorListToDict(_cursor) return _results -
Django form fields don't appear in my html render page
i have a problem in my django project. Im quite new and im try to create a base form to create a new item in my database. this is forms.py from django import forms from .models import Progetto class Myprogetto(forms.ModelForm): class Meta: model = Progetto fields = ['nome', 'descrizione', 'data_inizio', 'data_fine'] this is my views.py from django.shortcuts import render,redirect from .models import Progetto from django.http import JsonResponse, HttpResponseRedirect from .forms import Myprogetto def aggiungi_progetto(request): if request.method == "POST": form = Myprogetto(request.POST) if form.is_valid(): nome = form.cleaned_data['nome'] Myprogetto_object=form.save(commit=False) Myprogetto_object.save() return HttpResponseRedirect("/thanks/") else: form = Myprogetto() return render(request, 'lista_progetti.html', {"form": form}) this is my lista_progetti.html <form id="popUpForm" display="none" action="" method="post"> {% csrf_token %} {{ form.as_p }} <input type="submit" value="Salva"> </form> the problem is that when i lauch the server the form appear empty with just the button <salva>. I added a screenshot. my form view in html render Anyone can help me? Thank you i tried to use both forms.ModelForm class and forms.Form class but the result is the same. I also try to write a simple form in html using html syntax and the fields appears but then i have problems in django to send the data to database cause it … -
Troubles with postgres while building docker container
I am trying to lauch DJANGO + POSTGRES inside a single container with DOCKERFILE. I have the folowing dockerfile which basicly installs all the python dependencies and postgresql. Then it lauches the script to create db and user (presented below). FROM python WORKDIR /app COPY requirements.txt . RUN pip install -r requirements.txt COPY . . RUN apt update && apt -y install postgresql postgresql-contrib RUN service postgresql start && su -c "bash config.db.bash" postgres WORKDIR /app/psql RUN python manage.py makemigrations && python manage.py migrate #Error EXPOSE 8000 CMD service postgresql start && python manage.py runserver 0.0.0.0:8000 Here is the script "config.db.bash" #!/bin/bash psql <<-INPUT CREATE USER docker; ALTER USER docker WITH PASSWORD 'password'; CREATE DATABASE docker; GRANT ALL PRIVILEGES ON DATABASE docker TO docker INPUT requirements.txt asgiref==3.7.2 Django==5.0.2 sqlparse==0.4.4 tzdata==2024.1 psycopg2 Here is the DJANGO`s settings.py -> Database config (psycopg_2 module installed) DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql", "NAME": "docker", "USER": "docker", "PASSWORD": "password", "HOST": "localhost", "PORT": 5432, } } It works just fine until this line RUN python manage.py makemigrations && python manage.py migrate Then docker says that error occured during this operation. Log basicly says that DJANGO cant connect to postgress DB. > [9/9] RUN python manage.py … -
make a choice list from a field into other field through the Foreign key Django
I have two models connected with foreign key with each other as below : class Service(models.Model): title = models.CharField(max_length=100) counter = models.PositiveIntegerField() def __str__(self) -> str: return f'{self.title}' class Reservation(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) service = models.ForeignKey(Service, on_delete=models.CASCADE) turn = models.PositiveIntegerField() def __str__(self) -> str: return f'{self.user}' What I want to do is turn field in Reservation get option choices and choice values are from 1 to service.counter. service is the foreign key here. for example if counter in Service model is 5 the turn field in Reservation would be something like this : turn = models.PositiveIntegerField(choices=[1,2,3,4,5]). for loop won't work obviously :) . Should I create a property field or Meta class ? anyway, How can I change my field like this? Any help will appreciate and grateful. -
Python: Extract year from datetime.datetime.today().date()
I registered a date to system with dates that is in this format: DateRegistered = datetime.datetime.today().date() . So I want to get the number of user that registered this year. I used this: len(Applicant.objects.filter(DateRegistered=datetime.datetime.today().year)) But it returned 0. Is there other way on how to extract the year? -
Redirect error due to context being passed to template - Django
I am working on an e-commerce site using Django. I have encountered a problem which I can't think of a solution. My site processes normal products and custom orders. I have a view to update the quantity of custom orders and a separate view to update the products quantity. I am using a form with some template logic in the URL to decide which URL pattern I need depending if it is a custom order or a product. bag.html <form class="form" action="{% if custom_orders %}{% url 'custom_order_update' item.custom_order.id %}{% else %}{% url 'update_bag' item.product_id %}{% endif %}" method="POST"> {% csrf_token %} <div class="col-12"> <div class="form-group w-100"> <div class="input-group"> <div class="input-group-prepend"> <button class="btn btn-main rounded-0 decrement" id="decrement_{{item.product.id}}" data-product_id="{{ item.product.id }}"> <span class="icon"> <i class="fa-sharp fa-solid fa-less-than"></i> </span> </button> </div> <input class="form-control quantity" type="number" name="quantity" value="{{item.quantity}}" min="1" max="50" id="quantity_{{item.product.id}}" data-product_id="{{ item.product.id }}"> <div class="input-group-append"> <button class="btn btn-main rounded-0 increment" id="increment_{{item.product.id}}" data-product_id="{{ item.product.id }}"> <span class="icon"> <i class="fa-sharp fa-solid fa-greater-than"></i> </span> </button> </div> </div> </div> </div> <button class="btn btn-main btn-sm rounded-0 mt-2"> Update </button> </form> If i add normal products to the bag application and then add a custom order i get a redirect error stating: Reverse for 'custom_order_update' with arguments '('',)' not … -
How can I call a function from within a Javascript fetch event?
I'm trying to call startTimer() from within the Javascript fetch().then() call, but it isn't going through. How can the fetch() see the startTimer() function and execute it? This happens even when I create an empty test() function that simply prints to console, so I know it isn't related to the code within the startTimer() function. <script> $(document).ready(function(){ function startTimer(duration, display) { var timer = duration, minutes, seconds; const interval = setInterval(function () { minutes = parseInt(timer / 60, 10); seconds = parseInt(timer % 60, 10); // minutes = minutes < 10 ? "0" + minutes : minutes; seconds = seconds < 10 ? "0" + seconds : seconds; display.textContent = minutes + ":" + seconds; if (--timer < 0) { clearInterval(interval); } }, 1000); } }); const form = document.querySelector('#data'); form.addEventListener('submit', (event) => { event.preventDefault(); var subject = $("#subject").val(); var sender = $("#sender").val(); var email = $("#email").val(); fetch('', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({ 'csrfmiddlewaretoken': document.querySelector('[name=csrfmiddlewaretoken]').value, 'subject': subject, 'sender': sender, 'email': email }) }) .then(response => response.json()) .then(data => { const filename = data.filename; const email = data.email; startTimer(60, document.querySelector('#timer')); var msg = `Your ${filename} was sent successfully to ${email}!`; alert(msg); }) .catch(error => { … -
Django 5: best practice way to creating an AJAX registration form via UserCreationForm
As simple as it sounds, what is the effective way to creating a user registration: forms.py: from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User class RegisterForm(UserCreationForm): email = forms.EmailField(required=True) class Meta: model = User fields = ("username", "email", "password1", "password2") def save(self, commit=True): user = super(RegisterForm, self).save(commit=False) user.email = self.cleaned_data["email"] if commit: user.save() return user HTML - index.html: <div class="container"> <form method="post" action="{% url 'base_app:register' %}"> {% csrf_token %} {{ form.as_p }} <button type="submit" class="btn btn-primary">Register</button> </form> </div> HTML - register.html: {% block content %} <div class="container"> <h2>Register</h2> <form method="post"> {% csrf_token %} {{ form.as_p }} <button type="submit" class="btn btn-primary" action="">Register</button> </form> <a href="{% url 'base_app:index' %}">Already have an account? Log in here.</a> </div> {% endblock %} views.py: class RegisterView(TemplateView): template_name = 'base_app/register.html' form_class = RegisterForm success_url = reverse_lazy('/mvp/') # Update this to your actual success URL def form_valid(self, form): form.save() return super().form_valid(form) def get(self, request, *args, **kwargs): form = RegisterForm() return render(request, self.template_name, {'form': form}) urls.py: path('register/', views.RegisterView.as_view(), name='register'), I get the following error: [29/Feb/2024 23:14:08] "POST /register/ HTTP/1.1" 405 0 -
Slides Transition using Javascript and Python
I have a database table with images and I want to display it using slides. The problem I encountered here is that it only shows one image and then just fades away. How can I display the other images too? views.py def dashboard(request): image = Events.objects.all() return render(request, 'dashboard-events.html', {'image': image}) dashboard-events.html <div class="slider" role="listbox"> <div class="slider-inner"> {% for slides in image %} <div class="slides {% if forloop.first %} active{% endif %} fade"> <img src="{{ slides.image.url }}"> <div class="slide-caption"> {{ slides.title }} </div> </div> {% endfor %} </div> <div class="slider-buttons"> <button class="prev" type="button" onclick="plusSlides(-1)"> <button class="next" type="button" onclick="plusSlides(1)"> </div> </div> script var timer; var slideIndex = 1; showSlides(slideIndex); function plusSlides(n) { showSlides(slideIndex += n); } var slideIndex = 0; showSlides(); function showSlides() { var i; var slides = document.getElementsByClassName("slides"); for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; } slideIndex++; if (slideIndex > slides.length) {slideIndex = 1} slides[slideIndex-1].style.display = "block"; clearTimeout(timer); timer = setTimeout(() => plusSlides(1), 2000); } -
Getting error on Vercel while trying to deploy Django
Hello everyone, I build my django project and tried to deploy it in vercel. but I get this error message in vercel. my python version = 3.10.0 this is the error code on vercel [02:35:58.935] Running build in Washington, D.C., USA (East) – iad1 [02:35:59.090] Cloning github.com/LetcodeitwithDave/BookHaven (Branch: master, Commit: e6ac0c7) [02:35:59.101] Skipping build cache, deployment was triggered without cache. [02:36:00.037] Cloning completed: 946.92ms [02:36:00.592] Running "vercel build" [02:36:01.084] Vercel CLI 33.5.3 [02:36:01.311] WARN! Due to `builds` existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings [02:36:02.677] Collecting asgiref==3.7.2 (from -r requirements.txt (line 1)) [02:36:02.711] Downloading asgiref-3.7.2-py3-none-any.whl.metadata (9.2 kB) [02:36:02.741] Collecting certifi==2024.2.2 (from -r requirements.txt (line 2)) [02:36:02.746] Downloading certifi-2024.2.2-py3-none-any.whl.metadata (2.2 kB) [02:36:02.841] Collecting charset-normalizer==3.3.2 (from -r requirements.txt (line 3)) [02:36:02.846] Downloading charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (33 kB) [02:36:02.866] Collecting dj-database-url==2.1.0 (from -r requirements.txt (line 4)) [02:36:02.901] Downloading dj_database_url-2.1.0-py3-none-any.whl.metadata (11 kB) [02:36:03.002] Collecting Django==4.2.10 (from -r requirements.txt (line 5)) [02:36:03.018] Downloading Django-4.2.10-py3-none-any.whl.metadata (4.1 kB) [02:36:03.039] Collecting django-browser-reload==1.12.1 (from -r requirements.txt (line 6)) [02:36:03.049] Downloading django_browser_reload-1.12.1-py3-none-any.whl.metadata (9.8 kB) [02:36:03.101] Collecting django-cors-headers==4.3.1 (from -r requirements.txt (line 7)) [02:36:03.106] Downloading django_cors_headers-4.3.1-py3-none-any.whl.metadata (16 kB) [02:36:03.129] Collecting django-environ==0.11.2 (from -r requirements.txt (line 8)) [02:36:03.139] Downloading django_environ-0.11.2-py2.py3-none-any.whl.metadata … -
Is there any order for inheriting PermissionRequiredMixin in Django?
I encountered this problem while following the Django tutorialDjango tutorial 8. I can redirect to the login page when I put PermissionRequiredMixin class first. class AuthorCreate(PermissionRequiredMixin, CreateView): model = Author fields = '__all__' initial = {'date_of_death': '05/01/2018', } permission_required = 'catalog.add_author' result of First But when I put it in second position it doesn't work and goes directly to the page where the permission doesn't allow it. class AuthorCreate(CreateView, PermissionRequiredMixin): result of Second I want to know is whether I should always put the PermissionRequiredMixin class at the first position. And how about LoginRequiredMixin? or what if I inherit both? -
How to update the quantity of a custom order?
I am trying to update the quantity of a custom order in my bag. In a Django e-commerce application. I am getting an error stating: argument of type 'int' is not iterable, however I am wrapping the custom_order_id in a string. I need the bag to be in the format bag = {[{195,2},{187:3}]} def custom_order_update(request, custom_order_id): """ Updates the quantity of custom orders added to the bag""" bag = request.session.get('bag', {}) quantity = int(request.POST.get('quantity')) custom_orders = bag.get('custom_orders', []) for quantity_dict in custom_orders: if str(custom_order_id) in quantity_dict: quantity_dict[str(custom_order_id)] = quantity break bag['custom_orders'] = custom_orders request.session['bag'] = bag return redirect(reverse('view_bag')) -
How to create hierarchical parent/child relationships with specific permissions in an already build Django (DRF) app
I need to build out a data model in an already existing Django app that uses DRF and I am quite new to Django. The rules are as follows: There are ParentOrganizations and ChildOrganizations that Users can belong to. A ParentOrganization can have many ChildOrganizations An app user can can belong to many ChildOrganizations, but all ChildOrganizations they belong to, must belong to the same parent There is a caveat here that internal super users will have access to all parent and child orgs A app user can have different permissions on each ChildOrganization that they belong to. We will use Django Admin to create users and assign them to their parent and child organizations along with the permissions for each child organization A few questions and some code: This app already exists so it seems that I missed the boat on building out the custom user class without some hacky stuff. Does any of the above warrant extending the auth.User? I'm thinking this isn't necessary. Would the built in Django groups and roles be an okay way to accomplish this? I'm worried about getting locked into things as our use cases become more complex. Assuming I build this out … -
Retrieving Single User Data in Django View Returns Multiple Users
i have encountered an issue with retrieving user data in my view. I have implemented a view to retrieve data for a single user using their ID. However, when I make a request to this view, instead of getting data for just the specified user, I receive data for all users in the system. def test_retrieve_custom_user(self): test_user = CustomUser.objects.create( .... ) test_user_id = test_user.id request = self.factory.get(f"/users/{test_user_id}/") force_authenticate(request, user=self.admin_user) response = self.view(request, pk=test_user_id) print(response.data) print(response.data) The print(response.data) statement outputs data for multiple users, even though I expect to retrieve data for only the user with the specified ID (test_user_id). ...[OrderedDict([('id', 6), ('password', 'pbkdf2_sha256$720000$eUORH8514yvMMuVwQ3m19Q$VId/VYtfaFqVu3fDIxDBXpENptb06tsVtH6qWxpsB0Y='), ('last_login', None), ('is_superuser', True), ('username', 'superuser'), ('first_name', ''), ('last_name', ''), ('email', 'superuser@email.com'), ('is_staff', True), ('is_active', True), ('date_joined', '2024-02-29T22:36:57.909754Z'), ('groups', []), ('user_permissions', []), ('address', None), ('phone_number', None)]), OrderedDict([('id', 7), ('password', 'testpassword'), ('last_login', '2024-02-29T00:00:00Z'), ('is_superuser', False), ('username', 'existinguserew123123'), ('first_name', 'Test'), ('last_name', 'User'), ('email', 'test@example.com'), ('is_staff', False), ('is_active', True), ('date_joined', '2024-02-29T00:00:00Z'), ('groups', []), ('user_permissions', []), ('address', 4), ('phone_number', 4)]), OrderedDict([('id', 8), ('password', 'testpassword'), ('last_login', '2024-02-29T00:00:00Z'), ('is_superuser', False), ('username', 'existinguseresadw123123'), ('first_name', 'Test'), ('last_name', 'User'), ('email', 'test@example.com'), ('is_staff', False), ('is_active', True), ('date_joined', '2024-02-29T00:00:00Z'), ('groups', []), ('user_permissions', []), ('address', 4), ('phone_number', 4)])]```