Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
pagination in django works calculates pages correctly but doesn't separate them
The paginator in django correctly calculates the number of pages, but does not break the models into pages and everything is displayed on 1 page, please tell me what to do with this This is my views.py,where is a paginator: from django.shortcuts import render, get_object_or_404 from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from .models import * def index(request): news = Content.objects.filter(is_published=True) page = request.GET.get('page', 1) paginator = Paginator(news, 20) try: page_obj = paginator.page(page) except EmptyPage: page_obj = paginator.page(1) except PageNotAnInteger: page_obj = paginator.page(paginator.num_pages) return render(request, 'content/index.html', {'news': news, 'page_obj': page_obj}) def view_news(request, news_id): news_item = get_object_or_404(Content, id=news_id) return render(request, 'Content/view_news.html', {'news_item': news_item}) And there is my paginator template: {% block content %} <nav class="paginator"> <ul class="pagination"> {% if page_obj.has_previous %} <a class="page-link" href="?page={{ page_obj.previous_page_number }}"> <li class="page-item">Предыдущая</li> </a> {% else %} <a class="page-link"> <li class="page-item">Предыдущая</li> </a> {% endif %} {% for i in page_obj.paginator.page_range %} {% if page_obj.number == i %} <a class="page-link"> <li class="page-item">{{ i }}</li> </a> {% else %} <a class="page-link" href="?page={{ i }}"> <li class="page-item">{{ i }}</li> </a> {% endif %} {% endfor %} {% if page_obj.has_next %} <a class="page-link" href="?page={{ page_obj.next_page_number }}"> <li class="page-item">Следующая</li> </a> {% else %} <a class="page-link"> <li class="page-item">Следующая</li> </a> {% endif %} </ul> … -
Give permission if it is staff. django
I have this code in django and I want the button to appear if the user is a super user or staff. I don't know how I should put it, I tried with is_superuser or is_staff but it didn't work. {% if request.user == post.user %} <div class="trash"> <a href="{% url 'delete' post.id %}"> <i class="fa fa-trash-o" style="color:#657786; font-size: 20px" aria-hidden="true"></i> </a> </div> {% endif %} Code -
Error deploying on Heroku - Django app - collectstatic --noinput
I'm very new trying to deploy an app on Heroku my Django app, but a got the error from above, if you have any idea, and if you look for something else out place please be free to share it because I'm junior and I'm learning. error: the code before the following error is all the packages installed on the deploying, all the packages are installed successfully and then: ---> -----> $ python project/manage.py collectstatic --noinput Traceback (most recent call last): File "/app/.heroku/python/lib/python3.10/site-packages/django/core/management/__init__.py", line 259, in fetch_command app_name = commands[subcommand] KeyError: 'collectstatic' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/build_f151875e/project/manage.py", line 22, in <module> main() File "/tmp/build_f151875e/project/manage.py", line 18, in main execute_from_command_line(sys.argv) File "/app/.heroku/python/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line utility.execute() File "/app/.heroku/python/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/app/.heroku/python/lib/python3.10/site-packages/django/core/management/__init__.py", line 266, in fetch_command settings.INSTALLED_APPS File "/app/.heroku/python/lib/python3.10/site-packages/django/conf/__init__.py", line 92, in __getattr__ self._setup(name) File "/app/.heroku/python/lib/python3.10/site-packages/django/conf/__init__.py", line 79, in _setup self._wrapped = Settings(settings_module) File "/app/.heroku/python/lib/python3.10/site-packages/django/conf/__init__.py", line 190, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/app/.heroku/python/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>", … -
How should i fix the problem with opening django project\site?
i wrote classic django-admin startproject mysite cd mysite python manage.py runserver but the console shown this Error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xca in position 0: invalid continuation byte also console shown very big text and i can't understand what does it mean! help please!! full text in console -
Django: Parse the docx and get content from document
I'm writing Django app where user can upload the .docx file and get flashcards done in db from parsed document. Flashcards are created from different heading types, like below: Heading title: Category of flashcards, Heading 1: Title of flashcard, Heading normal: Content of flashcard The problem is when I upload word document. Category is created, but title and content are empty strings.. I did separate python file with the same func and there everything is working: category, title and content are exactly how it should be. Input is the same in both cases (Flask.docx file): Flask Framework (using heading Title, so it should be the category) Flask (using Heading 1, so it should be the title of a flashcard) Is a Python Web framework. (using heading normal, so it should be the content of a flashcard) Django: Models: from django.db import models # Create your models here. class FlashcardCategory(models.Model): id = models.IntegerField(primary_key=True) name = models.CharField(max_length=30, unique=True, help_text="Category of flashcards.") def __str__(self): return self.name class Flashcard(models.Model): id = models.IntegerField(primary_key=True) category = models.ForeignKey(FlashcardCategory, on_delete=models.CASCADE) title = models.CharField(max_length=50, help_text="Title of flashcard.") content = models.TextField(unique=True, help_text="Content (reverse) of flashcard.") def __str__(self): return f"{self.title} - {self.content}" View: def upload_documents_and_parse(request): """ Function based view where user … -
Dockerfile - chown command usage base on different env's
mkdir data && mkdir data/Files && chown -R 25708:16681 data Issue : Currently chown command is set based on DEV env. How do i specify chown command based on different envs: DEV, UAT, PROD in dockerfile. I have an variable in container: APP_ENV = DEV Or UAT OR PROD. Please advice. -
AttributeError: 'Settings' object has no attribute <class that I defined inside settings.py> when settings imported from conf
I've added enum in the settings.py file class Syncs(Enum): A = 'a' B = 'b' when I try to use them in an app by importing from django.conf import settings, it raises: AttributeError: 'Settings' object has no attribute Syncs on the other hand if I import settings file directly it works I know it's because from django.conf import settings works differently so that's why this doesn't work. Is there some recommended way to do this? So far I do: class Syncs(Enum): A = 'a' B = 'b' SYNCS = Syncs -
django.db.utils.ProgrammingError: cannot cast type date to integer
I am getting following error when trying to deploy my application to heroku.com: django.db.utils.ProgrammingError: cannot cast type date to integer LINE 1: ...ts" ALTER COLUMN "month" TYPE integer USING "month"::integer ^ As this is new for me, no idea what to correct as there is no link to file, row. etc. And I have only one field with month in my models - mm field in MonthlyCosts: class MonthlyCosts(models.Model): y = int(date.today().year) y1 = y - 1 year_selection = ( (y, y), (y1, y1), ) months_selection = ( (1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December') ) year = models.IntegerField("Year", choices=year_selection) mm = models.IntegerField("Month", choices=months_selection) But it is the integer, so why mentioning type "date"? Then I am using column "month" in pandas tables which are part of functions for particular views, but there are also int or str types, no date. So no idea what this error means. Thanks a lot for help. -
nested categories not working correctly in Django
I'm working on a project that contains lots of detail and extra information. I need to use nested categories for my navbar, the first time I ran the code, it was working properly but then when I faced a bug at migration and I had to re-create the project again, It isn't working now anymore. I have two different types of coding for this nested category and none of them works! class Category(MPTTModel): name = models.CharField(max_length=30) slug = models.SlugField(allow_unicode=True, blank=True, null=True, unique=True) parent = models.ForeignKey('self', default=None, null=True, blank=True, on_delete=models.SET_NULL, related_name='children') is_child = models.BooleanField(default=False) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) class Meta: verbose_name = _('category') verbose_name_plural = _('categories') def __str__(self): return self.name this first one and this second one: class Category(MPTTModel): name = models.CharField(max_length=100) parent = TreeForeignKey('self', on_delete=models.CASCADE, null=True, blank=True, related_name="children") is_child = models.BooleanField(default=False) slug = models.SlugField(unique=True, null=True, blank=True, allow_unicode=True) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) class Meta: verbose_name = _('category') verbose_name_plural = _('categories') def __str__(self): return self.name once I create a new category as a child, it must be included in its parent. But nothing happens and it is created just as a separate category. I'll be so glad if you can help me with this. -
Why is solid i18n redirecting back to the previous language?
I am on an old Django version (1.8) and using solid-i18n==1.3.0 to support having the default language like English as / instead of /en. My problem is that, in production, a page whose sessions is set to Spanish, if you select any other language, redirects twice: first to the selected language and then back to Spanish. This is the session in Spanish: >>> from django.contrib.sessions.models import Session as Sess >>> s = Sess.objects.get(pk='f2l3drtob4ox797ohcwantp4xfrb4r5u') >>> s.get_decoded()['_language'] u'es' And this is the request chain: The POST body of the selectlang/ request is: csrfmiddlewaretoken=xxxxxxxxxxxxxxxxxxxx&next=%2Fedit%2Fxxxxxxxxxxxxxxxxxxxxx&language=en My confusion is about the third request: why is it going back to the /es/edit/xxxxxxxx page? My i18n settings are as follows: SOLID_I18N_USE_REDIRECTS = True # SOLID_I18N_HANDLE_DEFAULT_PREFIX = True # SOLID_I18N_DEFAULT_PREFIX_REDIRECT = True # not working, redirects to "en" back again And the view the selectlang/ URL points to is a custom one: def select_language(request): """ Just like `django.views.i18n.set_language` but adds `translation.activate(lang_code)` because of an issue with solid_i18n not redirecting to the default language (no path) when selected. """ next = request.POST.get('next', request.GET.get('next')) if not is_safe_url(url=next, host=request.get_host()): next = request.META.get('HTTP_REFERER') if not is_safe_url(url=next, host=request.get_host()): next = '/' response = http.HttpResponseRedirect(next) if request.method == 'POST': lang_code = request.POST.get('language', None) if … -
AttributeError: 'AnonymousUser' object has no attribute 'is_email_verified'
I have django app with registration system in it and it doesn't work as expected. I recently added email verification in my view and because of that I get error. For email verification I have 2 functions. One function sends email, the other verifies and creates user. function 1 def send_action_email(user, request): current_site = get_current_site(request) email_subject = 'Activate account | Zane' email_body = render_to_string('authentication/email/email_body.html', { 'user': models.PersonalUser, 'domain': current_site, 'uid': urlsafe_b64encode(force_bytes(user.pk)), 'token': generate_token.make_token(user) }) email = EmailMessage(subject=email_subject, body=email_body, from_email=settings.EMAIL_FROM_USER, to=[user.email]) email.send() function 2 def activate_user(request, uidb64, token): try: # uid = force_str(urlsafe_base64_decode(uidb64).decode()) uid = force_str(urlsafe_b64decode(uidb64)) user = models.PersonalUser.objects.get(pk=uid) except Exception as e: user = None if user and generate_token.check_token(user, token): user.is_email_verified = True user.save() print('user activated') return redirect(reverse('login')) return render(request, 'authentication/email/activation-failed.html') Then I have my main signup class: class PersonalRegister(View): def post(self, request, *args, **kwargs): ... #get data from form using request.POST.get send_action_email(request.user, request) ... def get(self, request, *args, **kwargs): return render(request, 'authentication/personal/personal_signup.html') When I run my app I get error AttributeError: 'AnonymousUser' object has no attribute 'is_email_verified'. What have I tried? Logging in before doing authentication proccess and It worked but point is to make new user logged out. Later I am also planning on restricting access to registration … -
Django adding link to parent when creating child in a many to one relationship
I have two models in a one to many relationship. I am editing a parent record and creating a child. When I create the child I cannot figure out how the send a reference of the parent so that I can instantiate the ForiegnKey of the child to point to the parent. Could anyone help. thanks The parent is: class Site(models.Model): name = models.CharField(max_length=100) address1 = models.CharField(max_length=100) address2 = models.CharField(max_length=100) postcode = models.CharField(max_length=50) user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="sites") def __str__(self): return f"{self.name}, {self.postcode}" def get_queryset(): return set.request.user.sites.all() the child is: class Administrator(models.Model): first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) telephone = models.CharField(max_length=50) email = models.EmailField() site = models.ForeignKey( Site, on_delete=models.CASCADE, related_name="adminstrators" ) def __str__(self): return f"{self.first_name} {self.last_name}, {self.email}" I am trying to point the child at the parent in the child's validation function: def form_valid(self, form): self.object = form.save(commit=False) self.site = # I don't know what to put here as I have to reference to the parent Site object self.object.save() return HttpResponseRedirect(self.get_success_url()) -
Password Authentication failed for user 'postgres' and default to windows user in PyCharm Professional
I have installed PostgreSQL on my windows PC. During installation I was asked a choose a password and a default user: postgres was assigned. I am trying to connect PostgreSQL to PyCharm for a Django project. I have changed my default database to PostgreSQL and tested the connection in the database. It worked perfectly. Below is the databases in the settings.py file. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'btredb@localhost', 'USER': 'postgres', 'PASSWORD': 'PG_PASSWORD', 'HOST': '127.0.0.1', 'PORT': '5432', } } However, when I run manage.py runserver I get a password authentication failed for use 'cheap' which is my windows user. Why is PyCharm trying login to the windows user instead of the PostgreSQL user set in the databases settings? Can any one help to connect PostgreSQL to PyCharm professional? -
Add extra property to this json response returned by Django rest framework
I am running django 4.0.6 with djangorestframework. This is my serializers.py from django.contrib.auth import get_user_model from rest_framework import serializers class UserSerializer(serializers.ModelSerializer): # new class Meta: model = get_user_model() fields = ( "id", "username", ) This is my views.py from django.contrib.auth import get_user_model from rest_framework import generics from .serializers import UserSerializer class UserList(generics.ListCreateAPIView): queryset = get_user_model().objects.all() serializer_class = UserSerializer Here is the json response of the API; { "count": 3, "next": null, "previous": null, "results": [ { "id": 1, "username": "test" }, { "id": 4, "username": "test1" }, { "id": 8, "username": "test3" } ] } I would like to add an extra property to this json response returned by Django rest framework such that it will look like this; { "count": 3, "next": null, "previous": null, "results": [ { "id": 1, "username": "test" "combine" : "test 1" }, { "id": 4, "username": "test1" "combine" : "test1 4" }, { "id": 8, "username": "test3" "combine" : "test3 8" } ] } The extra property combine is created by concatenating id and username. -
Django 4.1: How do I set Profile model's slug field's default value to username?
I've created a profile model for [Django's default user model](https://docs.djangoproject.com/en/4.1/ref/contrib/auth/#user-model) and I want to create a slug for it so that it can be called using a username and not a user id or pk, I've tried this so far but I've achieved nothing, **I'm not asking you to complete the way I'm trying to achieve this but if there is a better way of doing it, Please tell me** models.py: ```py from django.db import models from django.contrib.auth.models import User from django.urls import reverse from django.template.defaultfilters import slugify class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) bio = models.TextField(blank=True, null=True) profile_picture = models.ImageField(upload_to=user, blank=True) slug = models.SlugField() def get_absolute_url(self): return reverse('details', kwargs={'slug': self.slug}) def save(self, *args, **kwargs): if not self.slug: self.slug = slugify(User.objects.get(user__id = 1).username) return super().save(*args, **kwargs) urls.py: ```py from django.urls import path from django.contrib.auth.views import LogoutView from .views import UserCreateView, UserLoginView, UserProfileCreateView urlpatterns = [ path('register/', UserCreateView.as_view(), name='signup'), path('login/', UserLoginView.as_view(), name='login'), path('logout/', LogoutView.as_view(), name='logout'), path('u/<slug:slug>/edit_profile/', UserProfileCreateView.as_view(), name='edit_profile') ] -
Django - before model create
I have a model: book(book_id, release_year, book_number_by_release_year) Field book_number_by_release_year must be automatically generated and incremented by 1 within the release_year field for new model instances. What is the best way to do this in Django? Thank you for your help -
Django How To annotate/Group by & Display it in Serializer
I have following Model class ModelAnswer(BaseModel): questions = models.ForeignKey( to=Question, on_delete=models.CASCADE ) answer = models.TextField() user = models.ForeignKey(User, on_delete=models.CASCADE) Basically usecase is answer can be added multiple time i.e at once 3 answer can be added and all answers needed to be added for particular question I just made another model to keep track of these things in next model for my easiness. class AnswerLog(BaseModel): answer = models.ForeignKey(to=ModelAnswer, on_delete=models.CASCADE, null=True, blank=True) user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True) order = models.PositiveIntegerField(null=True, blank=True) I am getting my response in this format [ { "answer":{ "id":42, "user":1, "questions":"what did you do today", "subcategory":"Circumstance", "is_intentional":"False", "answer":"I played well", "created_at":"2022-09-05T21:00:57.604051" }, "order":1, "category":"sports" }, { "answer":{ "id":43, "user":1, "questions":"what was your achievment?", "subcategory":"Result", "is_intentional":"False", "answer":"a broked my leg", "created_at":"2022-09-05T21:00:57.626193" }, "order":1, "category":"sports" } ] I just want my above response in a bit easier format in this way just combine by order and category because both will be ( category can still be same for another answer so order will only be different for next answer i.e 2) [{ "answer":[{ "id":42, "user":1, "questions":"what did you do today", "subcategory":"Circumstance", "is_intentional":"False", "answer":"I played well", "created_at":"2022-09-05T21:00:57.604051" },{ "id":43, "user":1, "questions":"what was your achievment?", "subcategory":"Result", "is_intentional":"False", "answer":"a broked my … -
Post allauth intinate post handshake
Since allauth 0.47.0. You are suppose to intinate the sign up with a post handshake, I just don't understand how to do it and if it is suppose to be in the frontend or the backend. -
I can't show images in django
Not finding my image to show in django I can't see why is that I think there is something with my setting.py , cause I couldn't find MEDIA_URL and MEDIA_ROOT in there but I should I don't know how to direct the program to static/images/defaul.jpg actually and I am going through a course that it did excatly what I did but it keep saying that it can't find the image so I need your help guys here are my codes models.py from django.db import models # Create your models here. from django.db import models import uuid # null is for database and blank is for django # auto_now_add automatically add the date and the time that a object of this model created # Use it to override the id cause django automatically create id for any object # Use uuid and unique to make 16 chars id and unique ids # Use primary key to use it as primary key in database class Project(models.Model): objects = None title = models.CharField(max_length=200) description = models.TextField(null=True, blank=True) image = models.ImageField(null=True, blank=True, default='default.jpg') demo_link = models.CharField(null=True, blank=True, max_length=2000) source_link = models.CharField(null=True, blank=True, max_length=2000) created = models.DateTimeField(auto_now_add=True) id = models.UUIDField(default=uuid.uuid4, unique=True, primary_key=True, editable=False) tag = … -
django makemigrations no changes detected when use foreignkey
I ran into this problem. practically with makemigrations it saves me all the changes except the foreignkey .. it is as if it does not consider that line at all from django.db import models class Ingrediente(models.Model): nome_ingre = models.CharField(max_length=20) def __str__(self): return self.nome_ingre class Panino(models.Model): nome_panino = models.CharField(max_length=20) composizione = models.ForeignKey(Ingrediente, on_delete=models.CASCADE) def __str__(self): return self.nome_panino -
Django Queryset not displaying all results related to a member
i am trying to show data related to order table VIEWS.py class HBTYReadView(DetailView): model = HbtyOrder context_object_name = 'hairbty' template_name = 'accounts/modals/hairbty/read_hbty.html' MODELS.PY class HbtyOrder(models.Model): STATUS = ( ('Pending', 'Pending'), ('Out for delivery', 'Out for delivery'), ('Delivered', 'Delivered'), ) hbtycustomer = models.ForeignKey(HbtyCustomers, on_delete=models.SET_NULL, blank=True, null=True) itm = models.CharField(max_length=200, null=True) date_created = models.DateTimeField(auto_now_add=True, null=True, blank=True) status = models.CharField(max_length=200, null=True, choices=STATUS) URLS.PY path('read_hairbty/<int:pk>', views.HBTYReadView.as_view(), name='read_hairbty'), Currently showing a user with one order but not a user with many orders. THANK YOU -
django-elasticsearch-dsl-drf filter fields size
There are size options for the Suggester field in django-elasticsearch-dsl-drf . So how do we use the filter extra(size=20) function that we use while writing a query in django-elasticsearch-dsl in django-elasticsearch-dsl-drf view or is there a size option like in the suggestion? filter_fields = { 'stat': { 'field': 'Stat.raw', 'lookups': [ LOOKUP_QUERY_IN, LOOKUP_FILTER_RANGE, ], 'default_lookup': LOOKUP_FILTER_WILDCARD, 'options': { 'size': Pallets.objects.all().count(), }, }, } suggester_fields = { 'Pallet_Id': { 'field': 'Pallet_Id.suggest', 'suggesters': [ SUGGESTER_COMPLETION, ], 'options': { 'size': Pallets.objects.all().count(), }, }, -
Rendering form in React based of DRF response
I already defined all the constraints for the fields of my models in the models.py or the serializer, so can i use that data to render forms to react? Defining them again in React seems like an errorsource if someone ever changes the form and introduces redundancy. I already tried it like this: from .serializer import StammdatenSerializer from .models import Probanden class Stammdaten(ModelViewSet): """ API endpoint that handles data for StammdatenForm. """ queryset = Probanden.objects.all() serializer_class = StammdatenSerializer permission_classes = [permissions.IsAuthenticated] template_name = "stammdatenForm.html" @action( detail=True, methods=["GET"], renderer_classes=[TemplateHTMLRenderer] ) def get_form(self, request, pk): profile = get_object_or_404(Probanden, pk=pk) serializer = StammdatenSerializer(profile) return Response({"serializer": serializer, "profiles": profile}) which seems to work fine for returning the rendered form, but now i dont know how to use that response in a react component. All i can think of is: using dangerouslySetInnerHtml and loading it into a div component. But then i completly lose the option to use states for the form elements or handle the submit. Is there an option to nicely integrate drf and react? -
Transaction Management with Raw SQL and Models in a single transaction Django 1.11.49
I have an API which reads from two main tables Table A and Table B. Table A has an column which has a column which acts as foreign key to Table B entries. Now inside api flow, I have a method which runs below logic. Raw SQL -> Joining table A with some other tables and fetching entries which has an active status in Table A. From result of previous query we take the values from Table A column and fetch related rows from Table B using Django Models. It is like query = "Select * from A where status = 1" #Very simplified query just for example cursor = db.connection.cursor() cursor.execute(query) results = cursor.fetchAll() list_of_values = get_values_for_table_B(results) b_records = list(B.objects.filter(values__in=list_of_values)) Now there is a background process which will enter or update new data in Table A and Table B. That process is doing everything using models and utilizing with transaction.atomic(): do_update_entries() However, the update is not just updating old row. It is like deleting old row and deleting related rows in Table B and then new rows are added to both tables. Now the problem is if I run api and background job separately then everything is good, but … -
how to force Django to use specific version of database
I have upgraded to python 3.9 and it requires Postgressql 11 to work. I was using Postgressql 10 already and I found out that I have 11 installed.. but I don't know how to force Django to use this version $ dpkg -l | grep PostgreSQL ii pgdg-keyring 2018.2 all keyring for apt.postgresql.org ii postgresql 10+190ubuntu0.1 all object-relational SQL database (supported version) ii postgresql-10 10.22-0ubuntu0.18.04.1 amd64 object-relational SQL database, version 10 server ii postgresql-11 11.17-1.pgdg18.04+1 amd64 The World's Most Advanced Open Source Relational Database ii postgresql-client-10 10.22-0ubuntu0.18.04.1 amd64 front-end programs for PostgreSQL 10 ii postgresql-client-11 11.17-1.pgdg18.04+1 amd64 front-end programs for PostgreSQL 11 ii postgresql-client-common 242.pgdg18.04+1 all manager for multiple PostgreSQL client versions ii postgresql-common 242.pgdg18.04+1 all PostgreSQL database-cluster manager ii postgresql-contrib 10+190ubuntu0.1