Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Problems with Django Templatetag `regroup`
When using the regroup templatetag I encountered a problem where a Queryset would produce an empty list ([]) as a result. A similar Queryset (e.g. a Set with the same columns and filters however one filtervalue differed) worked perfectly fine. My Query looks like this: GraZeichen.objects.filter(gtid__id=gtid).values("id", "findno").exclude(findno=None, formid=0).annotate(values_id=GroupConcat( "formid", separator=',')).annotate(values_en=GroupConcat("fombez_en", separator=',')) and my Template looks like this: {% regroup zeichen|dictsort:'values_de' by values_en as zeichen_by_val %} {% for valgroup in zeichen_by_val %} {{ valgroup.grouper }} ({{ valgroup.list|length }}) <div> {% for zeichen in valgroup.list %} <div> <a href="alink"> <img ...> </a> </div> {% endfor %} </div> {% endfor %} As I said it works perfectly fine for some gtids, but if I compare the printed Queryset of gtids where it worked with the ones where it did not I can see no difference. What are the cases, where regroup would return an empty list? -
djoser not requesting static files from build folder correctly for PASSWORD_RESET_CONFIRM_URL
I am using React frontend and django backend with DRF, djoser and JWT for authentication. I did npm run build in my frontend and pasted the build folder in the django project. When i did a password reset, it sends email and when i click on the link it is not rendering any page, instead it is a blank page. In python console it is printing the below api requests. [25/Oct/2022 19:26:05] "GET /password/reset/confirm/MQ/bdunk6-9b9ca4dea8ba7ff3f16f192165a380cb HTTP/1.1" 200 565 [25/Oct/2022 19:26:05] "GET /password/reset/confirm/MQ/static/js/main.2e1e85b9.js HTTP/1.1" 200 565 [25/Oct/2022 19:26:05] "GET /password/reset/confirm/MQ/static/css/main.738adac0.css HTTP/1.1" 200 565 it is adding the djoser url too for the reqeust "/password/reset/confirm/MQ/" Below is my djoser settings in my settings.py file DJOSER = { 'LOGIN_FILED': 'email', 'USER_CREATE_PASSWORD_RETYPE': True, 'USERNAME_CHANGED_EMAIL_CONFIRMATION': True, 'PASSWORD_CHANGED_EMAIL_CONFIRMATION': True, 'SEND_CONFIRMATION_EMAIL': True, 'SET_PASSWORD_RETYPE': True, 'PASSWORD_RESET_CONFIRM_URL': 'password/reset/confirm/{uid}/{token}', 'USERNAME_RESET_CONFIRM_URL': 'email/reset/confirm/{uid}/{token}', 'ACTIVATION_URL': 'activate/{uid}/{token}', 'SEND_ACTIVATION_EMAIL': True, 'PASSWORD_RESET_CONFIRM_RETYPE': True, 'SERIALIZERS': { 'user_create': 'accounts.serializers.UserCreateSerializer', 'user': 'accounts.serializers.UserCreateSerializer', 'user_delete': 'accounts.serializers.UserDeleteSerializer' }} Below is the post request i used in my frontend. export const reset_password_confirm = (uid, token, new_password, re_new_password) => async dispatch => { const config = { headers: { 'Content-Type': 'application/json' } }; const body = JSON.stringify({ uid, token, new_password, re_new_password }); try { await axios.post(`${process.env.REACT_APP_API_URL}/auth/users/reset_password_confirm/`, body, config); dispatch({ type: PASSWORD_RESET_CONFIRM_SUCCESS }); } catch (err) … -
How to show output from different methods?
I have a method that extracts the text from a file. And then I have seperate methods for filtering strings from the extracted text. But now I want to combine the seperated methods. So that I can show the filtering strings in a texfield. So this is the method that extracts the text from the file: class ExtractingTextFromFile: def extract_text_from_image(self, filename): self.text_factuur_verdi = [] pdf_file = wi(filename=filename, resolution=300) all_images = pdf_file.convert('jpeg') for image in all_images.sequence: image = wi(image=image) image = image.make_blob('jpeg') image = Image.open(io.BytesIO(image)) text = pytesseract.image_to_string(image, lang='eng') self.text_factuur_verdi.append(text) return self.text_factuur_verdi def __init__(self): # class variables: self.apples_royal_gala = 'Appels Royal Gala 13kg 60/65 Generica PL Klasse I' self.ananas_crownless = 'Ananas Crownless 14kg 10 Sweet CR Klasse I' self.peen_waspeen = 'Peen Waspeen 14x1lkg 200-400 Generica BE Klasse I' self.tex_factuur_verdi = [] self.list_fruit = ['Appels', 'Ananas', 'Peen Waspeen', 'Tomaten Cherry', 'Sinaasappels', 'Watermeloenen', 'Rettich', 'Peren', 'Peen', 'Mandarijnen', 'Meloenen', 'Grapefruit', 'Rettich'] and then I have the methods for extracting the subtext from the extracted text: class FilterText: extractingText = ExtractingTextFromFile() def __init__(self): pass self.extracting_text_from_pdf = ExtractingTextFromFile() def combine_filtered_text(self, file_name): self.filter_verdi_total_number_fruit(self, file_name) + ' ' + self.filter_verdi_fruit_name(self, file_name) #self.filter_verdi_total_fruit_cost(self, filename) def regex_fruit_cost(self, substr): return r"(?<=" + substr + r").*?(?P<number>[0-9,.]*)\n" def regex_verdi_total_number_fruit(self): return r"(\d*(?:\.\d+)*)\s*)" def filter_verdi_total_number_fruit(self, … -
Using a custom database engine with Django
I have a custom database engine for company's internal database. I have made required changes and same structure as built in sqlite. I added it inside my project at same level as settings.py and also manage.py but when I run command python manage.py makemigrations getting following error, how should I use my own database backend module ? django.core.exceptions.ImproperlyConfigured: 'testdb.django.db.backends.mydb' isn't an available database backend or couldn't be imported. https://github.com/django/django/tree/0dd29209091280ccf34e07c9468746c396b7778e/django/db/backends/sqlite3 -
Filter by property in Django Rest
I have a model with a class property, to calculate a field based on some foreign key of the model. class Company(models.Model): field_id = models.AutoField(db_column='_id', primary_key = True) ... @property def status(self): opportunities = list(self.opportunities.all()) #logic ... # return status I want to filter on that new field. I have read different points of view, and some of them says that is not possible directly in django ORM. I've found one solution but i don't know if exits one more efficient. My solution would be override the queryset in the viewset if the param is in the request. Filter by a list comprehension and getting de queryset again. My problem is that I need to get all objects, calculate the status field and iterate. def get_queryset(self): if 'status' in self.request.GET: status = self.request.GET['status'] queryset = models.Company.objects.all() objects=[obj.field_id for obj in queryset if obj.status == status] queryset = models.Company.objects.filter(field_id__in=objects) else: queryset = models.Company.objects.all() return queryset -
django forms dropdown list (ChoiceField) refresh event to update TextArea
I am new to django and using forms.form and I have a ChoiceField for which I want to write a changed/refresh event and based on specific choice I want to update a CharField How Can I achieve this? Is it mandatory to use jquery? GEEKS_CHOICES =( ("1", "Event"), ("2", "Transaction"), ("3", "Health"), ) logfile= forms.ChoiceField(choices=GEEKS_CHOICES, widget=forms.Select(attrs=. {"onChange":"myFunction();"} )) eventlogstr= "I am event" txnlogstr="I am transaction" healthlogstr="I am health" arguments= forms.CharField(widget=forms.Textarea(attrs={"rows":"5"}), initial=eventlogstr) -
Django Background Task: how to get result of the processed method?
The django background task works well, I can get the status of a completed task. But I would need to get the result of the method that has been processed via background task. The method is supposed to return a dictionary object and I don't know how to get it so I can pass it to View. Can you help me please? :) I have checked other questions here, but without success :( There is nothing helpful in Completed Tasks model.. -
Django/React: Fetching API endpoint works fine from within the application, but returns 404 when request comes from outside
So I made an React + Django app and decided to seperate it, so the backend would work just as a rest API, and frontend would send requests to it. The goal was to facilitate hosting it. As a single app it works fine. API requests are returned like so [25/Oct/2022 14:31:21] ←[m"GET /spotify/current-song HTTP/1.1" 200 236←[0m But then I seperated the frontend, installed cors headers in django to accept traffic from the react app and most of it works fine. However: the api call to fetch info from spotify API gets a response [25/Oct/2022 14:31:41] ←[33m"GET /spotify/current-song HTTP/1.1" 404 2←[0m Not Found: /spotify/current-song, even though this is the very same endpoint that worked when the call came from within the app. The API call from react app: const getCurrentSong = async () => { const song = await fetch(`${BASEURL}spotify/current-song`); if (!song.ok || song.status == 204) { return defaultSong; } const songJson = await song.json(); setSong(songJson); document.body.style.backgroundImage = `url('${songJson.image_url}')`; }; useEffect(() => { const interval = setInterval(() => { getCurrentSong(); }, 1000); setAppBackground(); getRoomDetails(); return () => clearInterval(interval); }, []); Django project urls.py: urlpatterns = [ # other, irrelevant path('spotify/', include('spotify.urls')), ] And django spotify app urls.py: urlpatterns = [ … -
Display Data in form of Table row by clicking single or multiple Checkboxes in Django
I am working on Django framework and stuck in a bad situation. I have my Data table that is fetched from database and displaying in a table form. At the end of the table there are multiple checkboxes which is used to customize the data and display the only data for which I have clicked on single or multiple checkboxes. After clicking on checkbox / checkboxes data have to display in table form. <head> <script> function getvalues() { let selected = new Array(); var chckbox = document.getElementById("tab1"); var selchk = chckbox.getElementsByTagName("input"); for(var i=0; i<selchk.length;i++) { if(selchk[i].checked) { selected.push(selchk[i].value); } } if(selected.length> 0) { document.getElementById("displayvalues").innerHTML= selected; } }; </script> </head> <body> <table border = "1"> <tr> <th> ID </th> <th> NAME </th> <th> EMAIL </th> <th> SALARY </th> <th> PHONE </th> </tr> {%for getdata in EmployeeDetails %} <tr> <td> {{getdata.id}}</td> <td> {{getdata.empname}}</td> <td> {{getdata.email}}</td> <td> {{getdata.salary}}</td> <td> {{getdata.phone}}</td> </tr> {% endfor %} </table> <table id = "tab1"> <tr> <td> {%for display in EmployeeDetails %} <input type="checkbox" value="{display.salary}}" /> {{display.salary}} {% endfor %} </td> </tr> </table> <input id="but1" type="button" value="display records" onclick="getvalues()"/> <b id="displayvalues"></b> </body> As you can see in image when I click on a checkbox and press a button it … -
Django distinct selection
i have this model: class Person: first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) sexe = models.TextChoices('M', 'F') arrival_date = models.DateField(max_length=30) reason = models.CharField(max_length=30) It turns out that the same person can be registered several times (only the arrival date and the reason change). I would like to make a query that lists distinctly persons. For example, if a person is registered many times, he will be selected only once. How can i do it ? Thanks. -
Django-viewflow query all assigned to user tasks
How to query django-viewflow for all tasks assigned to user? Probably viewflow.managers.TaskQuerySet inbox() is right place. But how to invoke it? Alternatively how to query users task from viewflow.models.Process object? -
Problem with starting a Django project in current directory?
I am trying to start a django project in my current directory. Online I found this command as a solution: django-admin startproject . ^(Also the command used by my lecturer in one of his videos) However when I enter this into my terminal I get: CommandError: '.' is not a valid project name. Please make sure the name is a valid identifier. Edit: The command works fine if I give it a valid project name and creates a new directory with the project. The '.' from my understanding is meant to signify that the project should be started in the current directory, so I don't understand why it is treating it as a name -
Django Integrity Error 1048 cannot be null
Under views.py def addcomments(request): comment_text = request.POST.get('comment') user_id = request.POST.get('user_id') name = request.POST.get('name') email = request.POST.get('email') comment = Comment.objects.create(user_id=user_id, body=comment_text, name=name, email=email) comment.save() return HttpResponseRedirect(reverse('users:detail', args=(user_id, ))) this one, from detail.html {% extends 'base.html' %} {% block title %} {{ user.user_fname }} {{ user.user_lname }} {% endblock %} {% block content %} {% if error_message %} <p class="alert alert-danger"> <strong>{{error_message}}</strong> </p> {% endif %} <div class="row"> <div class="col-lg-6"> <div class="mb-5"> <h1>{{ user.user_fname }} {{ user.user_lname }}</h1> <p class="text-muted">{{ user.user_email }}</p> <p>Position: {{ user.user_position }}</p> </div> <div class="img-responsive"> <img src="/users/media/{{user.user_image}}" alt="profile_user" class="img-rounded" width="300"> <!-- ito yung hinahanap ng search engine--> </div> <div class="btn-group mt-5"> <a href="{% url 'users:delete' user.id %}" class="btn btn-sm btn-danger">Delete</a> <a href="{% url 'users:edit' user.id %}" class="btn btn-sm btn-info">Edit</a> <a href="{% url 'users:index'%}" class="btn btn-sm btn-success">Back</a> </div> </div> <div class="col-lg-6"> <h2>Comment</h2> <p class="text-muted"> Number of comment : {{ comments_count }}</p> {% if comments_count > 0 %} {% for comment in comments %} {% if comment.active %} <p><strong>{{comment.name}}</strong> : {{comment.body}}</p> {% endif %} {% endfor %} {% endif %} <hr> <br><br><br><br><br><br> <form action="{%url 'users:addcomments'%}" method="post"> {% csrf_token %} <div class="form-group"> <label>Comment</label> <textarea name="comment" id="comment" cols="30" rows="5" class="form-control" required placeholder="Enter your comment here ..."></textarea> </div> <br> <input type="text" name="name" id="name" … -
'Posts_update' object is not iterable in django
i am just try to get data from db table and show on detail page but i am getting error -'Posts_update' object is not iterable. I have two tables posts and posts_update. in posts table i am doing CRUD operation and on each update i am adding information in posts_update table now i am trying to get information from posts_update table using mobile as a parameter but i am getting error -'Posts_update' object is not iterable. models.py from django.db import models class Posts(models.Model): title = models.CharField(max_length=200) slug = models.SlugField(unique=True) content = models.TextField() mobile = models.CharField(max_length=15,default='') class Posts_update(models.Model): title = models.CharField(max_length=200) slug = models.SlugField(unique=True) content = models.TextField() mobile = models.CharField(max_length=15,default='') urls.py from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), path('create/', views.create, name='create'), path('detail/<int:post_mobile>', views.read, name='detail'), path('delete/<int:post_id>', views.delete, name='delete'), path('update/<int:post_id>', views.update, name='update') ] views.py from django.shortcuts import render, redirect from django.template.defaultfilters import slugify from django.http import HttpResponse from django.contrib import messages from .models import Posts from .models import Posts_update def index(request): posts = Posts.objects.all() return render(request, 'index.html', { 'posts': posts }) def create(request): if request.POST: req = request.POST post = Posts(title=req.get('title'), slug=slugify(req.get('title')), content=req.get('content'), mobile=req.get('mobile')) post.save() messages.success(request, 'The record was saved successfully') return redirect('/') else: return render(request, … -
Custom User Model, Custom Authentication not working
I am a beginner in Django and I am working on a project which requires Custom user model as I Don't require is_staff, is_superuser, is_admin. So, but searching and other ways I made my own Custom user model. But it is not working and I am stuck on it for days. It will be a huge help if someone can help me with the code. settings.py AUTH_USER_MODEL = 'accounts.Usermanagement' AUTHENTICATION_BACKENDS = [ 'django.contrib.auth.backends.ModelBackend', 'accounts.backends.EmailAuthBackend', ] models.py (models + manager) #models.py class UsermanagementCustomUserManager(BaseUserManager): # create_user(username_field, password=None, **other_fields) def create_user(self,emailid,roleid,organizationid,firstname, password=None, passwordexpirydate="2022-12-12 12:00:00",createdby=0,modifiedby=0): """ Creates and saves a User with the given email, date of birth and password. """ if not emailid: raise ValueError('Users must have an email address') user = self.model( emailid=self.normalize_email(emailid), roleid = roleid, organizationid=organizationid, firstname = firstname, password=password, ) user.set_password(password) user.save(using=self._db) return user def create_superuser(self,emailid,roleid,organizationid,firstname,passwordexpirydate,password=None,createdby=0,modifiedby=0): """ Creates and saves a superuser with the given email, date of birth and password. """ user = self.create_user( emailid=emailid, roleid = roleid, organizationid=organizationid, firstname = firstname, password=password, passwordexpirydate=passwordexpirydate, ) user.save(using=self._db) return user class Organization(models.Model): organizationid = models.AutoField(db_column='OrganizationID', primary_key=True,blank=True) organizationname = models.CharField(db_column='OrganizationName', max_length=45,blank=True) def __str__(self): return self.organizationname class Meta: managed = False db_table = 'Organization' class Role(models.Model): roleid = models.AutoField(db_column='RoleID', primary_key=True,blank=True) organizationid = models.ForeignKey(Organization, … -
django-autotranslate doesn't install, returns Preparing metadata (setup.py) ... error during installation
I'm trying to install django-auto translate but it keeps telling me: Preparing metadata (setup.py) error error: subprocess-exited-with-error i've also tried older versions of the package and i keep getting errors concerning metadata setup, how can i go about this? Input: pip install django-autotranslate Output: #cmd execution after running :pip install django-autotranslate Collecting django-autotranslate Using cached django_autotranslate-1.2.0-py3-none-any.whl (10 kB) Collecting six Using cached six-1.16.0-py2.py3-none-any.whl (11 kB) Collecting goslate Using cached goslate-1.5.4.tar.gz (14 kB) Preparing metadata (setup.py) ... done Collecting polib Using cached polib-1.1.1-py2.py3-none-any.whl (20 kB) Requirement already satisfied: django in c:\users\vyktor\dev\language-translator\venv\lib\site-packages (from django-autotranslate) (4.1.2) Requirement already satisfied: sqlparse>=0.2.2 in c:\users\vyktor\dev\language-translator\venv\lib\site-packages (from django->django-autotranslate) (0.4.3) Requirement already satisfied: tzdata in c:\users\vyktor\dev\language-translator\venv\lib\site-packages (from django->django-autotranslate) (2022.5) Requirement already satisfied: asgiref<4,>=3.5.2 in c:\users\vyktor\dev\language-translator\venv\lib\site-packages (from django->django-autotranslate) (3.5.2) Collecting futures Using cached futures-3.0.5.tar.gz (25 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [27 lines of output] -
Python web app form generates excel or pdf after submit
So I have this questions and answers form in a web application, most questions are input based, there are some that are checkbox, list or a date, but most are text/number input. I want that after the submit button it generates a link to download or downloads directly after the file is written. I cannot seem to find this answer anywhere and I'll gladly appreciate some help. Code is written as Django form with python. -
Is there any reliable way to get the data from PostgreSQL according to the user interest in the Django Rest Framework?
Our Project is similar in functionality to Twitter We want to show the posts on the feed according to the user's interest based on the user's likes, shares, and comments on the posts how and where we can save the user's activities? how we can filter and get the post data using the Django QuerySet and DRF paginations for a user how we can sort the post data with the recent + interest-related data if there is any better approach that exists, then please share some details about it. Thanks in Advance! -
multiple serializers in a single ListAPIView
I have a APIView where i list the data and the same displayed data can be exported to XLS file or pdf file apart from the data which uses the same serializer fields to be displayed on the file. now i am adding a couple of new fields which needs to be on file but not displayed on website, I want to create a new serializer with all the fields along with couple of new fields for exporting them to the file ExportSerializer. class MyDataListAPIView(ListExportMixin, ListAPIView): serializer_class = MySerializer permission_classes = [IsAuthenticated] pagination_class = StandardResultsSetPagination filter_backends = (filters.OrderingFilter,) queryset = MyModel.objects.all() ordering = '-created' ordering_param = 'ordering' export_fields = ( 'number', 'issue_date_formatted', 'due_date_formatted', 'hearing_date', 'status', 'total_amount_formatted', 'amount_received_formatted', 'balance_formatted', 'unapplied_amount_sum_display', 'firm', 'last_past_due_sent_on_formatted', 'fee_amount_formatted', 'payments_formatted', ) column_header = { 'titles': [ ], 'header_title': 'Statement of Services Rendered' } I want Myserializer to be used to list the data but i want the other serializer called SecondSerializer just for exporting how can i achieve that when i am exporting the data to file i need to use SecondSerializer but when i want to just list i need Myserializer mentioned in the view -
Running LibreOffice calc inside Django website
Looking for a way to run / open an xlsx file with plots as is - inside Django. any suggestion will be consider. -
Accept physical payments for a web application
I have a building bussiness and the web application on Django related to it, does anyone know how is it possible to accept physical payments via POS terminal after interaction with a website? -
How to retain two forms data in the same view/template/page?
I have two forms and two views using the same profile.html template. When I GET/POST to the ProfileUpdateView, all of the users profile data is present. However, when I post to UserDeleteView and not select the "accountActivation" box the page renders but the user profile data which is above is empty. # urls.py from django.contrib import admin from django.urls import include, path from apps.iam.views import ProfileUpdateView, UserDeleteView urlpatterns = [ path("accounts/profile", ProfileUpdateView, name="profile_detailupdate"), path("accounts/delete", UserDeleteView, name="user_delete"), ] """ # views.py import zoneinfo from django.contrib.auth import get_user_model from django.contrib.auth import logout as auth_logout from django.contrib.auth.decorators import login_required from django.shortcuts import HttpResponseRedirect, get_object_or_404, render from django.utils import timezone from django.views.decorators.http import require_http_methods from django.views.generic import TemplateView, UpdateView from .forms import ProfileForm from .models import Profile User = get_user_model() # Homepage class HomeDetailView(TemplateView): template_name = "home.html" # Profile ## Update @login_required @require_http_methods(["GET","POST"]) def ProfileUpdateView(request): # dictionary for initial data with field names as keys context = {} # fetch the object related to passed id profile_object = get_object_or_404(Profile, id=request.user.id) # pass the object as instance in form profile_form = ProfileForm(request.POST or None, instance=profile_object) # save the data from the form if profile_form.is_valid(): profile_form.save() # add form dictionary to context context["profile_form"] = profile_form # … -
Update python 3.5 to 3.9 or 3.10 in my remote server
I have an application with django 4.1 locally, I wanted to deploy it online in my ovh Cloud server. however I can't update python on this remote server which uses version 3.5.8 (this version is old) and when I create an online django application I have version 2.2.28 How to update it? see screenshot -
Django REST multipart data converted to string
Passing a JSON + image data to a post endpoint, ends in converting part of request data to string. The part which is converted to string contains the file as well. Here is the input data: data = { "external": "90000001", "sales": [ { "total": 4, "quantities": {"xs":2, "s":4}, "product": { "type": self.type.id, "product_image": { "name": "First test files", "product_files": [ { # "file": base64.b64encode(f.read()).decode(), "file": test_file, "description": "Patterns file.", "type": "pattern_file", } ] }, }, } ], } I am sending request to my endpoint in the test in this way: res: Response = self.client.post(self.create_ext_so_url, data) It returns an error: rest_framework.exceptions.ValidationError: {'sales': [ErrorDetail(string='Must specify at least one sales', code='blank')]} Here is the sales data extracted in the run_validation(...) attrs.get("sales", []) "{'total': 4, 'quantities': {'xs': 2, 's': 4}, 'product': {'type': 1, 'product_image': {'name': 'First test files', 'product_files': [{'file': <SimpleUploadedFile: test.svg (image/svg+xml)>, 'description': 'Patterns file.', 'type': 'pattern_file'}]}}}" Here it is visible that the sales in converted to string and later it won't be available as an object/dictionary and the object won't be created, which makes it fail the test. Here is the view if someone wants to check it. @action(detail=False, methods=["POST"], url_path="create-sales") def create_sales_order(self, request: Request)-> Response: ser_class = self.get_serializer_class() ser … -
Nginx service of type LoadBalancer vs ingress (using nginx-ingress) vs ingress + nginx service of type ClusterIP
We are moving from standalone docker containers architecture to K3s architecture. The current architecture uses a Nginx container to expose multiple uwsgi and websocket services (for django). I'm reading conflicting opinions on the internet over what approach should be used. The options are: Nginx service of type LoadBalancer (Most conf from existing architecture can be reused) Nginx-ingress (All conf from existing architecture will have to be converted to ingress annotations and ConfigMap) Nginx-ingress + nginx service of type ClusterIP (Most conf from existing architecture can be reused, traffic coming into ingress will simply be routed to nginx service)