Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
swagger not working after deploying to vercel
When deploying my code I see this under the /docs endpoint (swagger) https://python-django-project.vercel.app/docs - link My settings.py: from pathlib import Path BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = "django-insecure-rjo^&xj7pgft@ylezdg!)n_+(6k$22gme@&mxw_z!jymtv(z+g" DEBUG = True INSTALLED_APPS = [ "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", "api.apps.ApiConfig", "rest_framework_swagger", "rest_framework", "drf_yasg", ] SWAGGER_SETTINGS = { "SECURITY_DEFINITIONS": { "basic": { "type": "basic", } }, "USE_SESSION_AUTH": False, } REST_FRAMEWORK = { "DEFAULT_PARSER_CLASSES": [ "rest_framework.parsers.JSONParser", ] } MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", "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 = "app.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", ], }, }, ] APPEND_SLASH = False WSGI_APPLICATION = "app.wsgi.app" # Normalnie te zmienne bylyby w plikach .env na platformie vercel DATABASES = { "default": { "ENGINE": "", "URL": "", "NAME": "", "USER": "", "PASSWORD": "", "HOST": "", "PORT": 00000, } } ALLOWED_HOSTS = ["127.0.0.1", ".vercel.app", "localhost"] # Password validation # https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators 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", }, ] # Internationalization # https://docs.djangoproject.com/en/4.2/topics/i18n/ LANGUAGE_CODE = "en-us" TIME_ZONE = "UTC" USE_I18N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.2/howto/static-files/ STATIC_URL = "static/" # Default primary … -
Razorpay API Request Error - Emojis Causing Internal Server Error (500) and Bad Request (400)
I'm encountering an issue with Razorpay API requests in my web application. When emojis are included in the API request data, I'm receiving "Internal Server Error (500)" and "Bad Request (400)" responses from Razorpay. I suspect that the emojis in the data are causing the problem, as the error message suggests. However, I'm not sure how to handle this issue effectively. I am getting a 500 Internal Server Error when I send emojis in my API request. The error message says: This error occurs when emojis are sent in the API request. We are facing some trouble completing your request at the moment. Please try again shortly. Check the API request for emojis and resend. These errors are print in the browser console 1} checkout.js:1 Unrecognized feature: 'otp-credentials'. 2} GET https://browser.sentry-cdn.com/7.64.0/bundle.min.js net::ERR_BLOCKED_BY_CLIENT 3} Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently 4} checkout.js:1 POST https://lumberjack-cx.razorpay.com/beacon/v1/batch?writeKey=2Fle0rY1hHoLCMetOdzYFs1RIJF net::ERR_BLOCKED_BY_CLIENT 5} checkout-frame.modern.js:1 Error: <svg> attribute width: Unexpected end of attribute. Expected length, "". 6} checkout-frame.modern.js:1 POST https://api.razorpay.com/v1/standard_checkout/payments/create/ajax?session_token=1195957E22CEDC68FA41546EAFCB32822446AFCE189C65DEEA3D65FD8A5954842A4CC50914376849E37749EDAC80962106F2D99A99F0DAA2D1745E12FEBA19FEF4AC340FEC0AF9C18340A00E7828A099572C469DAF2518EA61D0369B75A7AEAF8BF61EEE979B536EF040F8E777EDFE695FEF10951EE8EA0B49E9DED09695E32582159FA5A03EE334DD16116CC22B759BB98C 500 (Internal Server Error) I'm using Razorpay for payment processing, and I have both JavaScript and Python code involved. Here's a simplified overview of my code: HTML/JavaScript (Frontend): … -
How do I get a .USDZ file to automatically open in iOS quicklook without the need to click on an image
I am currently serving my .USDZ model from django and have the following view. def download(request, id): file_path = os.path.join(settings.MEDIA_ROOT, 'files/{0}.usdz'.format(id)) if os.path.exists(file_path): with open(file_path, 'rb') as fh: response = HttpResponse(fh.read(), content_type="model/usd") response['Content-Disposition'] = 'inline; filename=' + os.path.basename(file_path) return response raise Http404 This page is accessed through a QR code but when the code is scanned with an i-phone the page opens and displays an image of a 3D cube. The picture then needs to be clicked in order to start the AR. Is it possible to automatically start the quicklook AR without needing to click on the image? Not sure if it would be possible with hosting the link on a page then using javascript to automatically click the link? -
Can't make post from template
Can't make post from template, but can from admin panel.... and i wanna fix it so I can make post from template, there is no error in console... Help needed. template/create_post.html {% extends 'base.html' %} {% load crispy_forms_tags %} {% block content %} <h1 style="text-align:center; margin-block:50px; color:red;">Hey {{user}}, Write something</h1> <form method="POST" action="." enctype="multipart/form-data" style="margin-left:150px;"> {% csrf_token %} {{form|crispy}} <input type="submit" value="Save" style="margin-block:50px;"> </form> {% endblock content %} main/views.py from .forms import PostForm from django.contrib.auth.decorators import login_required @login_required def create_post(request): context = {} form = PostForm(request.POST or None) if request.method == "POST": if form.is_valid(): author = Author.objects.get(user=request.user) new_post = form.save(commit=False) new_post.user = author new_post.save() return redirect("home") context.update({ "form": form, "title": "Create New Post", }) return render(request, "create_post.html", context) main/urls.py from django.urls import path from .views import home, detail, posts, create_post, latest_posts urlpatterns = [ path("", home, name="home"), path("detail/<slug>/", detail, name="detail"), path("posts/<slug>/", posts, name="posts"), path("create_post", create_post, name="create_post"), path("latest_posts", latest_posts, name="latest_posts"), ] main/forms.py from django import forms from .models import Post class PostForm(forms.ModelForm): class Meta: model = Post fields = ["title", "content", "categories", "tags"] Earlier it was working, but I make some mistake and now it is not... last time there was some errors but I fixed them just by modify slug … -
Trying to find out total no of votes, but could not understand how it is done in serializers. I'm new to django, How is it done?
Here is my model : class Answer(models.Model): question = models.ForeignKey(Question, on_delete=models.CASCADE, related_name='answers') answer = models.CharField(max_length=1000, default="", blank=False) author = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) createdAt = models.DateTimeField(auto_now_add=True) upVotes = models.IntegerField(default=0) downVotes = models.IntegerField(default=0) def __str__(self): return str(self.answer) Here is the serializer: class AnswerSerializer(serializers.ModelSerializer): votes = serializers.SerializerMethodField(method_name='get_votes', read_only=True) class Meta: model = Answer fields = ('id', 'question', 'answer', 'author', 'createdAt', 'votes') def get_votes(self, obj): if obj.upVotes and obj.downVotes: total_votes = (obj.upVotes + obj.downVotes) return total_votes Here is my upVote view : @api_view(['POST']) @permission_classes([IsAuthenticated]) def upvote(request, pk): answer = get_object_or_404(Answer, id=pk) author=request.user voter = upVote.objects.filter(author=author, answer=answer) if voter.exists(): return Response({ 'details':'You cannot vote twice' }) else: upVote.objects.create( answer=answer, author=author ) answer.upVotes += 1 answer.save() return Response({ 'details':'Vote added' }) How to find total number of votes and that should be directed to answers model. How to do this kind of operations in serializers? -
Django Form List Value Multiple Choice in Form based on values in other fields in same form
I have a problem in Django Form Basically I am developing a Form which shows the following information: Date From Date To Client Select Jobs to be reviewed: Now i have a model where the jobs are linked to a clients and the jobs have a date when they were created and when they were terminated. I would like that in the form as soon as the user inputs the date from of the review and Date To of the review and the client in question by default a list of jobs will be displayed for the user to select. The list of jobs is based between the active jobs during the period selected and also the client. Is there a way to achieve this dynamically in the same form in Django ? Any ideas how to achieve it? I tried using ChainedManyToManyField so that based on the client selected in same form the list of jobs would be displayed and I succeeded. The problem is that i do not know how to also filter by the job creation date and job terminated date ? -
Celery' pytest fixtures don't work as expected during http request
everyone. Probably I'm missing somethig on how to use celery' pytest fixtures during a test that involves a task execution during an http request. Celery' docs that shows the pytest integration: https://docs.celeryq.dev/en/v5.3.4/userguide/testing.html#pytest Using 'celery_session_app' and 'celery_session_worker' fixtures I can directly call the task and use wait() or get() to wait for task execution. Sample code for this case: from django.core import mail from django.test import TestCase from polls.tasks import task_send_mail @pytest.mark.usefixtures('celery_session_app') @pytest.mark.usefixtures('celery_session_worker') class SendMailTestCase(TestCase): def test_send_mail(self): task: AsyncResult = task_send_mail.delay( email_address='mail@mail.org.br', message='Hello' ) # waits for task execution that just sends a simple mail using # from django.core.mail import send_mail task.get() # it passes because the code waited for mail send self.assertEqual(len(mail.outbox), 1) However, if I call the same task inside a django view, the task is executed assynchronous and the test fails because the assert is tested before the mail is sent. # view from rest_framework import serializers from rest_framework.generics import ListAPIView from rest_framework.response import Response from django.contrib.auth.models import Group from polls.tasks import task_send_mail class GroupSerializer(serializers.ModelSerializer): class Meta: model = Group fields = ['__all__'] class GroupView(ListAPIView): http_method_names = ["get"] queryset = Group.objects.all() serializer_class = GroupSerializer def get(self, request, *args, **kwargs): # task is sent to async execution task = … -
Como resolver os erros de time zone?
ValueError: ZoneInfo keys must be normalized relative paths, got: America/ [31/Oct/2023 10:51:57] "GET /admin/login/?next=/admin/ HTTP/1.1" 500 59 Já instalei a biblioteca tzdata e certifiquei que o arquivo de fuso horário para UTC-3 esteja instalado. Me certifiquei de que a configuração TIME_ZONE esteja definida para a chave de fuso horário normalizada. -
Integration of angular template with Django
I'm a complete beginner in both Django and Angular, and I have an existing Angular project or a purchased Angular template. I want to integrate this Angular frontend with my Django application. Could you please provide step-by-step guidance on how to achieve this integration, considering my beginner-level knowledge in both Django and Angular? I'm using VS Code for Angular and IntelliJ for Django. I need a detailed explanation in simple and understandable terms. Iam able to lauch angular and django project successfully. -
Djnago admin custom form with uploading data
I've a question. I need to add second functionality to may Django Administration panel: I have 2 models (City and Region), one Region has many Cities in it; In my admin panel I want to add excel file with cities list when I'm creating new Region models.py class City(models.Model): name = models.CharField('Город', max_length=50, unique=True) slug = models.SlugField(max_length=50, unique=False, blank=True, null=True) city_latt = models.CharField('Широта', max_length=50, blank=True, null=True) city_long = models.CharField('Долгота', max_length=50, blank=True, null=True) country = models.CharField('ISO код страны', max_length=5) class Meta: verbose_name = 'Город' verbose_name_plural = 'Города' def __str__(self): return self.name class Canton(models.Model): """ Canton list """ canton_name = models.CharField('Название', max_length=255, blank=False) canton_city = models.ManyToManyField(City, verbose_name='Города', blank=False) canton_code_for_map = models.CharField('Код для карты', max_length=20, null=True, blank=True, default=None) canton_shortify = models.CharField('ISO обозначение', max_length=3, null=True, blank=True) country = models.CharField('ISO код страны', max_length=5) slug = models.SlugField('url', max_length=255, unique=True, blank=True) def __str__(self): return self.canton_name def get_cities(self): return ", ".join([c.name for c in self.canton_city.all()]) get_cities.short_description = "Города" get_cities.admin_order_field = 'canton_city' class Meta: verbose_name = 'Территориальные еденицы' verbose_name_plural = 'Территориальные еденицы' so how I can create custom form in my admin where I can upload file and than assign specific Region to uploaded cities? now my admin for Regions looks like this: admin.py class CantonForm(forms.ModelForm): canton_city = forms.ModelMultipleChoiceField(queryset=City.objects.order_by('name'), … -
AuditLog rows have a wrong timezone in timestamp column
I installed AuditLog according to the documentation. Changes are being logged just fine and are save to DB with the right timezone (UTC+6). But when I browse them in admin panel, they come in UTC+0 timezone. Any common ways to fix this? How to change the tz in records stored by the usage of django-auditlog in django admin panel This did not help. -
Display Output von Python subprocess in HTML
I created a website with Django. Various suprocesses are started via a Python script, from which I would like to see the output displayed on my website. This is my python script "example.py" result = subprocess.Popen(<Command>, stdout=subprocess.PIPE) Now i want to display the Output in HTML. I also dont reall know which item i should use to display. However, I don't know how this works and haven't found the right answer yet. -
AWS Lambda: deterministic=True requires SQLite 3.8.3 or higher
I have a website already hosted on AWS Lambda and testing to see if the api works. But when I run it on the website it gives me the error. NotSupportedError at /api/ deterministic=True requires SQLite 3.8.3 or higher Request Method: GET Request URL: https://2dx7zf9yt5.execute-api.us-east-1.amazonaws.com/dev/api/ Django Version: 4.2.4 Exception Type: NotSupportedError Exception Value: deterministic=True requires SQLite 3.8.3 or higher Exception Location: /var/task/django/db/backends/sqlite3/_functions.py, line 45, in register Raised during: blog_api.views.PostList Python Executable: /var/lang/bin/python3.11 Python Version: 3.11.6 Python Path: ['/var/task', '/opt/python/lib/python3.11/site-packages', '/opt/python', '/var/lang/lib/python3.11/site-packages', '/var/runtime', '/var/lang/lib/python311.zip', '/var/lang/lib/python3.11', '/var/lang/lib/python3.11/lib-dynload', '/var/lang/lib/python3.11/site-packages', '/opt/python/lib/python3.11/site-packages', '/opt/python', '/var/task'] Server time: Tue, 31 Oct 2023 12:14:06 +0000 I saw a different related question that shows me that I have to install pysqlite3, but I keep ending up with the error ERROR: Failed building wheel for pysqlite3 Even when I installed the wheel, setuptools and cmake. I am running Python3.11.3 I am hoping to learn django from this experience hosting on awls but its abit tough. -
QuerySet object has no attribute _meta showing
'QuerySet' object has no attribute '_meta' def bugtracker_add(request): if request.method == "POST": try: project_id = Project.objects.get(id=project) users_created_by = Users.objects.filter(id=request.session['user_id']).filter(~Q(status=2)) # when filtering we need to pass in array list [] it will save default in database we not passing any request.post.get. Just passing through instance how login and save id by passing array list assigned_users_id = Users.objects.get(id=assigned_to) report_users_id = Users.objects.get(id=bugtracker_report_to) bugtracker_details = BugTracker.objects.create(name=name, project=project_id, priority=priority, assigned_to=assigned_users_id, report_to=report_users_id, status=status, description=description, created_by=users_created_by[0]) bugtracker_details.save() bug_id = BugTracker.objects.get(id=bugtracker_details.id) users_updated_by = Users.objects.filter(id=request.session['user_id']).filter(~Q(status=2)) bughistory_details = BugHistory.objects.create(bug_tracker=bug_id, status=bugtracker_details.status, updated_by=users_updated_by[0]) bughistory_details.save() if bugtracker_details: sender = BugTracker.objects.filter(created_by=request.session['user_id']).filter(~Q(status=2)).filter(~Q(status=4)) assigned = Users.objects.filter(id=assigned_to) print(assigned) for ass in assigned: assign = ass.user.id print(assign) receiver = User.objects.get(id=assign) sended = bugtracker_details.created_by message = f'Hello to you assigned BugTracker by {sended.first_name}' print(message) notify.send(sender, recipient=receiver, verb='Message', description=message) except Exception as e: print(e) return redirect("pms_project:bugtracker_list") try: project_data = Project.objects.values('id', 'name').filter(~Q(status=2)) users_data = Users.objects.values('id', 'first_name').filter(~Q(status=2)) users_report_data = Users.objects.values('id', 'first_name') return render(request, 'bugtracker/add.html', {"project_id": project_data, 'users_id': users_data, 'users_report_id': users_report_data}) except Exception as e: print(e) return render(request, 'bugtracker/add.html', {}) not getting where to change in my app i am using with out app name I have stored with model name in database. when written to send notification from custom model to user model at reciptient gettting insingle instances only but. still … -
Django don't load imports
I have a trouble. One of my computers (mac) have a problem. All those imports are don't load. But another pc has no this bug Already try to reinstall vs code, it's not helped me -
Is there any way to create and save pyrogram account session using django?
I wonder, if there any way to create sessions for multiple accounts of telegram using pyrogram on Django framework. I want to create django app, that registers users and users register their own telegram accounts and use their telegram accounts to manage their chats, messages and so on. I've tried with pyrogram, but pyrogram authorizing through terminal. I should do authorizing on Django -
on django admin panal dashboard, I want to customize to display charts by using charts.js. how can i send context data to it
I am editing admin panal dashboard. I want to display charts using chart.js. but how can I send context data to the template I am overriding? -
ImportError: No module named bootstrap_form
ubuntu 16.04 python 2.7 Django 1.8 I have bootrstrap_form/ package inside project directory /app/django_jblog/settings.py INSTALLED_APPS = ( ... 'bootstrap_form' ) root@project:/app# /app/manage.py runfcgi Traceback (most recent call last): File "/app/manage.py", line 11, in <module> execute_from_command_line(sys.argv) File "/app/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line utility.execute() File "/app/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 312, in execute django.setup() File "/app/env/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/app/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/app/env/local/lib/python2.7/site-packages/django/apps/config.py", line 86, in create module = import_module(entry) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) ImportError: No module named bootstrap_form directory structure: I'm running inside Docker contianer. All dependencies installed using virtualenv -
Vue.js returning blank values in the select option tag
I have this code line in my profie.html that is suppose to show the division dropdown values using vue.js v-for and {{ val.division_name }}. Instead this code returns a dropdown values that are blank, but I can tell there are values being rendered by the dropdown, it is just blank values. <select name="division_id" class="form-control form-select" id="division-id" aria-label="Default select example" v-model="formData.division_id" @change="onDivisionChange" required> <option value="0">Select Division</option> <option v-for="val in divisionListVue" :value="val.id">{{ val.division_name }}</option> </select> This is my custom-vue.js const app = Vue.createApp({ data() { return { divisionListVue: [], // Initialize divisionList with an empty array calendarListVue: [], // Initialize calendarList with an empty array formData: { division_id: 0, // Initialize division_id with 0 division_name: '', // Initialize with an empty string calendar_id: null, // Initialize calendar_id with 0 calendar_name: '', // Initialize with an empty string }, }; }, methods: { showModal() { // Show the Bootstrap modal by selecting it with its ID and calling the 'modal' method // $('#myModal').modal('show'); $("#modal1").modal('show'); // Show the modal on page load }, // Function to fetch division data fetchDivisionData() { fetch('/users/api/divisions/') // Replace with the actual API endpoint .then(response => response.json()) .then(data => { console.log(data); this.divisionListVue = data; console.log(this.divisionListVue); }) .catch(error => { … -
self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) AssertionError: 404 != 204
I have this simple unit test class DeletePersonViewTest(TestCase): def setUp(self): self.client = APIClient() self.test_user = {'phone_number': '508304389', 'name': 'testArwa', 'password': 'testpassword'} self.user = User.objects.create_user(**self.test_user) self.client.force_authenticate(user=self.user) self.client_profile, created = ClientProfile.objects.get_or_create(user=self.user) self.test_person = {'name': 'testPerson', 'profile': self.client_profile} self.test_person_instance = Person.objects.create(**self.test_person) self.user_pk = self.test_person_instance.pk self.url = reverse('delete_persons', args=[self.user_pk]) def test_200(self): response = self.client.delete(self.url) self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) and here is the path path('accounts/profile/delete/persons/<pk>', accountsViews.DeletePersonView.as_view(),name='delete_persons'), but I got this error self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) AssertionError: 404 != 204 anyone can help me fixing it please ? -
Django Asyc function execution
I am trying to execute the functions in async mode using Django DRF APIView, so that the API returns the response instantly. I am using Django 4.1.12, adrf for async View. Below is the code : import asyncio from asgiref.sync import sync_to_async from adrf.views import APIView def sensitive_sync_function(): count = 0 while True: count = count + 1 print("Running in Async mode !") time.sleep(1) if count == 10: print("Processing done !") break return None class AsyncGroupManagementView(APIView): async def get(self, request, format=None): async_function = sync_to_async(sensitive_sync_function) return Response(response, status=status.HTTP_200_OK, headers=headers) The Api call executes successfully and returns response, but I am not sure if the sensitive_sync_function() executed or not as I am not able to see any logs on terminal. Do I have to explicitly execute this task later ? My end goal is to run the function in async mode, so the API response is returned and the function keeps on executing in background. Is this the correct approach or should I use celery here ? Any AWS cloud based solution for this scenario are also welcomed ! -
Django many to many field returns empty query set even after it has the the elements
this is my models.py and I add values in my admin panel and its showing values in admin panel but if I print the size_variant object it returns query set '[]'. class ColorVariant(BaseModel): color_name = models.CharField(max_length=100) price = models.IntegerField(default=0) def __str__(self) -> str: return self.color_name class SizeVariant(BaseModel): size_name = models.CharField(max_length=10) price = models.IntegerField(default=0) def __str__(self) -> str: return self.size_name class Product(BaseModel): product_name = models.CharField(max_length=100) slug = models.SlugField(unique=True,null=True,blank=True) category = models.ForeignKey(Category,on_delete=models.CASCADE,related_name="products") original_price = models.IntegerField() discounted_price = models.IntegerField() product_description = models.TextField() color_variant = models.ManyToManyField(ColorVariant,blank=True) size_variant = models.ManyToManyField(SizeVariant,blank=True) def save(self, *args, **kwargs): self.slug= slugify(self.product_name) super(Product,self).save(*args,**kwargs) def __str__(self) -> str: # return self.product_name this is my views.py def get_product(request,slug): product_obj = Product.objects.get(slug=slug) print(product_obj.size_variant.all()) product_images = ProductImage.objects.filter(product__slug=slug) return render(request,'products/product.html',{'product_images':product_images,'product_obj':product_obj}) after running this its shows "<QuerySet []>" how can I do it ?? -
How to enable right click in a new tab but normal clicking (left-click) redirects to new page using the same tab?
I am using a form in my project having multiple pages to fill information, these below are some of the items in my left side menu to switch to different pages while filling the form. So currently I am using the functionality to redirect the page on the same tab when clicking on any of these items. But when I right click, open in new window or new tab window doesn't appear. I want to enable open in a new tab only when right clicking on these items. <li id="arrival_button" class="nav-item w-100 side_bar_buttons"> <a onclick="save_and_redirect('mainform','arrival_information')" class="nav-link align-middle px-0 black_color"> <span class="ms-1 d-sm-inline">Arrival Information</span> </a </li> <li id="food_drinks_button" class="nav-item w-100 side_bar_buttons"> <a onclick="save_and_redirect('mainform', 'food_and_drinks');" class="nav-link align-middle px-0 black_color"> <span class="ms-1 d-sm-inline">Food & Drinks</span> </a> </li> <li id="guest_button" class="nav-item w-100 side_bar_buttons"> <a onclick="save_and_redirect('mainform', 'guest_req');" class="nav-link align-middle px-0 black_color"> <span class="ms-1 d-sm-inline">Guest Requirements</span> </a> </li> I already know about using target="_blank" with tags in Django but obviously like I already explained I dont want to use this functionality to always open them in a new tab only when I want to right click on them. -
Exploring the Replication of Odoo.sh Features and Building a Web Application (Django)
I'm interested in replicating the features of odoo.sh. Could anyone provide any valuable resources or links to assist in this endeavor? I've discovered a script that partially automates odoo.sh features, but I intend to create a comprehensive web application (using Python/Django) for this purpose. Is this feasible, and where should I begin? Is there a way to explore the source code of odoo.sh or gain insights into its architecture? Additionally, what other technology stack components should I be familiar with besides Python/Django, Docker, and basic cloud and system administration (e.g., Docker, AWS, etc.)? -
Real Time Search in django Rendered Templetes
Project Details:- template is rendered by using pagination in django view . I used for loop in Templete (only for tr that contains td ) to display all results within the html table. Pagination Logic is added to templete below the table tag. There are various columns in table . I want to Implement Real Time Search Functionlty to a table Rendered by django. Also , search should me made from all pages. And Only that entries should be shown which contains that string fron search box.