Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
aws elastic beanstalk deployment error: 502 gateway error
I've been trying to deploy a django application using Django 4.2.6 on the latest platform that AWS EB has to provide: Python 3.9 running on 64bit Amazon Linux 2023/4.0.4 After any try or redeploy I've been getting a 502 Bad gateway issue and I would appreciate some help in debugging this. On the web.stdout.log file I see this log line: web[2059]: ModuleNotFoundError: No module named 'ebdjango.wsgi' which is confusing because I don't see anything I've done different than what's been suggested across the internet via blogposts and so on. All my sourcecode is available here: https://github.com/kolharsam/assignment-practical-swe These are the links I've been looking into: https://medium.com/@justaboutcloud/how-to-deploy-a-django3-application-on-elastic-beanstalk-python3-7-and-amazon-linux-2-bd9b8447b55 https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html https://testdriven.io/blog/django-elastic-beanstalk/ -
How to Implement Withdrawal Functionality in Django: Integrating Razorpay and Bank Transfers
I am working on a Django web application where users need to be able to withdraw money from their accounts. I am looking for assistance in implementing a withdrawal functionality within my Django project. The process involves saving the withdrawn amount to the Razorpay dashboard and then transferring it to the user's linked bank account. -
SessionInterrupted at /accounts/login/
I have some problems with this error. Error began to appear after implementing the new functionality. Which involves checking whether the user's password has been marked for change. After logging in, the function checks whether the password needs to be changed.If so, it adds a variable to the user's session.The decorator on each page is used to check whether a variable in the session has been set. When the password needs to be changed, the decorator redirects to the password change page. After the change, the variable is deleted and information from the database.The error appears when the user logs in again after changing the password. def check_reset_pass(function): @wraps(function) def wrap(request, *args, **kwargs): if request.session['pass_reset_needed']: return redirect(reverse('password_reset_form')) return function(request, *args, **kwargs) return wrap After changing the password, the user remained on the website. I tried to force the user to log out after changing the password. But that didn't solve the problem. -
Django function based view Login
I've been trying to write a view for users to login.. def LoginView(request): form = LoginForm() if request.method == "POST": form = LoginForm(request.POST) if request.user.id: if form.is_valid(): username = form.cleaned_data.get("username") password = form.cleaned_data.get("password") user = authenticate(username=username, password=password) login(request, user) return redirect("/") else: return render( request, "api/login.html", {"massege": "the user NOT found , register here ", "form": form}, ) return render(request, "api/login.html", {"form": form}) login Form class LoginForm(forms.Form): username = forms.CharField(max_length=70) password = forms.CharField(max_length=65, widget=forms.PasswordInput) class Meta: fields = "__all__" when I try to login as user who exsits in database the funciton eccepts it as non exists user ,and display what under else condition to the template -
Problem with displaying the 'Remove from cart' button in the Django session cart
Good afternoon, I am currently working on a bookstore project, I have a basket for unauthorized users, the problem is that I want the delete button from cart to appear on the template if there is this book in the session basket and hide if this book is not in cart, but this logic does not work because the button does not it is displayed even when there are many copies of the same book in the basket, I need your help. Thank you in advance for your time! views that are associated with a cart of books: class CartView(TemplateView): template_name = 'shop/cart.html' def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) created = self.request.session.pop('created', False) # Извлекаем значение и удаляем его из сессии if self.request.user.is_authenticated: cart = Cart.objects.get(user=self.request.user) cart_items = CartItem.objects.filter(cart=cart) total_price = 0 for cart_item in cart_items: book = cart_item.book if book.discounted_price: total_price += book.discounted_price * cart_item.quantity else: total_price += book.price * cart_item.quantity context["cart"] = cart context["cart_items"] = cart_items context["total_price"] = total_price context["created"] = True else: cart = self.request.session.get('cart', {}) context['cart'] = cart # Создаем список книг на основе идентификаторов из корзины book_ids = [int(book_id) for book_id in cart.keys() if book_id.isnumeric()] books = Book.objects.filter(id__in=book_ids) # Генерируем список книг и их количество … -
Django channels: Execute consumer code from django drf view
I have django app with drf view and I want to call consumer by its name from the view. I'm using the following packages versions: Django==4.2.5 djangorestframework==3.14.0 channels==4.0.0 the following code prints nothing: settings.py: INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ... 'rest_framework', 'drf_yasg', 'channels', ] CHANNEL_LAYERS = { "default": { "BACKEND": "channels.layers.InMemoryChannelLayer", }, } consumers.py: class TestConsumer(SyncConsumer): def test_consumer(self, message): print('start consumer') job = Job.objects.get(id=message.get('job')) job.status = Job.JobStatus.RUNNING job.save() print('Finish consumer') routing.py: ChannelNameRouter({ "test_consumer": TestConsumer, }) views.py: class TestAPIView(APIView): @transaction.atomic def post(self, request, *args, **kwargs): message = {"selected_indices": 'test', "session_search": ''search_test', "job": 1} channel_layer = get_channel_layer() async_to_sync(channel_layer.send)("test_consumer", message) -
How to solve create next app npm run build placing href with _next instead of .next in the html files from the server?
I built an app on django as backend and next.js as frontend. As I am integrating next.js to django I have seen an error when i build the next.js app in the server folder the html pages's hrefs are linked to /_next/... which does not exists as you know when u build the project it automatically creats the .next folder I can see that this is a similar question but without a windows solve : Renaming '_next' to 'next' in the out directory: NextJS tried several work arounds but in vain -
How to run databricks notebook from django web application
I am new to Django, in my project I have below requirement. Run data bricks notebook from web application. For example I have date dropdown in my Django web application and In my databricks notebook I have business logic in it and this notebook will run based on date as parameter and out put this will store as a delta table in ADLS. Now, if user select date from web application(Django),and this date should act as input to the databricks notebook and perform business logic in it and out put of this note book which is store as delta table should return to my web application. if this is possible I kindly request you list down the steps please. waiting for favorable reply. Thanks. I have tried below this, but it is not suitable to my requirement. https://datathirst.net/blog/2019/3/7/databricks-connect-finally/ -
How to localize settings in Wagtail
I am trying to implement localization in Wagtail's settings. I know that Snippets can be localized by inheriting from the TranslatableMixin class. And it works perfectly. However, when I try to localize settings by inheriting from this class in a model that also inherits from BaseGenericSetting to add the model to Wagtail's settings, it does not provide an interface to change the language in the admin panel so that I can create settings for different languages. How can I add an interface for changing the language in the settings, similar to what we do with snippets? For instance, I want to create instances of the below-mentioned model for three different languages (which are added in the LANGUAGES setting in base.py). This means there will be three instances of CompanySettings for three different languages. @register_setting(icon="doc-full") class CompanySettings(TranslatableMixin ,BaseGenericSetting): top_services = models.CharField( _("Top Services"), max_length=250, blank=True, null=True, help_text="add top services separated by comma") copyright_text = models.CharField(_("Copyright Text"), max_length=100, blank=True, null=True) panels = [ FieldPanel('top_services'), FieldPanel('copyright_text') ] I have checked the CompanySettings model by querying its instance to verify whether the locale and translation_key fields are available or not, as these are provided by TranslatableMixin. However, even though they are available, it doesn't … -
Restricting django api to allow access and takes calls from only one domain (xyz.com) website
I have a frontend(react js) and backend api (Django) hosted separately, frontend is hosted on xyz.com and backend is hosted on server.xyz.com. now, the api is https://server.xyz.com which is publicly visible to everyone (in network tab) and anyone is able to access it by making calls. but i want to make it access with only xyz.com website only. My problem is I need to give access to only xyz.com domain and restrict the api to take calls from any other domains or ip addresses. -
Issue with Certbot: "no valid A records found" during certificate renewal
I'm encountering an issue with Certbot while trying to renew SSL certificates for my domain using the --nginx option. The error message I'm getting is as follows: $ sudo certbot --nginx -d your_domain.com -d www.your_domain.com Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator nginx, Installer nginx Obtaining a new certificate Performing the following challenges: http-01 challenge for your_domain.com Waiting for verification... Cleaning up challenges Failed authorization procedure. your_domain.com (http-01): urn:ietf:params:acme:error:dns :: no valid A records found for your_domain.com; no valid AAAA records found for your_domain.com IMPORTANT NOTES: - The following errors were reported by the server: Domain: your_domain.com Type: None Detail: no valid A records found for your_domain.com; no valid AAAA records found for your_domain.com $ I am not sure exactly what to look for to fix this error. I am using Lindo Akamai and the A/AAAA Record is showing the correct IP address also the website is working fine without as Http. I am using Nginx and Gunicorn for a Django Project. My question how to fix the error everytime I run sudo certbot --nginx -d your_domain.com -d www.your_domain.com -
Starting Django Project with gunicorn: No module named: "myproject"
I am having trouble starting my django project with gunicorn In order to figure out what's wrong, I created an empty django project to work with: myproject - myproject - __init.py__ - asgi.py - gunicorn_config.py ... -wsgi.py - hello.py - manage.py Inside gunicorn_config.py: # gunicorn_config.py pythonpath ='/home/mywsl/.virtualenvs/venvname/lib/python3.10' bind = "0.0.0.0:8000" workers = 4 timeout = 60 Then i go into myproject where wsgi.py is located and does gunicorn -c gunicorn_config.py wsgi:application This raises the following error: [2023-10-07 23:21:39 -0400] [102667] [ERROR] Exception in worker process Traceback (most recent call last): File "/home/mywsl/.virtualenvs/venvname/lib/python3.10/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker worker.init_process() File "/home/mywsl/.virtualenvs/venvname/lib/python3.10/site-packages/gunicorn/workers/base.py", line 134, in init_process self.load_wsgi() ... File "/home/mywsl/.virtualenvs/venvname/lib/python3.10/site-packages/gunicorn/util.py", line 371, in import_app mod = importlib.import_module(module) (This is where the import module points to outside virtualenv, i don't know if this is normal) File "/usr/lib/python3.10/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 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed (It goes back to where my project is, and start tracing python inside virtualenv) File "/home/mywsl/Projectname/myproject/myproject/wsgi.py", line … -
Django field formatting within template defined within the field
I have a custom field called Percentage which I would like displayed in Django templates always with a % sign, so if the DB is holding a Float of 100.00 then in the template it would always render as 100%. I know I can write a template tag however I would like this change to be made globally so I don't need to do template tags everywhere. I've seen packages like dj-money do this so that 1 is formatted as $1 automatically. I've looked at the code but can't see exactly how this is occuring. I've investigated methods like to_python, __str__ and __unicode__ on the field but these don't appear to work. How can I customise the field to always format a particular way in string based situations like django templates and django admin? At present I've just created a custom method per field on the model to do the formatting, however I fee like there should be a way to set this on the field level. Thanks for your help -
Why is my Django view not automatically downloading a file
My view transcribes a file and outputs the SRT transcript. Then it locates and is supposed to auto download theT transcript but nothing happens after transcription completes(the file was submitted on a previous page that uses the transcribeSubmit view. The view that handles and returns the file is the initiate_transcription view). Here is my views.py: @csrf_protect def transcribeSubmit(request): if request.method == 'POST': form = UploadFileForm(request.POST, request.FILES) if form.is_valid(): uploaded_file = request.FILES['file'] fs = FileSystemStorage() filename = fs.save(uploaded_file.name, uploaded_file) request.session['uploaded_file_name'] = filename request.session['uploaded_file_path'] = fs.path(filename) #transcribe_file(uploaded_file) #return redirect(reverse('proofreadFile')) return render(request, 'transcribe/transcribe-complete.html', {"form": form}) else: else: form = UploadFileForm() return render(request, 'transcribe/transcribe.html', {"form": form}) @csrf_protect def initiate_transcription(request): if request.method == 'POST': # get the file's name and path from the session file_name = request.session.get('uploaded_file_name') file_path = request.session.get('uploaded_file_path') if file_name and file_path: with open(file_path, 'rb') as f: path_string = f.name transcribe_file(path_string) file_extension = ('.' + (str(file_name).split('.')[-1])) transcript_name = file_name.replace(file_extension, '.srt') transcript_path = file_path.replace((str(file_path).split('\\')[-1]), transcript_name) file_location = transcript_path with open(file_location, 'r') as f: file_data = f.read() response = HttpResponse(file_data, content_type='text/plain') response['Content-Disposition'] = 'attachment; filename="' + transcript_name + '"' return response else: #complete return render(request, 'transcribe/transcribe-complete.html', {"form": form}) def transcribe_file(path): #transcription logic JS: const form = document.querySelector('form'); form.addEventListener('submit', function (event) { event.preventDefault(); const formData = … -
Django Rest Framework: AttributeError when attempting to serialize Elasticsearch InnerDoc
I am working on a Django project with Elasticsearch, using django-elasticsearch-dsl to create documents from my models. I have set up my documents and am trying to create a serializer for my Contest model. However, when I send a GET request to my endpoint (http://localhost:8000/search/offices/economia/), I encounter the following error: AttributeError at /search/offices/economia/ Got AttributeError when attempting to get a value for field `organization` on serializer `ContestSerializer`. The serializer field might be named incorrectly and not match any attribute or key on the `InnerDoc` instance. Original exception text was: 'InnerDoc' object has no attribute 'organization'. Here are my document and serializer definitions: document.py: from django_elasticsearch_dsl import Document, fields from django_elasticsearch_dsl.registries import registry from core.models import Contest, Organization @registry.register_document class ContestDocument(Document): organization = fields.ObjectField(properties={ 'id': fields.IntegerField(), 'name': fields.TextField(), # ... other fields }) # ... rest of the code serializers.py: from rest_framework import serializers from core.models import Contest, Organization class OrganizationSerializer(serializers.ModelSerializer): # ... code class ContestSerializer(serializers.ModelSerializer): organization = OrganizationSerializer() class Meta: model = Contest fields = "__all__" It seems like, for some reason, an Elasticsearch InnerDoc instance is being passed to the ContestSerializer instead of a Contest model instance, causing the AttributeError. I'm not sure why this is happening or how … -
Syncing django default/auto-generated id/createdAt/updatedAt fields with prisma schema?
I have a database which is queried by both a python django app and a nextjs app. I use the Django ORM to maintain the models and migrations, then use prisma db pull to pull in the schema from the database to keep nextjs in sync. default/auto fields don't seem to persist over, e.g. # django model, my canonical model definition class Production(models.Model): # production companies that host parties, e.g. Taylorfest id = models.UUIDField(primary_key=True, default=uuid.uuid4) createdAt = models.DateTimeField(auto_now_add=True) # prisma schema, generated from prisma db pull model party_production { id String @id @db.Uuid created DateTime @db.Timestamptz(6) in particular, while the default/auto fields are present on the django model definition, prisma's schema doesn't include the @default(uuid()) and @default(now()) upon pulling in the schema. (I'm using postgres for the database). do the django defaults happen on the django-side rather than the DB side? Does that mean using django ORM to canonically define schemas is incompatible with other apps that may need to do writes? -
How to make django load static files from a built react project
This is my project structure, I have already finished both the backend and frontend in Django and React. To host my project, I built React and loaded 'index.html' as a template, while the built CSS and JS are used as static files. backend ----backend ----base ----frontend ----build ----static ----css ----js ----media index.html // other files like favicons and JSON ----node_modules ----public ----src ----staticfiles ----db.sqlite3 -----manage.py Here is my settings.py to handle static files: STATIC_URL = '/static/' MEDIA_URL = '/media/' STATICFILES_DIRS = [ BASE_DIR / 'frontend/build/static/css', BASE_DIR / 'frontend/build/static/js', BASE_DIR / 'frontend/build/static/media', ] MEDIA_ROOT = BASE_DIR / 'static/images' STATIC_ROOT = BASE_DIR / 'staticfiles' When I turn DEBUG = True, the site runs on port 8000, but the images need to be re-uploaded to the database because it can't find those images after I built the React project. When I turn DEBUG = False, I get the following error in the console: Refused to execute script from 'http://127.0.0.1:8000/static/main.1d564988.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. The same problem occurs for the CSS files. I tried hosting the site, but I can't load the static files. -
Django 4.2 on AWS - collectstatic is not uploading files to S3
This has been a nightmare to try and figure out. Nothing is working. Here is my code. eb-hooks log is always sending the files to the localhost 1084 static files copied to '/var/app/current/static' Settings.py USE_S3 = os.getenv('LOGNAME') == 'webapp' CLOUDFRONT_DOMAIN = 'https://d3g5b3y2rsspt8.cloudfront.net' AWS_STORAGE_BUCKET_NAME = env('AWS_STORAGE_BUCKET_NAME') AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME AWS_ACCESS_KEY_ID = env('AWS_ACCESS_KEY_ID') AWS_SECRET_ACCESS_KEY = env('AWS_SECRET_ACCESS_KEY') AWS_S3_REGION_NAME = env('AWS_S3_REGION_NAME') if USE_S3: STATICFILES_LOCATION = 'static' MEDIAFILES_LOCATION = 'media' AWS_S3_SIGNATURE_VERSION = 's3v4' AWS_S3_FILE_OVERWRITE = True AWS_DEFAULT_ACL = None AWS_QUERYSTRING_AUTH = True AWS_QUERYSTRING_EXPIRE = 40000 AWS_S3_VERIFY = True AWS_S3_OBJECT_PARAMETERS = {'CacheControl': 'max-age=86400'} AWS_CLOUDFRONT_KEY_ID = env.str('AWS_CLOUDFRONT_KEY_ID').strip() AWS_CLOUDFRONT_KEY = env.str('AWS_CLOUDFRONT_KEY', multiline=True).encode('ascii').strip() MEDIA_URL = f'{AWS_S3_CUSTOM_DOMAIN}/{MEDIAFILES_LOCATION}/' STATIC_URL = '%s/%s/' % (AWS_S3_CUSTOM_DOMAIN,STATICFILES_LOCATION) STORAGES = { "default": {"BACKEND": 'custom_storages.MediaStorage'}, "staticfiles": {"BACKEND": 'custom_storages.StaticStorage'}, "OPTIONS": { "bucket_name": AWS_STORAGE_BUCKET_NAME, "region_name": AWS_S3_REGION_NAME, "verify": AWS_S3_VERIFY, "signature_version": AWS_S3_SIGNATURE_VERSION, "cloudfront_key_id": AWS_CLOUDFRONT_KEY_ID, "cloudfront_key": AWS_CLOUDFRONT_KEY, }, } else: STATIC_URL = 'static/' STATIC_ROOT = 'static/' MEDIA_URL = '/media/' MEDIA_ROOT = 'media/' The signed urls seem to be working, as when I go to the website, the urls are there, but exactly none of my static files are there. -
Some html attribute do not have autocomplete in VC Code
when i use django some html attribute do not have autocomplete in VC Code: for example attribute 'enctype' in tag 'form'. In file settings.json i written: "emmet.includeLanguages": { "django-html": "html", But it help partly, all tags have autocomplete, but some their attributes do not have autocomplete anyway. if i deactivate django - html autocomplete start work correctly. -
Python automation or Python for web?
I have a doubt: Is it recommended to learn Python for the web and Python Automation at same time? Or is it better to focus on just one area? I'm a programming beginner :D ------------------------------------------------------------- -
Store for loop queryset into one
I currently have an array with multiple objects. The for loop does a queryset based upon the array objects using a for loop of a model. search_post = ["1990", "2023"] for query in search_post: vehicle_result = Vehicle.objects.filter( Q(title__icontains=query) | Q(details__icontains=query) | Q(year__icontains=query) | Q(notes__icontains=query) ) print('vehicle_result: %s' % vehicle_result) The issue I'm having is when the array has multiple items it's going through the for loop for each object and it's outputting each objects result. Only the last object result is retained if I call this variable elsewhere in the code. Example Output: vehicle_result: <QuerySet [<Vehicle: BMW>]> vehicle_result: <QuerySet [<Vehicle: Toyota>, <Vehicle: Mercedes>, <Vehicle: Honda>]> I want to store/combine them all into one variable - prevent losing all the results (right now only the last one is retained I guess because the variable is overwritten) How can I achieve? -
Cannot read properties of null (reading 'getPassword') error in vs code
I am getting this annoying error in vs code in the bottom right. It shows when i try to connect vs code with my local mysql server. Any solutions to this? This is the image I properly checked mysql and made sure that all the information of the database is correct in my project. -
how to render URL patterns in Django with multiple apps
I am trying to build a booking system, using Django. I have multiple apps and rendering the urls patterns has been difficult to understand and i have found the documentation little help when you have multiple apps. Here is my core app urls: urlpatterns = [ path('admin/', admin.site.urls), path('', include('review.urls'), name='review_urls'), path('accounts/', include('allauth.urls')), path('bookings/', include('booking.urls'), name='booking_urls'), ] The booking app urls: urlpatterns = [ path('booking', views.customer_booking, name='booking'), path('display_booking', views.display_booking, name='display_booking'), path('edit_booking/<booking_id>', views.edit_booking, name='edit_booking'), ] I am trying to render my edit_booking view: def edit_booking(request, booking_id): booking = get_object_or_404(Booking, id=booking_id) if request.method == "POST": form = BookingForm(request.POST, instance=booking) if form.is_valid(): form.save() return redirect('display_booking') form = BookingForm(instance=booking) context = { 'form': form } return render(request, 'edit_booking.html', context) where it is being called: <a href="/edit_booking/{{ booking.id }}"> <button>Edit</button></a> I tried adding bookings/ into my edit button but this is requesting a page with bookings/bookings/edit_booking/7. without it, it is just requesting the endpoint edit_booking/7 -
Docker-Compose - Frontend service cannot use endpoint from backend
Context I am currently working on a multi-container project involving react, django, and (eventually) several datastores all containerized and tied together with docker-compose. This is all developed within vscode devcontainers. The host operating system is Windows 11. Problem I can make requests to my Django API via the browser (and Django's API web interface). However I cannot make requesets to the API via the frontend service. Using the javascript fetch api, I am unable to make requests to any of the following localhost:8000 (NOTE: Many tut's say this should function just fine) 0.0.0.0:8000 (NOTE: This will at least throw a NS_ERROR_CONNECTION_REFUSED error, which is still unsolvable) host.docker.internal:8000 192.168.99.100:8000 172.24.0.2:8000 What I've Tried Proper CORS configuration with Django Ensuring all appropriate ports are exposed and forwarded within docker Re-implementing the entire project and basing it off of some other halfassed tutorial. TWICE. Details Backend Dockerfile FROM python:3.10-alpine ENV PYTHONUNBUFFERED=1 WORKDIR /app COPY . . RUN apk add poetry && poetry install EXPOSE 8000 Frontend Dockerfile FROM node:lts-alpine WORKDIR /app COPY . . RUN yarn install EXPOSE 3000 CMD ["yarn", "start"] docker-compose.yml services: frontend: build: ./frontend ports: - "3000:3000" volumes: - ./frontend:/frontend depends_on: - backend backend: build: ./backend ports: - "8000:8000" volumes: … -
How to break a long line of html code into multiple lines as "\" will do in python and C/C++
Suppose that I have the following code, <p>aaa<a>bbb</a>ccc</p> the rendered web page will be like this However, when the text "aaa", "bbb", "ccc" becomes pretty long, I want to split this single line into multiple lines for readability, like <p> aaa <a> bbb </a> ccc </p> But the rendered web page will be like There are whitespaces between two blocks of text. How can I make these lines work as the single line mentioned before. In python or C/C++, I can simply use "\" to notify the consecutive lines should be treated as a single line. Is there a similar funtionality in html file? Besides, as I'm using django template system, I tried the django official tag "spaceless". According to django's doc, "spaceless" tag should remove the whitespace between html elements. But in this case, the whitespace between two blocks of text remains. I get pretty puzzled about this. Thanks for any help! I tried to ask chatgpt, github copilot and search on google. But I found no functionality in html that can make consecutive lines work as a single line. A similar functionality to "\" in python and C/C++ which inform compiler to treat consecutive lines as a single …