Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django-tenant “No tenant for hostname” error
I was able to create a schema (and I confirmed this via database) but for some reason, I am getting a Can't create tenant outside the public schema. Current schema is error when creating schema and then also I am getting this error No tenant for hostname when I try to visit the tenants domain and I am not sure what is causing it. Below is my code: views.py def post(self, request): form = CreatePortalForm(request.POST) if form.is_valid(): getDomain = form.cleaned_data.get('name') instance = form.save(commit=False) user_id = request.user.id user = User.objects.get(id=user_id) tenant = Client(schema_name=getDomain, name=getDomain, created_by=user) tenant.save() domain = Domain() domain.domain = getDomain + ".example.com:8000" domain.tenant = tenant domain.is_primary = True domain.save() with schema_context(tenant.schema_name): instance.save() redirect = 'http://' + getDomain + '.example.com:8000' return HttpResponseRedirect(redirect) return render(request, "registraton/create_portal.html", {"form": form}) For example, I have created three schemas: tenant1 tenant2 tenant3 All three tenants have created the tables in the database, but I get the Can't create tenant outside the public schema. Current schema is error when running the above script to create the schema and domain or I get the No tenant for hostname when trying to visit the tenants domain. Like I said, the schema is creating and migrating successfully but I … -
How to check color and size of product variants in Template Django
It's duplicating the color options according to the variants, I need it to be only one if it exists. Django Admin Models: class Variants(TimeStampedModel): product = models.ForeignKey(Product, on_delete=models.CASCADE) size = models.ForeignKey(Size, on_delete=models.CASCADE, blank=True, null=True) color = models.ForeignKey(Color, on_delete=models.CASCADE, blank=True, null=True) quantity = models.IntegerField(default=0) price = models.DecimalField(max_digits=10, decimal_places=2) def __str__(self): return self.product.name Views: class ProductDetailView(DetailView): queryset = Product.available.all() def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context["variation_color"] = Variants.objects.filter(color__id=1) context["variation_size"] = Variants.objects.filter(size__id=1) return context Template: {% if product.variants_set.all %} {% if variation_color %} <div class="section"> <h6 class="title-attr" style="margin-top:15px;" ><small>Color</small></h6> <div> {% for color in product.variants_set.all %} <div class="attr" style="width:25px;background:{{ color.color.code }};"></div> {% endfor %} </div> </div> {% endif %} {% if variation_size %} <div class="section"> <h6 class="title-attr"><small>Size</small></h6> <div> {% for size in product.variants_set.all %} <div class="attr2">{{ size.size }}</div> {% endfor %} </div> </div> {% endif %} {% endif %} If anyone has any solution on this, thanks! -
Django File "<frozen importlib._bootstrap> Error
I just started djnago. Learning all it's stuff, from official django 4.0 documentation. Documentation link > https://docs.djangoproject.com/en/4.0/intro/tutorial01/ django officially installed version 4.2 python version 10 using vs-code So in this tutorial we are creating a poll application basically it will show some thing in localhot. For that I make a container name polls. the source code.. polls/views.py from django.http import HttpResponse def index(request): return HttpResponse("Hello, world. You're at the polls index.") polls/urls.py from django.urls import path import views urlpatterns = [ path('', views.index, name='index'), ] mysite/urls.py from django.contrib import admin from django.urls import include, path urlpatterns = [ path('polls/', include('polls.urls')), path('admin/', admin.site.urls), ] So After running mysql/urls.py it gives this error Traceback (most recent call last): File "a:\experimental_files\vs_code\djangoExer\mysite\mysite\tempCodeRunnerFile.py", line 5, in <module> path('polls/', include('polls.urls')), File "c:\users\yasir amin brohi\desktop\django\django\urls\conf.py", line 38, in include urlconf_module = import_module(urlconf_module) File "C:\Users\Yasir Amin Brohi\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked ModuleNotFoundError: No module named … -
Interactive drop down list django with option to add new entry
I am relatively new to django. I have made a simple app which enable a user to record details regarding a run (Activity). The user enters data such as: distance, time, route name, date ran..etc using a django ModelForm. I have a ModelForm which enables the logged on user to add an Activity to the model database. How do I get the form to add a drop down list of all the routes which are already in the model database AND add a new one if the Person is entering data about a route they haven't ran before.? class Person(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) fName = models.CharField(max_length =100) lName = models.CharField(max_length =100) weight = models.FloatField() sex = models.CharField(max_length=10) def __str__(self): return self.lName class Activity(models.Model): person = models.ForeignKey(Person, on_delete=models.CASCADE) length = models.FloatField() runTime = models.DurationField() route = models.CharField(max_length=100) ave = models.DurationField() dateRun = models.DateField() marathon = models.DurationField() def __str__(self): return self.route ``` -
How to order by queryset from another model field?
class Item(models.Model): name = models.CharField(max_length=255) user = models.ForeignKey(User) class Document(models.Model): doc_type = models.CharField(max_length=10, default="DOC") item = models.ForeignKey(Item, related_name="docs") uploaded_at = models.DateTimeField(auto_now_add=True) @api_view(["GET"]) def get_items(request): # docs__uploaded_at should be from objects having doc_type="DOC" only doc = Document.objects.filter(item=item, doc_type="DOC") items = Item.objects.prefetch_related("docs").filter(user=request.user).order_by("docs__uploaded_at") Here I want to order items queryset based on document uploaded_at field having doc_type="DOC" only. -
DJANGO ModuleNotFound: INSTALLED_APPNAME during gunicorn wsgi deployment
I'm setting up a wsgi.py and DockerFile to deploy my django app in DigitalOcean, but I'm getting the following errors during deployment phase after successful build. I have django apps created by manage.py startapp XXX each named 'users' and 'documents'. From the error trace, I think there is a problem with the path since it is not detecting the apps from my "INSTALLED_APPS" config. Error Log -07-31 05:49:23] File "/code/scraft-server/wsgi.py", line 14, in <module> [2022-07-31 05:49:23] from configurations.wsgi import get_wsgi_application # noqa [2022-07-31 05:49:23] File "/usr/local/lib/python3.8/site-packages/configurations/wsgi.py", line 8, in <module> [2022-07-31 05:49:23] application = get_wsgi_application() [2022-07-31 05:49:23] File "/usr/local/lib/python3.8/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application [2022-07-31 05:49:23] django.setup(set_prefix=False) [2022-07-31 05:49:23] File "/usr/local/lib/python3.8/site-packages/django/__init__.py", line 24, in setup [2022-07-31 05:49:23] apps.populate(settings.INSTALLED_APPS) [2022-07-31 05:49:23] File "/usr/local/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate [2022-07-31 05:49:23] app_config = AppConfig.create(entry) [2022-07-31 05:49:23] File "/usr/local/lib/python3.8/site-packages/django/apps/config.py", line 223, in create [2022-07-31 05:49:23] import_module(entry) [2022-07-31 05:49:23] File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module [2022-07-31 05:49:23] return _bootstrap._gcd_import(name[level:], package, level) [2022-07-31 05:49:23] ModuleNotFoundError: No module named 'users' file tree monorepo ├── README.md ├── __init__.py ├── backend-server │ ├── users //(created with startapp) │ ├── documents //(created with startapp) │ ├── config │ │ ├── common.py │ │ ├── local.py │ │ ├── production.py │ ├── … -
django url from a django app is giving 404 error
demo > url.py (This is main django project url file) from django.contrib import admin from django.urls import path, include from . import views urlpatterns = [ path('admin/', admin.site.urls), path('', views.home, name='home'), path('about', views.about, name='about'), path('contact', views.contact, name='contact'), path(r'^user/', include('user.urls')), ] user > url.py (this is a user app inside django project's url file) from django.urls import path from . import views urlpatterns = [ path(r'^/login', views.login, name='login'), ] now i am trying to open http://127.0.0.1:8000/user/login but its giving me 404 error. -
PasswordResetTokenGenerator.make_token() missing 1 required positional argument: 'user'
message2 = render_to_string('email_confirmation.html',{ 'name': myuser.first_name, 'domain': current_site.domain, 'uid': urlsafe_base64_encode(force_bytes(myuser.pk)), 'token': generate_token.make_token(myuser) }) this is my code and I get the above error message -
I can access mysql machine remotely but when I try to access via Django webserver it just hangs and gives a Error 524
I had a django app deployed on an EC2 machine with a databse on another EC2 machine. I recently had to switch IP address on the mysql machine and this has caused me a lot of issues. I changed the configuration files to match the new IP but I can't seem to get any db queries to work now on production. I have tried to remote access mysql from the production webserver using mysql -u prod_user -h 11.11.111.111 -p which works no problem. my webapp is still up and running and have no issues with it until I try to login or use any database queries. my firewall rules on the database machine have been updated to allow access to prod server so I dont think it is anything to do with that. I have checked the mysql logs and the only message I am getting is /usr/sbin/mysqld: ready for connections. Version: '8.0.30-0ubuntu0.20.04.2' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu) I have checked the apache logs and got this error - [ssl:info] [pid 133609:tid 140579564345088] (70014)End of file found: [client 333.333.33.33:33333] AH01991: SSL input filter read failed. And I don't recognise the above client IP that is referred to but I think … -
Try to remove an item from a cart
trying to create a shopping cart application and currently stuck trying to remove a single item from a cart. I can't seem to work out how to remove a single product as currently it removes all of a product ID using the remove function. This is models.py file: from django.db import models from django.urls import reverse from e_boutique.settings import AUTH_USER_MODEL class Product(models.Model): name = models.CharField(max_length=128) slug = models.CharField(max_length=128) price = models.FloatField(default=0.0) stock = models.IntegerField(default=0) description = models.TextField() thumbnail = models.ImageField(upload_to="products", blank=True, null=True) def __str__(self): return self.name def get_absolute_url(self): return reverse('product', kwargs={"slug":self.slug}) class Order(models.Model): user = models.ForeignKey(AUTH_USER_MODEL, on_delete=models.CASCADE) product = models.ForeignKey(Product, on_delete=models.CASCADE) quantity = models.IntegerField(default=1) ordered = models.BooleanField(default=False) def __str__(self): return f"{self.product.name} ({self.quantity})" class Cart(models.Model): user = models.OneToOneField(AUTH_USER_MODEL, on_delete=models.CASCADE) orders = models.ManyToManyField(Order) ordered = models.BooleanField(default=False) ordered_date = models.DateTimeField(blank=True, null=True) def __str__(self): return self.user.username and this is my views.py file: from django.shortcuts import get_object_or_404, redirect, render from django.urls import reverse from store.models import Cart, Order, Product def index(request): products = Product.objects.all() return render(request, 'store/index.html', context={'products': products}) def product_details(request, slug): product = get_object_or_404(Product, slug=slug) return render(request, 'store/product_details.html', context={'product': product}) def add_to_cart(request, slug): user = request.user product = get_object_or_404(Product, slug=slug) cart, _ = Cart.objects.get_or_create(user=user) order, created = Order.objects.get_or_create(user=user, product=product) if created: cart.orders.add(order) cart.save() else: … -
python django 'QuerySet' object has no attribute 'objects'
I am building a website using Python django. But, an error occurs while loading data using django ORM What's the problem? model.py class contact(models.Model): class Meta: db_table="contact" target = models.CharField(max_length=15) team = models.CharField(max_length=15) name = models.CharField(max_length=10) email = models.CharField(max_length=30) view.py @login_required(login_url='common:login') def contact_list(request): global contact contact = contact.objects.values('target').annotate(count=Count('email')).order_by() context = {'contact': contact } return render(request, 'web/contact_list.html', context) contact_list.html {% if contact %} {% for group in contact %} <tr tabindex="0" class="h-16 border-b transition duration-300 ease-in-out hover:bg-gray-100"> <td> <div class="mx-5 text-sm"> {{ forloop.counter }} </div> </td> <td class=""> <div class="flex items-center pl-5"> <a class="text-sm font-medium leading-none text-gray-700 dark:text-white mr-2"> {{ group.target }} </a> </div> </td> <td class="pl-5"> <div class="flex items-center"> <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path fill-rule="evenodd" d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z" clip-rule="evenodd" /> </svg> <p class="text-sm leading-none text-gray-600 dark:text-gray-200 ml-2">{{ group.count }}</p> </div> </td> -
Django Auth works locally but not on production (Heroku)
I deployed a Django project by using Gunicore and wsgi to Heroku. I used 3 legged Twitter Oauth for authentication. Authentication works in local but not in production. I can see last login update in auth_user table, so it actually works in Django side, but It doesn't pass authorization to my React frontend. Also, sessionid cookie is created in local when logged in, but In Heroku, it also doesn't work. If you want to see any part of my code please inform me and I can update the question. I would be very appreciative if anyone can help. -
Like system in Django
I'm trying to implement a like system in Django, but I'm getting an error and this is the error: enter image description here models.py class Like(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="likes") article = models.ForeignKey(Article, on_delete=models.CASCADE, related_name="likes") created_at = models.DateTimeField(auto_now_add=True) def __str__(self): return f"{self.user.username} {self.article.Title}" class Meta: ordering = ('-created_at',) views.py def like(request, slug, pk): if request.user.is_authenticated: try: like = Like.objects.get(article__slug=slug, user_id=request.user.id) like.delete() except: Like.objects.create(article_id=pk, user_id=request.user.id) return redirect('blog:article_detail', slug) urls.py path('like/<slug:slug>/<int:pk>', views.like, name='like_article') -
Why is PUT request not updating the Django rest framework database?
I am trying to update the database using a PUT request. Currently, I am able to update the database from the Django Admin successfully but I want to do same using a PUT request. When ever I make a PUT request, I get a 200 OK response with no errors but the data is not updating in the database. I dont know why. I am confused. Someone please help me. Thank you. models.py class User_Order(models.Model): order = models.OneToOneField(Orders, on_delete=models.CASCADE) user = models.ForeignKey(User, on_delete=models.CASCADE) id = models.IntegerField(primary_key=True) shirts = models.IntegerField(default=0) shorts = models.IntegerField(default=0) trousers = models.IntegerField(default=0) total_units = models.CharField(max_length=2000, blank=True) shirts_amount = models.CharField(max_length=2000, blank=True) shorts_amount = models.CharField(max_length=2000, blank=True) trousers_amount = models.CharField(max_length=2000, blank=True) total = models.CharField(max_length=200,blank=True) verified = models.BooleanField(null=True) doing_laundry = models.BooleanField(null=True) delivery_underway = models.BooleanField(null=True) delivered = models.BooleanField(null=True) address = models.TextField(default='') time = models.DateTimeField(auto_now=True) def save(self, *args, **kwargs): self.user = self.order.user self.id = self.order.id self.shirts = self.order.shirts self.shorts = self.order.shorts self.trousers = self.order.trousers self.total_units = self.order.total_units self.shirts_amount = self.order.shirts_amount self.shorts_amount = self.order.shorts_amount self.trousers_amount = self.order.trousers_amount self.total = self.order.total self.verified = self.order.verified self.doing_laundry = self.order.doing_laundry self.delivery_underway = self.order.delivery_underway self.delivered = self.order.delivered self.address = self.order.address super().save(*args, **kwargs) def __str__(self): return f'{self.order.user.username} Order' serializers.py class UserUser_OrderSerializer(serializers.ModelSerializer): class Meta: model = User_Order fields = '__all__' views.py … -
Custom HTML layout for forms in Django
I am new to Django and I'm trying to get a grip on it. I worked my way through the documentation of forms. And the Django way is doing basically: <form action="/your-name/" method="post"> {% csrf_token %} {{ form }} <input type="submit" value="Submit"> </form> To render the according template. Fine. I can mayually render my fields: <div class="fieldWrapper"> {{ form.subject.errors }} <label for="{{ form.subject.id_for_label }}">Email subject:</label> {{ form.subject }} </div> And I can customize the rendered output of a field with widgets. class CommentForm(forms.Form): name = forms.CharField(widget=forms.TextInput(attrs={'class': 'special'})) url = forms.URLField() comment = forms.CharField(widget=forms.TextInput(attrs={'size': '40'})) So far I am using some "standard rendering mechanism" which allows me to customize things a little bit. Question: Is there any way to design the layout of a form in a more html-like way? Say instead of {{ form.subject }} - rendering a default template enriched with widget information from somewhere else in the codebase - having something like <input type="text" minlength="10" class="wiggle" value="{{form.subject.value}}>. Which for me would be a bit more straightforward. -
Ajax form not sending data in django
I am trying to send data to django without page refresh. So i am using ajax. Created a django model and form class MyModel(models.Model): text=models.CharField(max_length=100) class MyForm(forms.ModelForm): class Meta: model=MyModel fields = "__all__" Then send the form to html page via views.py def home(request): print(request.POST.get('text',False)) form = MyForm(request.POST) if request.method=='POST': print(request.POST.get('text',False)) if form.is_valid(): data=form.save() return render(request,'home.html',{'form':form}) Create a orm in html template <form action = "" id="post-form" method = "post"> {% csrf_token %} {{ form.as_p }} <input type="submit" value="submit" id="submit-button"> </form> This is javascript file $(document).on('submit','#post-form', function(x){ x.preventDefault(); console.log("button clicked") $.ajax({ type:'POST', url:'/', data:{ text:$("id_text").val(), csrfmiddlewaretoken:$('input[name=csrfmiddlewaretoken]').val() }, success:function(){ alert('Saved'); } }) } ) I am unable to find, where is the issue. -
Django modal autoimplement
Can anyone advise on how to deal with retrieving data from other models in Django? I was able to put information with the name of the company in the form, but after choosing from dropdown, I would like the tax identification number to be completed automatically. The problem is both the automatic completion and the binding and extraction of data. Model: klient_lista = Klient.objects.all().values_list("nazwa_firmy", "nazwa_firmy") class Faktura(models.Model): numer = models.CharField(max_length=260, blank=False, null=False, unique=True) klient = models.CharField(max_length=260, choices=klient_lista) NIP = models.CharField(max_length=260) kwota_netto = models.FloatField(blank=False, null=True) VAT = models.FloatField(blank=False, null=True) kwota_brutto = models.FloatField(blank=False, null=True) @login_required def Faktury(request): faktura = Faktura.objects.all() faktura_Form = Faktura_Form(request.POST or None) if faktura_Form.is_valid(): faktura_Form.save() return redirect(Faktury) return render(request, 'Faktury.html', {'form': Faktura_Form, 'faktura': faktura})` [enter image description here][1] [enter image description here][2] [1]: https://i.stack.imgur.com/hoUZw.png [2]: https://i.stack.imgur.com/DSCEj.png -
How can I manipulate Django Form fields on the run?
Might be an easy one for some but I am new to coding and have spent a day searching for the answer so reaching out. I am trying to find a way to hide a form field in the HTML when another field is selected. Specially I am asking if the stock is tracked (checkbox, default = true), if true then we want to know the stock on hand, if not then I want to remove the Stock on hand field as not relevant Thanks in advance -
Restricting choices so tree structure in preserved Django model
I have a model with a parent field that refers to itself, like so: parent = models.ForeignKey("self", null=True, blank = True ) For the root node, this field will be blank. When creating a new data instance, I want to make sure I do not add a data instance that ruins the implied tree structure. For instance, if two instances are parents of each-other. Choices for the user will be presented via a form, so I need to restrict the choices that are presented to the user, doing something like: class Meta: model = CategoryModel def __init__(self, *args, **kwargs): # Restrict choices so tree structure is not messed with self.fields['parent'].queryset = ???? What should ???? be? -
error while integrating react and django ("template doesn't exit")
i am new to django. after following a youtube video about integrating react and django following error occurs. TemplateDoesNotExist at / index.html Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 3.2.4 Exception Type: TemplateDoesNotExist Exception Value: index.html Exception Location: /home/saurav/.local/lib/python3.8/site-packages/django/template/loader.py, line 47, in select_template Python Executable: /usr/bin/python3 Python Version: 3.8.10 Python Path: ['/home/saurav/Desktop/Globle Project/django project/Navigator', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/saurav/.local/lib/python3.8/site-packages', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages'] Server time: Sun, 31 Jul 2022 06:54:31 +0000 any solutions? -
How can i change from FBV to CCBV DeleteView
in this case i've created the delete using the FBV, but i want to make some improvement using CCBV. i have 2 database in my projects, the sqlite3 as default database and mysql as 'backup' database so this is the delete function : def delete_class(request, link): if request.method == "POST": model = get_object_or_404(ClassName, link=link) model.delete() bc_model = model.objects.using('backup').get(link=link) bc_model.delete() return render(request, 'temp_/delete.html') i want to delete on both database with more clean code, anybody knows how to migrate to CCBV? -
{DRF | Django} How to get count of subjects taken by each students in "django"
I've two django models 'Students' and 'Enrollments'. The model schema for these is as below: class Students(models.Model): id = models.AutoField(primary_key=True, unique=True) name = models.CharField() class Enrollments(models.Model): enroll_id = models.AutoField(primary_key=True, unique=True) student_id = models.ForeignKey(Students, on_delete=models.CASCADE) subjects = models.charField() I'm trying to achieve the result of following sql query in Django Rest Framework, for getting number of subjects enrolled by students (individually). select s.id, s.name, count(e.subjects) as count from Students as s left outer join Enrollments as e on e.student_id_id = s.id group by s.id, s.name, e.subjects order by count asc; This query returns result like: --------------------------- | id | name | count | --------------------------- | 1 | a | 1 | | 2 | b | 0 | | 3 | c | 2 | --------------------------- Can anyone please help me acheive this kind of result. Note: I need 0 count students details also. -
Django. How can I add a widget for image input
How can I add a widget for image input. Here code in file 'forms.py' in Django project class BookForm(ModelForm): class Meta: model = Book fields = ['name', 'img'] widgets = { 'name': TextInput(attrs={ 'class': 'form-control', 'placeholder': 'Name' }) } Code in HTML: <form method="post"> {% csrf_token %} {{ form.name }}<br> {{ form.img }} <button type="submit" class="btn btn-success">submit</button> <span>{{ error }}</span> </form> -
404 error when accessing Django STATIC resources inside Docker image
This is the Dockerfile for my Django project: FROM python:3.10.5-alpine ENV PYTHONDONTWRITEBYTECODEBYDEFAULT=1 ENV PYTHONUNBUFFERED=1 RUN adduser --disabled-password appuser USER appuser WORKDIR /home/appuser/app COPY requirements.txt . USER root RUN python -m pip install --no-cache-dir --disable-pip-version-check --requirement requirements.txt USER appuser COPY . . ENTRYPOINT [ "./entrypoint.sh" ] And Django settings regarding static assets: STATIC_URL = 'static/' STATIC_ROOT = BASE_DIR / 'static/' And entrypoint.sh #!/bin/sh python manage.py makemigrations python manage.py migrate python manage.py collectstatic --no-input gunicorn project.wsgi:application --bind=0.0.0.0:8000 --workers=4 --timeout=300 --log-level=debug --log-file=- exec "$@" When I start the container I shell into it and see that static folder is created and populated with admin staff. However browsing http://127.0.0.1:8000/admin brings up the admin login page without any CSS and I get lots of 404 errors in the developer console. I also changed STATIC_ROOT to /home/appuser/app/static/ and got the same. Please assist. -
window.open() popup doesn't show anything
I have a Django website with this url that has this code in its template footer: <img referrerpolicy='origin' id = 'rgvjjxlzwlaoesgtfukzjxlz' style = 'cursor:pointer' onclick = 'window.open("https://logo.samandehi.ir/Verify.aspx?id=314061&p=xlaorfthaodsobpdgvkarfth", "Popup","toolbar=no, scrollbars=no, location=no, statusbar=no, menubar=no, resizable=0, width=450, height=630, top=30")' alt = 'logo-samandehi' src = 'https://logo.samandehi.ir/logo.aspx?id=314061&p=qftinbpdshwllymawlbqnbpd' /> which displays this image in the footer: When it is clicked, it should display a popup page like this: (this is in the footer of another website called "toplearn.com" which I just gave as an example, but it looks exactly like this page.) But it runs a blank page. Thank you for helping me find the problem