Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Appending to a JSONField using update_or_create in Django
I'm trying to efficiently append a value to a JSONField (hobbies) in a Django model using the update_or_create method. I know it is easy to do this by initially calling the update_or_create method, then I get the hobbies field, append the information and the save again. However, I want to avoid hitting the database twice. I tried using the F() expression but I'm getting django.db.utils.OperationalError: (3156, 'Invalid JSON value for CAST to DOUBLE from column history at row 1') Here's the relevant code snippet: # models.py class UserProfile(models.Model): ... hobbies = models.JSONField(default=list) user_profile, created = UserProfile.objects.update_or_create( user=user, defaults={ "hobbies": F("hobbies") + ["Music"] } ) I would really appreciate any help. Thanks -
How to multiple upload images in Django (and dispaly them as carousels)?
I would like add multiple upload images for single product page carousels (so, I need four [] (or {}?..) of images). I need multiple upload because number of photos in different product cards may be different: from 2 to 6. Now I can select multiple files to upload in the admin panel but can't save it. I have an error: TypeError at /admin/product/product/8/change/ Field 'id' expected a number but got <TemporaryUploadedFile: CON_1_mob.jpg (image/jpeg)>. Request Method: POST Request URL: http://127.0.0.1:8000/admin/product/product/8/change/ Django Version: 5.0 Exception Type: TypeError Exception Location: /home/a/.local/lib/python3.10/site-packages/django/db/models/fields/__init__.py, line 2114, in get_prep_value Raised during: django.contrib.admin.options.change_view My code: models.py: from django.db import models from django.conf import settings from multiupload.fields import MultiFileField class Product(models.Model): carousel_items = models.ManyToManyField('ProductImage', related_name='carousel_items', blank=True) carousel_items_mob = models.ManyToManyField('ProductImage', related_name='carousel_items_mob', blank=True) interior_items = models.ManyToManyField('ProductImage', related_name='interior_items', blank=True) interior_items_mob = models.ManyToManyField('ProductImage', related_name='interior_items_mob', blank=True) # many another fields def __str__(self): return self.product_full_name class ProductImage(models.Model): id = models.AutoField(primary_key=True) product = models.ForeignKey(Product, on_delete=models.CASCADE, null=True) image = models.ImageField(upload_to='product_items/%Y/%m/%d') forms.py: from django import forms from .models import Product, ProductImage from multiupload.fields import MultiFileField class CustomProductForm(forms.ModelForm): carousel_items = MultiFileField(min_num=1, max_num=10, required=False) carousel_items_mob = MultiFileField(min_num=1, max_num=10, required=False) interior_items = MultiFileField(min_num=1, max_num=10, required=False) interior_items_mob = MultiFileField(min_num=1, max_num=10, required=False) class Meta: model = Product fields = '__all__' def save(self, commit=True): … -
How automatize adding a product in stripe
i'm trying to add stripe at my django project and i need to put a custom proce every time i want to buy something. Im doing a house rental type of site so i could do 2 things: 1- Automatize the proccess, creating a script that would create a product with the exact proze of the shopping cart 2-Instead of creating a product with the price of the shopping cart, create a product everytime y add a new house to the database and then buying it all in stripe Personally i would prefer the first one but i dont know if its possible. Someone could help with this? checkout_session = stripe.checkout.Session.create( payment_method_types = ['card'], line_items = [{ 'price': total_post_gestion*100, 'quantity': 1,}] #This is what i have at the moment but stripe tells me i need to have a price tagged to a product and doesen't let me put an integer -
Django dumpdata to dump all tables without data
I have been using dumpdata in Django for a while. The fact is that dumpdata dumps all of the data including table details. Now, I have a requirement to dump all the tables without even including the data. So, that I can use this instead of the migrate Django command. The reason for not using the migrate Django command because it's taking so long to migrate DB. I have a feeling if I can successfully dump all tables without data, this would be a more optimized but not recommended way to loaddata to my DB. -
How to install packages in docker container that has already been started
I am building a django app with docker. After i`ve already built my container, I've added an ImageField to one of my models. When I ran docker-compose run web(my service name) python3 manage.py makemigrations, it gave me an error, that I have to install Pillow: web_1 | Watching for file changes with StatReloader web_1 | Performing system checks... web_1 | web_1 | Exception in thread django-main-thread: web_1 | Traceback (most recent call last): web_1 | File "/usr/local/lib/python3.12/threading.py", line 1052, in _bootstrap_inner web_1 | self.run() web_1 | File "/usr/local/lib/python3.12/threading.py", line 989, in run web_1 | self._target(*self._args, **self._kwargs) web_1 | File "/usr/local/lib/python3.12/site-packages/django/utils/autoreload.py", line 64, in wrapper web_1 | fn(*args, **kwargs) web_1 | File "/usr/local/lib/python3.12/site-packages/django/core/management/commands/runserver.py", line 133, in inner_run web_1 | self.check(display_num_errors=True) web_1 | File "/usr/local/lib/python3.12/site-packages/django/core/management/base.py", line 556, in check web_1 | raise SystemCheckError(msg) web_1 | django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues: web_1 | web_1 | ERRORS: web_1 | system.Task.image: (fields.E210) Cannot use ImageField because Pillow is not installed. web_1 | HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow". After that I tried to install with docker-compose run web python3 -m pip install Pillow, it seemed, like it installed it: Starting db ... done Creating app_web_run ... … -
django channels error: websocket connection failed
I have django project what need websocket connection to send message via django channels. i coded project and it's good in my localhost but when i deploy project in cPanel it returns WebSocket connection to 'wss://rahapeyk.com/' failed: in a browser console. settings.py ASGI_APPLICATION = 'rahapeyk.asgi.application' CHANNEL_LAYERS = { 'default': { 'BACKEND': 'channels.layers.InMemoryChannelLayer', } } asgi.py import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'rahapeyk.settings') # application = get_asgi_application() from channels.auth import AuthMiddlewareStack from channels.routing import ProtocolTypeRouter, URLRouter from social import routing application = ProtocolTypeRouter( { 'http': get_asgi_application(), 'websocket': AuthMiddlewareStack( URLRouter( routing.websocket_urlpatterns ) ) } ) routings.py from django.urls import path from social.consumers import ChatConsumer websocket_urlpatterns = [ path('', ChatConsumer.as_asgi()), ] server.js const chat = new WebSocket( 'ws://' + window.location.host + '/' ); chat.onopen = function (e) { console.log('successfully'); } chat.onclose = function (e) { console.log('unexpectedly happened'); } how to keep the websocket connection when i deploy project without any error? -
Web world wind implementation in python django [closed]
I am trying to implement web world wind through django framework. The plan is viewing some flight data on virtual globe. For that i tried to use nasa web world wind. I managed to view the index page through manage.py runserver. But the virtual globe is not coming. Any help Page is rendered from server, js controls are loading but the globe is not loading. -
Django 4, ValueError: 'MyModel' instance needs to have a primary key value before this relationship can be used
The issue is a result from the update to django 4, in prior versions the issue was not present. When performing a reverse lookup on a foreign key relation, if the object being used for the reverse look up has not been save to the db (The object has no pk) an exception is raised, ValueError: 'MyModel' instance needs to have a primary key value before this relationship can be used. For example: class Author(models.Model): name = models.CharField(max_length=100) biography = models.TextField() class Book(models.Model): title = models.CharField(max_length=200) author = models.ForeignKey(Author, on_delete=models.CASCADE) publication_date = models.DateField() new_author = Author(name='John Doe', biography='A new author') reverse_look_up = new_author.book_set.all() # this raises the issue. In django 3.2 and lower, performing this action wouldn't raise an error but rather return an empty queryset of book. You can solve this issue manually, by checking if the object has an id and then only performing the look up if it does, or by saving the object before hand, however I perform this kind of look up in numerous places and it would be difficult to do so. Would there be anyway to perform a generic fix for this, whether it be a change I can make to the model … -
Django Channels chat with one user
I completed my Django Channels. I have confusion about. How to make conversation between two user (me and user2) only. Is it possible to make conversation between only two user (me and user2) without making group If I make group than anyone can join the group and the user2 need to join the group. How can I send messages direct to the user2 -
Do repeated imports into views affect performance in a Django application?
In a situation like this: # views.py def myView(request): import something import other something.doStuff() other.doOtherStuff() return render(request, 'page.html', context) def myOtherView(request): import something import other something.doThings() other.doOtherThings() return render(request, 'page2.html', context) Is importing stuff at view-level a bad practice? Does it affect performance? # views.py import something import other def myView(request): something.doStuff() other.doOtherStuff() return render(request, 'page.html', context) def myOtherView(request): something.doThings() other.doOtherThings() return render(request, 'page2.html', context) Is this second version better/faster? -
Trying to run django project & i get this error mysql.connector.errors.ProgrammingError: 1045(28000)
I am trying to run a project i downloaded from the internet 'geymmanage' i installed all the required libraries. I have also installed mysql and sqlite3 as well (in the project settings i found sqlite3 as backend) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } } and in the views.py conn = mcdb.connect(host="localhost", user="root", passwd="", database='myproject1') I tried running the django project but it gives me this error `raise get_mysql_exception( mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Detailed Error Watching for file changes with StatReloader Performing system checks... Successfully connected to database Exception in thread django-main-thread: Traceback (most recent call last): File "/home/gedion/Downloads/gymmanagement (1)/virt/lib/python3.11/site-packages/mysql/connector/connection_cext.py", line 308, in _open_connection self._cmysql.connect(**cnx_kwargs) _mysql_connector.MySQLInterfaceError: Access denied for user 'root'@'localhost' (using password: NO) The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner self.run() File "/usr/lib/python3.11/threading.py", line 975, in run self._target(*self._args, **self._kwargs) File "/home/gedion/Downloads/gymmanagement (1)/virt/lib/python3.11/site-packages/django/utils/autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "/home/gedion/Downloads/gymmanagement (1)/virt/lib/python3.11/site-packages/django/core/management/commands/runserver.py", line 133, in inner_run self.check(display_num_errors=True) File "/home/gedion/Downloads/gymmanagement (1)/virt/lib/python3.11/site-packages/django/core/management/base.py", line 485, in check all_issues = checks.run_checks( ^^^^^^^^^^^^^^^^^^ File "/home/gedion/Downloads/gymmanagement (1)/virt/lib/python3.11/site-packages/django/core/checks/registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/gedion/Downloads/gymmanagement (1)/virt/lib/python3.11/site-packages/django/core/checks/urls.py", … -
Django signals for different apps
I need to have separate signals for each app of my project. But after saving a model in one of the apps signals trigger from all apps, so I have duplicated messages from my signals. What is the right way to set up signals for different apps of Django project? signals.py of my app1: # -*- coding: utf-8 -*- import logging from django.db.models.signals import post_save from django.dispatch import receiver from .models import * @receiver(post_save) def log_app1_updated_added_event(sender, **kwargs): '''Writes information about newly added or updated objects of app1 into log file''' logger = logging.getLogger(__name__) app1_object = kwargs['instance'] if kwargs['created']: logger.info(f'added {app1_object }') else: logger.info(f'updated {app1_object }') signals.py of my app2: # -*- coding: utf-8 -*- import logging from django.db.models.signals import post_save from django.dispatch import receiver from .models import * @receiver(post_save) def log_app2_updated_added_event(sender, **kwargs): '''Writes information about newly added or updated objects of app2 into log file''' logger = logging.getLogger(__name__) app2_object = kwargs['instance'] if kwargs['created']: logger.info(f'added {app2_object }') else: logger.info(f'updated {app2_object }') apps.py of my app1: from django.apps import AppConfig class App1Config(AppConfig): name = 'App1' def ready(self): from app1 import signals apps.py of my app2: from django.apps import AppConfig class App1Config(AppConfig): name = 'App2' def ready(self): from app2 import signals and here … -
Cant get rid of FileNotFoundError in Django ImageField
I have a django model Product which has an image field class Product(BaseProduct): img_height = models.PositiveIntegerField(editable=False, null=True, blank=True) img_width = models.PositiveIntegerField(editable=False, null=True, blank=True) file = models.ImageField('Image', upload_to=product_img_path, height_field='img_height', width_field='img_width', null=True, blank=True, max_length=255) Now because I loaded the products from an Excel file with records over 15,000 there are few that the image path in the file field does not actually exist in my directory. This causes my code to raise a FileNotFoundError every time i try to for product in Product.objects.all() before I am even able to catch the error with a try-except block. I'd like to have an iteration where I can check if the file exists and set the file field to null for records with non-existing files. But this is impossible because the error is raised once I try to call an instance of the artwork or I create the iteration. So the code below: products = Product.objects.all() for product in products: try: if product.file: pass except FileNotFoundError: product.file = None product.save() Raised error: FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\user\\project\\media\\products\\blahblah.jpeg' and the stack trace shows error was raised from the iteration line for product in products: I have tried following this thread without any … -
Wagtail PageChooserBlock custom ordering
I'm using PageChooserBlock to display list of objects class ActualSection(models.Model): content = StreamField( [ ("article", PageChooserBlock(page_type="articles.Article")), ], min_num=1, ) Is there any way to put some custom ordering on it? Because now it's seems like having some random order -
how to make a custom error for empty input in a field (i.e. name = serializers.CharField(required=True))?
name = serializers.CharField(required=True) def validate(self,data): if not name: //Return error I want to validate name or check if it's empty in def validate_name(self,value): I tried to trigger def validate and def validate_name and I expected a return from there but instead I am getting error from default rest framework -
How to get header value to the particular class?
def prep_head(self, requestParams, requestType,): return { 'content-type': "application/json", 'id': "xyz" } How to add the id header dynamically? I want to power this one on the prod link. Anhybody please help!!!!!!!!!!!! -
Django pagination of filtered post list
I've been working on a project of a blog where all posts are grouped by rubrics. The posts can be filtered by rubric in the frontend but I've got some problems whith implementing pagination. Paginator works fine and paginates filtered list, when I choose a rubric on my site it shows the number of pages and shows link to the next. But the url it forms ignores rubrication and instead of sending me to something like localhost/blog/?rubric=some_rubric&page=2 it shows localhost/blog/?page=2 The pagination works fine if I input adress by hand. models.py from django.db import models from django.utils import timezone from django.contrib.auth.models import User from django.urls import reverse from taggit.managers import TaggableManager class PublishedManager(models.Manager): def get_queryset(self): return super().get_queryset()\ .filter(status=Post.Status.PUBLISHED) class Rubric(models.Model): name = models.CharField(max_length=255) slug = models.SlugField() class Meta: verbose_name_plural = 'Rubrics' ordering = ('name',) indexes = [models.Index(fields=['name']),] def __str__(self): return self.name class Post(models.Model): class Status(models.TextChoices): DRAFT = 'DF', 'Draft' PUBLISHED = 'PB', 'Published' title = models.CharField(max_length=250) slug = models.SlugField(max_length=250, unique_for_date='publish') cover_img = models.ImageField(upload_to='post_covers/', blank=True, null=True) rubric = models.ForeignKey(Rubric, on_delete=models.CASCADE, related_name='posts') author = models.ForeignKey(User, on_delete=models.CASCADE, related_name='posts') excerpt = models.TextField(max_length=500) body = models.TextField() publish = models.DateTimeField(default=timezone.now) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) status = models.CharField(max_length=2, choices=Status.choices, default=Status.DRAFT) objects = models.Manager() # The … -
I am getting error in console "You need to enable JavaScript to run this app."
I am working on a site that has a back-end with django and a front-end with react js, it was running well locally, but when I run the command on the cloud server, I get the error "You need to enable JavaScript to run this app". JavaScript is enabled in the browser, I also tried different browsers. But I get the same error in all browsers. Please someone help me to overcome this error. -
Gptcache and streaming are incompatible
Now, I have made a chatbot which can stream and answer the question from user. However that chatbot can't stream showing no error in terminal after I implemented init_cache() and changed llm. Here are some parts of my code: class CustomStreamingCallbackHandler(BaseCallbackHandler): """Callback Handler that Stream LLM response.""" def __init__(self, queue): self.queue = queue def on_llm_new_token(self, token: str, **kwargs: Any) -> None: """Run on new LLM token. Only available when streaming is enabled.""" self.queue.put(token) def generate_stream(q: Queue, job_done): while (...): try: stream = q.get(True, timeout=1) print(stream) yield stream except: continue def openai_response_generator(queue, retriever, prompt, query, chat_history, job_done): llm = LangChainChat( chat=ChatOpenAI( model_name="gpt-3.5-turbo-16k", streaming=True, temperature=0, callbacks=([CustomStreamingCallbackHandler(queue)]), )) chain = ConversationalRetrievalChain.from_llm( llm=llm, retriever=retriever, condense_question_prompt=prompt, return_source_documents=True, ) res = chain({'question': query, 'chat_history': chat_history}) print(res["answer"]) queue.put(job_done) def get_content_func(data, **_): return data.get("messages")[-1].content def init_cache(): onnx = Onnx() cache_base = CacheBase('sqlite') vector_base = VectorBase('faiss',dimension=onnx.dimension, collection_name='for_cache') data_manager = get_data_manager(cache_base, vector_base) cache.init( pre_embedding_func=get_content_func, embedding_func=onnx.to_embeddings, data_manager=data_manager, similarity_evaluation=SearchDistanceEvaluation(max_distance=1), ) cache.set_openai_key() # save data to cache from getting one answer cache.config.auto_flush = 1 init_cache() task = threading.Thread( target=openai_response_generator, args=(queue, retriever, prompt, query, chat_history, job_done) ) task.start() Before I changed llm, it was: llm = chatOpenAI( model_name="gpt-3.5-turbo-16k", streaming=True, temperature=0, callbacks=([CustomStreamingCallbackHandler(queue)]), ) Could you help me with that? I have already tried to change … -
DJango how to set up api and testing in Insomnia?
What should I add in the urls or views? I want to create an api and test in Insomnia, my app name called jqeshop and i create a table call product, i try to get it and display, after that i want to pass it to frontend, it just a practice for me, i need some one help enter image description here enter image description here enter image description here enter image description here This is the error message -
In Django AuthenticationForm, how to check only email and password is_valid
I tried to do this to remove username validation def clean_username(self): return "valid_username" But the is_valid() method is showing false. Even when i give the correct username and password I also tried this def clean_username(self): return self.cleaned_data.get('username') views.py def login(request): if request.method == 'POST': form = LoginUser(request=request.POST, data=request.POST) if form.is_valid(): print(True) print(form.cleaned_data['username']) print(form.cleaned_data['password']) print(form.is_valid()) else: form = LoginUser() context ={ 'form': form, } return render(request, 'login.html', context) forms.py class LoginUser(AuthenticationForm): username = forms.CharField(max_length=20, required=True, widget=forms.TextInput(attrs={'class': form_class, 'placeholder': 'username', })) password = forms.CharField(min_length=8, required=True, widget=forms.PasswordInput(attrs={'class': form_class, 'placeholder': 'password', })) def clean_username(self): return "valid_username" I think I need to change the is_valid method -
How to use django_autocomplete_light in django admin page?
I have a 2 model in django models class Country(models.Model): country_name = models.CharField(max_length=30, null=False) country_phone_code = models.CharField(max_length=50, primary_key=True, null=False) country_image = models.CharField(max_length=255, blank=True) is_shipping_available = models.BooleanField(null=False) class State(models.Model): id = models.AutoField(primary_key=True) state_name = models.CharField(max_length=30, null=False) country = models.ForeignKey( Country, on_delete=models.CASCADE, related_name="states" ) is_shipping_available = models.BooleanField(null=False) what i was trying to do register the states model in Modeladmin and have an auto field to select from country model since it is related using the foreign key relation ship and i found out that i can do it using the django_autocomplete_light ? help -
Running Django and PHP on same Ubuntu server
I have a dedicated Ubuntu 22.0 server on which I am running PHP apps using Cyberpanel. I want to use Django on the same server. I have 2 sites inside cyberpanel using wordpress. I want my third site to point to the Django app, not the PHP. What should be the approach to configure it? -
DoesNotExist at /buy_now_payment_done/ Payment matching query does not exist
i have implemented an E-commerce website with razorpay payment integration and when i am got to checkout page with cart items, all logic work properly but when i am click on Buy Now button and then redirect it to "buynow_checkout.html" after that i am making a payment and payment is also successfull but after that i am getting an error : DoesNotExist at /buy_now_payment_done/ Payment matching query does not exist. how to resolve this? here is my code: Buy Now button <a href="{% url 'buy_now' %}?prod_id={{ product.id }}" id="" class="btn btn-danger shadow px-5 py-2 ms-4">Buy Now</a> urls.py path('buy_now/', login_required(views.BuyNow.as_view()), name='buy_now'), path("buy_now_payment_done/", views.buynow_payment_done, name='buynow_payment_done'), path('checkout/', login_required(views.checkout.as_view()), name='checkout'), path("payment_done/", views.payment_done, name='payment_done'), view.py import uuid from django.shortcuts import render,redirect,get_object_or_404 from django.views import View from django.contrib import messages from django.http import HttpResponseRedirect, JsonResponse, HttpResponse from django.conf import settings from django.core.mail import send_mail from django.contrib.auth import authenticate,login,logout from django.urls import reverse from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.db.models import Q from .forms import * from .models import * import razorpay class checkout(View): def get(self,request): user = request.user add = Customer.objects.filter(user=user) cart_items = Cart.objects.filter(user=user) famount = 0 for p in cart_items: value = p.quantity * p.product.discounted_price famount = famount+value totalamount = famount + … -
How to stop my footer design to effect the whole page?
I made this footer but when I include it in my base.html it changes the styling of the other parts I think due to its CSS and it makes some icons look strange what should I do?? if I need to post another part of code please let me know Thanks in advance my index.html (footer) <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="vieport" content="width=device-width,initial-scale=1.0"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <title>Document</title> </head> <body> <footer> <div class="footerContainer" > <div class="socialIcons"> <a href=""><i class="fa-brands fa-facebook"></i></a> <a href=""><i class="fa-brands fa-instagram"></i></a> <a href=""><i class="fa-brands fa-telegram"></i></a> <a href="https://github.com/Jasmine-dy"><i class="fa-brands fa-github"></i></a> <a href=""><i class="fa-brands fa-youtube"></i></a> </div> <div class="footerNav"> <ul> <li><a href="">Home</a></li> <li><a href="">Genres</a></li> <li><a href="">Contact Me</a></li> <li><a href="">Your Account</a></li> </ul> </div> </div> <div class="footerBottom"> <p style="margin-top: 10px" >Copyright &copy;2023; Designed by <span class="designer">Jasmine</span> </p> <a href="https://www.freepik.com/free-vector/abstract-background-with-rainbow-coloured-hologram-background_19613969.htm#query=pastel%20holographic%20background&position=2&from_view=keyword&track=ais&uuid=eccfffcb-4044-4b17-8749-40b272baa47e">Image by kjpargeter</a> on <span class="designer"> Freepik</span> <h2></h2> <a target="_blank" href="https://icons8.com/icon/79363/reading-unicorn">Reading Unicorn</a> icon by <a target="_blank" href="https://icons8.com">Icons8</a> </div> </footer> </body> <style> footer{ padding: 0; margin: 0; box-sizing: border-box; } footer{ background-color: transparent; } .footerContainer{ width: 100%; padding: 70px 30px 20px; } .socialIcons{ display: flex; justify-content: center; } .socialIcons a{ text-decoration: none; padding: 10px; background-color: white; margin: 10px; border-radius: 50%; display: flex; } .socialIcons a i{ …