Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Do I need a default authentication system even I know pretty much
I can create user table and use it as a default login activity. I don't have hands on experiance of django's conf.auth. I am using my own login system. I can create session object, can manage session timeout as well . I can delete session whenever logout. I can create a decorator by my own do I still need still go for auth. explain me why and how I can improve my experiance of it. or what else I am missing to dodge default auth and login mechanism -
How to process every line of an output in python django
Sorry if the subject is not clear enough. This is my urls.py in Django: from django.contrib import admin from django.urls import path # imported views from cron import views urlpatterns = [ path('admin/', admin.site.urls), # configured the url path('',views.index, name="homepage") ] This is views.py: from django.http import HttpResponse from subprocess import * import codecs def index(request): with open('/home/python/django/sites.txt', 'r') as file: for site in file: with open('output.html', 'a') as file2: out = run(["ssh", "-o StrictHostKeyChecking=accept-new", "-p1994", f"root@{site}".strip(), "crontab", "-l"], capture_output=True) out = out.stdout out = codecs.decode(out, 'unicode_escape') file2.write(str(f'Server is: <span style=\'font-weight:bold\'>{site.strip()}</span>')) file2.write(str(rf'<p>{out}</p>')) file2.write('\n') with open('output.html', 'r') as new: return HttpResponse(new) This is sites.txt: 1.1.1.1 2.2.2.2 3.3.3.3 This is the output.html in text editor: Server is: <span style='font-weight:bold'>1.1.1.1</span><p>#30 16 * * * /usr/bin/bash /home/backup/ftp 0 0 * * * /usr/bin/bash /home/backup/ftp > /dev/null 2>&1 </p> Server is: <span style='font-weight:bold'>2.2.2.2</span><p>#30 16 * * * /usr/bin/bash /home/backup/ftp 0 0 * * * /usr/bin/bash /home/backup/ftp > /dev/null 2>&1 </p> Server is: <span style='font-weight:bold'>3.3.3.3</span><p>#30 16 * * * /usr/bin/bash /home/backup/ftp 0 0 * * * /usr/bin/bash /home/backup/ftp > /dev/null 2>&1 </p> I know this HTML format is not correct to show properly in web, but I don't know how to make it better so that … -
Should I use regular SQL instead of an ORM to reduce bandwith usage and fetching time?
I'm building a ethereum explorer for fun with django ORM (never used it before). here is a part of my schema : class AddressModel(models.Model): id = models.BigIntegerField(primary_key=True) first_seen = models.DateTimeField(db_index=True) addr = models.CharField(max_length=42, db_index=True, on_delete=models.PROTECT) is_contract = models.BooleanField() is_token = models.BooleanField() is_wallet = models.BooleanField() class BlockModel(models.Model): id = models.BigIntegerField(primary_key=True) number = models.BigIntegerField() status = models.CharField(max_length=20) timestamp = models.DateTimeField(db_index=True) epoch_proposal = models.IntegerField() slot_proposal = models.IntegerField() fee_recipient = models.ForeignKey(AddressModel, on_delete=models.PROTECT) block_reward = models.BigIntegerField() total_difficulty = models.CharField(max_length=100) size = models.IntegerField() gas_used = models.BigIntegerField() gas_limit = models.BigIntegerField() base_fee_per_gas = models.BigIntegerField() burnt_fee = models.BigIntegerField() extra_data = models.TextField() hash = models.CharField(max_length=66) parent_hash = models.CharField(max_length=66) state_root = models.CharField(max_length=66) withdrawal_root = models.CharField(max_length=66) Nonce = models.CharField(max_length=20) # you can do address_model_instance.transactionmodel_set.objects.all() since there is a FK in Transaction model class TransactionModel(models.Model): id = models.BigIntegerField(primary_key=True) hash = models.CharField(max_length=66) block = models.ForeignKey(BlockModel, on_delete=models.PROTECT) from_addr = models.ForeignKey('AddressModel', related_name='from_addr', on_delete=models.PROTECT) to_addr = models.ForeignKey('AddressModel', related_name='to_addr', on_delete=models.PROTECT) input = models.TextField() is_valid = models.BooleanField() What concerns me here is that if I want to retrieve every transaction related to a specific from_addr it will also retrieve the bloc data in the returned object, if the from_addr has 10K transaction that is 10K block data that I don't need. with regular SQL I would only get a … -
django-nested-admin nested model initial values
I've been working with django-nested-admin for editing admin models that have foreign key relationships to other tables. Frankly it's beautiful. I love it. But I have a pair of models here I'm having a bit of trouble with. I have a Chapter, representing a chapter of a club. Each chapter has a one or more useful links to things like their web page or wiki articles or whatever. Both classes have a field of 'registrar' which is the user that created them. Basically whoever was logged in to the system when the instance was created. For Chapter, this went fairly easily. I just added def get_changeform_initial_data(self, request): get_data = super(ChapterAdmin, self).get_changeform_initial_data(request) get_data['registrar'] = request.user.pk return get_data To the ChapterAdmin class. It pre-populates just fine. But when I tried to do the same with the UsefulLinksInline, that ChapterAdmin uses. I've been down a rabbit hole of googling and break-point surfing trying to figure out how to pre-populate the UsefulLink class's registrar field with the current user. In UsefulLinksInline, if I remove the registrar field from the fields=() list, I get an error stating that the null constraint on registrar was being violeted. If I leave it in, however, the Registrar combo … -
Where to host Django project files on deployment server
New to Django here. I have developed a minimum working django website with Postgres as database back-end and nginx/gunicorn as web server on Ubuntu linux. Currently all the files are on my laptop in ~/workspace/djangoapp/src$ in my home directory. I want to now deploy the project to GCP. Which directory, on the production server, the files would go in? It can't be my home directory on the production server. Shouldn't they go in one of the system directories like /opt? -
How to prevent auto-filling of other Django forms when updating a specific form and how to make them not required to fill?
I have some Django forms each one with an update button that I'm rendering on a template. When I try to submit something through the button I can't because It says I have to fill every form. I also run into the problem that when I try to update a form the value in the other forms changes and auto-fills. forms.py class ImageUpdateForm(forms.ModelForm): image = forms.ImageField(widget=forms.FileInput) class Meta: model = User fields = ['image', 'mnemonic'] def clean(self): super(ImageUpdateForm, self).clean() mnemonic = self.cleaned_data.get('mnemonic') if mnemonic != self.instance.mnemonic: self._errors['mnemonic'] = self.error_class([ 'The mnemonic is wrong!']) return self.cleaned_data class PasswordUpdateForm(forms.ModelForm): class Meta: model = User fields = ['password', 'mnemonic'] def clean(self): super(PasswordUpdateForm, self).clean() mnemonic = self.cleaned_data.get('mnemonic') if mnemonic != self.instance.mnemonic: self._errors['mnemonic'] = self.error_class([ 'The mnemonic is wrong!']) return self.cleaned_data class PinUpdateForm(forms.ModelForm): class Meta: model = User fields = ['pin', 'mnemonic'] def clean(self): super(PinUpdateForm, self).clean() mnemonic = self.cleaned_data.get('mnemonic') if mnemonic != self.instance.mnemonic: self._errors['mnemonic'] = self.error_class([ 'The mnemonic is wrong!']) return self.cleaned_data class MnemonicUpdateForm(forms.ModelForm): class Meta: model = User fields = ['mnemonic', 'password'] def clean(self): super(MnemonicUpdateForm, self).clean() password = self.cleaned_data.get('password') if password != self.instance.password: self._errors['password'] = self.error_class([ 'The password is wrong!']) return self.cleaned_data views.py def UpdateView(request): user = request.user if request.method == 'POST': mnemonic_form = … -
Implementing Name Synchronization and Money Transfers in Transactions Model with Account Number Input
I have the following models in my Django application: class Transaction (models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) account_number = models.IntegerField() name = models.CharField(max_length=50) amount = models.DecimalField() created_on = models.DateTimeField() class Wallet(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) account_balance = models.DecimalField(default=0) class AccountNum(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) account_number = models.IntegerField() slug = models.SlugField(unique=True) I want to implement a feature where the name field in the Transactions model gets synchronized with the account owner's name based on the provided account_number input. Additionally, I want to enable money transfers using the current user's wallet and the specified amount in the Transactions model. To provide some context, I have a post-save signal generate_account_number which generates a random 6-digit account number and creates an AccountNum object for a newly created user. What are some recommended techniques or approaches to achieve this synchronization of the name field with the account owner's name and enable money transfers using the wallet model and specified amount in the Transaction model? -
ImportError: PyO3 modules may only be initialized once per interpreter process
I am working on a Django project which includes DRF. The application is dockerized. Everything was working fine then suddenly I got the following error in my logs and I am completely clueless how it arrived patients | [uWSGI] getting INI configuration from /patients/src/_settings/local-test/uwsgi.ini patients | [uwsgi-static] added mapping for /static/ => /static/ patients | *** Starting uWSGI 2.0.21 (64bit) on [Fri Jun 2 13:59:34 2023] *** patients | compiled with version: 10.2.1 20210110 on 02 June 2023 10:11:18 patients | os: Linux-5.19.0-42-generic #43~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Apr 21 16:51:08 UTC 2 patients | nodename: 9be86066078d patients | machine: x86_64 patients | clock source: unix patients | pcre jit disabled patients | detected number of CPU cores: 8 patients | current working directory: /patients/src patients | detected binary path: /usr/local/bin/uwsgi patients | uWSGI running as root, you can use --uid/--gid/--chroot options patients | setgid() to 33 patients | *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** patients | chdir() to /patients/src patients | your memory page size is 4096 bytes patients | detected max file descriptor number: 1048576 patients | building mime-types dictionary from file /etc/mime.types...1476 entry found patients | lock engine: pthread robust … -
Advice for developing a ticket selling platform for events
I'm a junior developer with little experience from Argentina. I have done courses in JavaScript, CSS, React, python, django and SQL. I want to develop a platform for selling tickets for events. In the beginning, it will be basic to show in my portfolio but I want to continue developing until it gets fully functional and advanced to be used as a real business. The platform need user registration with many profiles like “Promoters” who can create events, manage them, take statistics, “Final users” who can buy tickets from all the events already created, see all the bought tickets, transfer tickets to another users and “Sellers” who can be assigned to events by promoters to sell tickets through a personalized link (which can be traceable). When users log-in there should be a kind of a dashboard with all the functions mentioned before (and more). The home page will be basic, with cards of all the uploaded events. Before I start the project, I want to be sure that I'm using the correct technologies and that everything is scalable because like I said before the mid-term objective is that it gets real. I was thinking of using React and maybe Next.JS … -
How can we host a django project using aws, s3 and dynamo dB
Help me to deploy and host a Django project on AWS using S3 and DynamoDB without running any codes manually, how to set up an S3 bucket to store static files, configure Django settings to use the S3 bucket for static files, set up a DynamoDB table for data storage, configure Django settings to use DynamoDB as the database, deploy the Django project using AWS Elastic Beanstalk, and ensure 24/7 availability of the hosted project? created a python django project.I want to host using aws, s3 and dynamo db.Already created an aws account -
Python show output of remote SSH command in web page in Django
I have a simple Django app to show the output of an SSH remote command. views.py: from django.http import HttpResponse from subprocess import * def index(request): with open('/home/python/django/cron/sites.txt', 'r') as file: for site in file: # out = getoutput(f"ssh -o StrictHostKeyChecking=accept-new -p1994 root@{site} crontab -l") out = run(["ssh", "-o StrictHostKeyChecking=accept-new", "-p1994", f"root@{site}".strip(), "crontab", "-l"]) return HttpResponse(out) urls.py: from django.contrib import admin from django.urls import path # imported views from cron import views urlpatterns = [ path('admin/', admin.site.urls), # configured the url path('',views.index, name="homepage") ] sites.txt: 1.1.1.1 2.2.2.2 3.3.3.3 The issue is when I run localhost:5000, I see this: CompletedProcess(args=['ssh', '-o StrictHostKeyChecking=accept-new', '-p1994', 'root@3.3.3.3', 'crontab', '-l'], returncode=0) While I should see something like this: * * * * * ls * * * * * date * * * * * pwd I tried with both run and getoutput, but they either don't connect or the output is shown in terminal only. How can I run this and show the output in the webpage? -
DJANGO Get First, Second and Thrid most found Value in a Model
I got a Dashboard model that is filled by a schduled Job. dashboard model class dashboard(models.Model): topvul1=models.IntegerField(default=0) topvul2=models.IntegerField(default=0) topvul3=models.IntegerField(default=0) I want to show the most found, second most found and third most found VID from the clientvul model. And fill it once per Day to my dashboard model. clientvul model class clientvul(models.Model): client= models.ForeignKey(client, on_delete=models.CASCADE) vid=models.ForeignKey(vul, on_delete=models.CASCADE) path=models.CharField(max_length=1000) product=models.CharField(max_length=1000) isactive=models.BooleanField(default=True) class Meta: constraints = [ models.UniqueConstraint( fields=['client', 'VID'], name='unique_migration_host_combination' # legt client und VID als Primarykey fest ) ] -
Why does django url tag with argument work in VS Code but not Visual Studio 2019?
I have a simple django app built in Visual Studio 2019 using python. I am trying to use a url template tag to open a record in a form on another page in order to update that record but it always returns: 'reverse not found...' This is the template tag (uform.id is the argument): <td><a href="{% url 'app:form-update' uform.id %}">{{ obj.form_name }}</a></td> The url paths: from django.urls import path from app import views app_name = 'app' urlpatterns = [ path('', views.home, name='home'), path('form-create/', views.create_form, name='form_create'), path('form-update/<str:pk>/', views.updateForm, name='form-update'), ] The view: def updateForm(request, pk): uform = Forms.objects.get(id=pk) form = FormRegisterForm(instance=uform) if request.method == 'POST': form = FormRegisterForm(request.POST, instance=uform) if form.is_valid(): form.save() return redirect('app:form_register') context = {'form': form} return render(request, 'app/form_create.html', context) When I replace the id argument in the url template tag with an id such as 19, it works without error. This suggests the syntax of the url template tag is wrong, however the same syntax works in other apps I have created using VS Code. I don't understand why it won't work in Visual Studio 2019. Any help would be greatly appreciated. -
Django admin interface custom logo not found 404
I have just started with django I created a new project and installed Django admin-interface also installed the bootstrap theme then tried to upload my logo in the theme settings but the logo doesn't appear , also I get this error in the terminal "GET /admin-interface/logo/logo.png HTTP/1.1" 404 2164 I haven't changed anything in the default code -
How to specify qantity of multiple model objects by form
So, im making my first pet project with django and im struggling with cart in my store. Many guides are doing quantity in cart by buttons, but i want to enter a value by number form like this: enter image description here So, i`ve come up with something like this: views.py def cart(request): if request.user.is_authenticated: customer = request.user.customer order, created = Order.objects.get_or_create(customer=customer, complete=False) items = order.orderitem_set.all() cartItems = order.get_cart_items forms = [] form = QuantityForm() if request.method == 'POST': for item in items: if item.quantity <= 0: item.delete() else: item_id = OrderItem.objects.get(id=item.id) form = QuantityForm(request.POST, instance=item_id, initial={'quantity':item.quantity}) else: items = [] order = {'get_cart_total':0, 'get_cart_items':0} cartItems = order['get_cart_items'] context = {"items": items, "title": "Cart ◦ Shoppica", "order": order, "form":form, 'cartItems': cartItems} return render(request, 'store/cart.html', context) forms.py class QuantityForm(ModelForm): class Meta: model = OrderItem fields = ['quantity'] cart.html {% for item in items %} <tr class="even"> <td valign="middle"><input type="checkbox" /></td> <td valign="middle"><a href="{% url 'Product' item.product.slug %}"><img src="{{ item.product.photo_front.url }}" width="60" height="60" alt="{{ item.product.title }}" /></a></td> <td valign="middle"><a href="{% url 'Product' item.product.slug %}"><strong>{{ item.product.title }}</strong></a></td> <td valign="middle">{{ form.quantity }}</td> <td valign="middle">${{ item.product.price }}<span class="s_currency s_after"> </span></td> <td valign="middle">${{ item.get_total }}<span class="s_currency s_after"></span></td> </tr> {% endfor %} But when post form all … -
I created a file using "django-admin startproject <filename>", but can't find it on my system
I used the following commands in this process-- pip install virtualenv cd desktop virtualenv env env\Scripts\activate pip install django django-admin startproject But i cant find the file on my desktop even though it got created successfully. -
how to add product in cart in Django
i am trying to add product to cart by getting its id this is the path enter image description here this is views.py view.py enter image description here '''please suggest me a way to get product by their id and to add them in cart ''' -
Bootstrap-table data clears on search, filter or paginate after Ajax call
In my Django template I have a bootstrap-table (version 1.21.2) (https://bootstrap-table.com/) which is filled with multiple customers, whenever a customer is clicked, it will create a popup with a bootstrap-table in which all data for that customer is displayed using Ajax. The problem, is that, whenever I try to search, filter or paginate, it clears the entire table. I think this is because bootstrap-table clears the entire table, and then refills it with whatever you're trying to search. Here is my code: Ajax: function get_customer_leadtime(customerCode, customerName, warehouse) { $.ajax({ type:"GET", url: "{% url 'get_customer_leadtime' %}", data:{ "customerCode": customerCode, "customerName": customerName, "warehouse": warehouse }, success: function (response) { var title = customerName var table = $("#customerLeadtimeTable tbody"); document.getElementById("customerLeadtimeLabel").innerHTML = title; table.empty() $.each(response, function(idx, customerInfo){ $.each(customerInfo, function(_, details){ table.append( "<tr><td>"+details.Article +"</td><td>"+details.Leadtime +"</td></tr>" ); }); }); $("#customerLeadtimeModal").modal('show'); }, error: function (response) { console.log(response) } }); } Ajax GET example URL: GET /get/ajax/leadtime?customerCode=00000&customerName=SomeCustomer%20BV&warehouse=SomeLocation HTTP/1.1" 200 9216 HTML: <table class="table table-hover table-sm" id="customerLeadtimeTable" data-toggle="table" data-show-multi-sort="true" data-show-search-clear-button="true" data-show-export="true" data-search="true" data-filter-control-multiple-search="true" data-filter-control="true" data-search-align="left" data-pagination="true" data-side-pagination="client" data-page-size="10" data-page-list="[10, 25, 50, ALL]" data-click-to-select="true" data-show-toggle="true" data-show-columns="true" > <thead> <tr> <th scope="col" data-field="Article" data-width="50" data-width-unit="%">Article</th> <th scope="col" data-field="Leadtime" data-width="50" data-width-unit="%">Average leadtime</th> </tr> </thead> <tbody> <tr> </tr> </tbody> </table> Image of the … -
Add a OnetoOne field in an already populated Django ORM
I have this customer model where I want to introduce a user field where the user field is user = models.OneToOneField(User, on_delete=models.CASCADE) but there are already some objects in this model so if i create this one to one field then it would ask me for a default value for those objects but I cannot pass default values because it'll clash with the logic. Old model: class Customer(models.Model): first_name = models.CharField(max_length=50, default=0) last_name = models.CharField(max_length=50, default=0) customer_display_name = models.CharField(max_length=50, default=0) customer_name = models.CharField(max_length=50, default=0) customer_phone = models.CharField(max_length=50, default=0) customer_website = models.CharField(max_length=50, default=0) customer_email = models.EmailField(max_length=250, default=0, blank=True, null=True) shipping_address = models.ManyToManyField(CustomerShippingAddress) billing_address = models.ManyToManyField(CustomerBillingAddress) active = models.BooleanField(default=True) remarks = models.CharField(max_length=500, default=0, blank=True, null=True) owner = models.ForeignKey(User, on_delete=models.CASCADE) New model: class Customer(models.Model): first_name = models.CharField(max_length=50, default=0) last_name = models.CharField(max_length=50, default=0) customer_display_name = models.CharField(max_length=50, default=0) customer_name = models.CharField(max_length=50, default=0) customer_phone = models.CharField(max_length=50, default=0) customer_website = models.CharField(max_length=50, default=0) customer_email = models.EmailField(max_length=250, default=0, blank=True, null=True) shipping_address = models.ManyToManyField(CustomerShippingAddress) billing_address = models.ManyToManyField(CustomerBillingAddress) active = models.BooleanField(default=True) remarks = models.CharField(max_length=500, default=0, blank=True, null=True) owner = models.ForeignKey(User, on_delete=models.CASCADE) #Change1 user = models.OneToOneField(User, on_delete=models.CASCADE) #Change2 company = models.ForeignKey(Company, on_delete=models.CASCADE) #Change3 Reason owner - to track who created this Customer user - to link the Customer to User model company … -
Django sending emails with link
I have an email verification while registering, and the verify link must in the form of a hyperlink. from django.core.mail import send_mail from django.conf import settings def send_email_verification_mail(email, first_name, verify_link, exp): html = """ <a href="{link}">Click to verify</a> """ html.format(link=verify_link) subject = 'Your accounts need to be verified' message = f'Hi {first_name.capitalize()},\n\nClick on the link to verify your account \n \n{html}\n \nThis link will expire in {exp}' email_from = settings.EMAIL_HOST_USER recipient_list = [email] send_mail(subject, message, email_from, recipient_list) return True This is the what I'm getting -
How can I integrate my trained yolov5 model with a Django webapp for real-time object detection?
Im looking for a way to use my trained yolov5 model for real-time object detection on a Django webapp I tried saving the model in torchscript format and loaded the model in a function created in views.py. But when I run py manage.py runserver and try to load the webapp in my browser, my laptop camera seems to be on verge of opening but I end up having an error saying : RuntimeError: The size of tensor a (64) must match the size of tensor b (40) at non-singleton dimension 3 -
Hide and Show button inside a for-loop of template in Alpine.js and Django
Hide and Show button inside a for-loop of template in Alpine.js and Django. conversion of django if else condition template to Alpine.js, How do we convert this code inside a for-loop condition on template using Alpine.js {% if employee.allow_programme_membership_expiry %} <a href="{% url 'buyer:programme-membership-expiry' employee.buyer_id employee.id %}"> {% svg_icon "Change-Expiry" "w-6 h-6 dui-stroke-primary" None "Change Expiry" %} </a> {% endif %} -
How to test async django rest framework
I have a problem with testing async mode in the django rest framework using the adrf library. I created a django project with the view: from rest_framework.decorators import api_view as sync_api_view @sync_api_view(['GET']) def my_not_async_view(request): print('before block endpoint') time.sleep(15) return Response({"message": "my_async_view"}) and I run this code with the uvicorn: uvicorn async_django.asgi:application --workers=1 and test with the curl for x in `seq 1 3`; do time curl http://localhost:8000/async-test/not-async & done; echo Starting And I expect console log result to be (#1): before block endpoint and after 15 sec another before block endpoint but actual result is (#2): before block endpoint before block endpoint # runs in another thread before block endpoint # runs in another thread Why I want result to be (#1) ? Because I want to test async mode and be sure that async mode handling my request, not a thread/instance of the project: import asyncio from adrf.decorators import api_view @api_view(['GET']) async def get_async_response(request): print("async code is running") await asyncio.sleep(10) return Response({"message": "async_result"}) So my logic is when I send a request to my_not_async_view I shouldn't see before block endpoint after 1 call until it gives a response, because it should block my project, but when I send a … -
Why is my JS scroll animation not working in my Django template?
I am trying to do a scroll animation with js in django template that start counting when scrolling down and its not working this is my html <section class="numc"> <div class="nums"> <div class="num" data-goal="50">0</div> <div class="num" data-goal="60">0</div> <div class="num" data-goal="100">0</div> </div> </section> <script src="{% static 'javascript/js.js' %}"></script> and this is js code let nums = document.querySelectorAll(".nums .num"); let section = document.querySelector(".numc"); window.onscroll = function () { if (window.scrollY >= section.offsetTop) { nums.forEach((num) => startCount(num)); } }; function startCount(el) { let goal = el.dataset.goal; let count = setInterval(() => { el.textcontent++; if (el.textcontent == goal) { clearInterval(count); } }, 10); } -
I am getting same error everytime. Can you please guide me what to do
while True: user_type = input("Select user type from the list of users: Admin/Banker/Customer (or 'q' to quit): ") if user_type.lower() == "admin": login = bank_app.display_welcome_screen() from admin import admin_main admin_main() this is a part of my code which is getting error. the error is given below. Select user type from the list of users: Admin/Banker/Customer (or 'q' to quit): admin Traceback (most recent call last): File "C:\Users\DELL\Desktop\python projects\Bank System\main.py", line 153, in main() File "C:\Users\DELL\Desktop\python projects\Bank System\main.py", line 109, in main login = bank_app.display_welcome_screen() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: BankApp.display_welcome_screen() takes 0 positional arguments but 1 was given PS C:\Users\DELL\Desktop\python projects\Bank System> i have made a python banking app system. there are total of 4 files in my project. one is main.py file, second one is admin.py, third one is banker.py and the last one is customer.py. now when i run the main file using command python main.py, my output on the terminal is PS C:\Users\DELL\Desktop\python projects\Bank System> python main.py Account created successfully Account created successfully Deposited successfully Withdrawn successfully Transferred successfully 800.0 Do you want to continue? (y/n): y Account created successfully Account created successfully Deposited successfully Withdrawn successfully Transferred successfully 800.0 Do you want to continue? (y/n): n PS C:\Users\DELL\Desktop\python projects\Bank …