Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Why is my Heroku deployment not recognising my Procfile?
I'm trying to deploy my app using Heroku. I tried via CLI and also graphically in their user portal. I get this problem in the build log: Procfile declares types -> (none) It's not reading my Procfile. Here's some of the latest lines of my error logs: 2020-05-08T04:32:57.546072+00:00 app[api]: Deploy 02e1e06c by user djrgrey@gmail.com 2020-05-08T04:32:57.546072+00:00 app[api]: Release v7 created by user djrgrey@gmail.com 2020-05-08T04:33:05.475821+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=herokudanslist.herokuapp.com request_id=ff88cf27-54c2 -4611-b611-ce36c41b09f6 fwd="118.149.66.76" dyno= connect= service= status=503 bytes= protocol=https 2020-05-08T04:33:06.086210+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=herokudanslist.herokuapp.com request_id=a4 690f93-c8e3-4256-b46b-a8d1e69109c1 fwd="118.149.66.76" dyno= connect= service= status=503 bytes= protocol=https 2020-05-08T04:33:13.000000+00:00 app[api]: Build succeeded 2020-05-08T10:04:32.000000+00:00 app[api]: Build started by user djrgrey@gmail.com 2020-05-08T10:05:04.414084+00:00 app[api]: Release v8 created by user djrgrey@gmail.com 2020-05-08T10:05:04.414084+00:00 app[api]: Deploy 92e0c7b1 by user djrgrey@gmail.com 2020-05-08T10:05:37.245718+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=herokudanslist.herokuapp.com request_id=9cb80bd2-7cb6 -4e20-ad8a-e61aeeab0e02 fwd="118.149.66.76" dyno= connect= service= status=503 bytes= protocol=https 2020-05-08T10:05:39.210072+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=herokudanslist.herokuapp.com request_id=a2 9bf337-c13a-4eb7-83ef-e221bc69b6b7 fwd="118.149.66.76" dyno= connect= service= status=503 bytes= protocol=https 2020-05-08T10:05:40.000000+00:00 app[api]: Build succeeded I apologise for the bad formatting. How do I throw in logs? The code formatting wouldn't like it and was finnicky. -
Django : the content of post is not showing
hi am working on a project where user-added the post onto the site and driver check his post and give him offer ( price) to ship their load .when the driver submits the post(price) ....at the admin level the selected post and which driver adds the price is working properly, however when the same user logged in (which added the post earlier)and want to see the price of his post-offer by a particular driver. so how can I show to the front end with filtration of the particular user? this is my user post model class Loader_post(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE ,related_name="Loader") pick_up_station = models.CharField(max_length=150) destination_station = models.CharField(max_length=150) sender_name = models.CharField(max_length=150) phone_number = PhoneNumberField(null=False, blank=False, unique=True) receiver_name = models.CharField(max_length=150) def __str__(self): return self.user.username def get_absolute_url(self): return reverse("Loader:my_job", kwargs={"pk": self.pk}) here is the price added to the post class price(models.Model): my_post = models.ForeignKey(Loader_post, related_name='prices',on_delete=models.CASCADE, null=True, default='') user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE, null=True, default='') driver_price = models.CharField(max_length=150, null=True) driver_name = models.CharField(max_length=150, null=True) approved_price = models.BooleanField(default=False) status = models.BooleanField(default=False) def get_absolute_url(self): return reverse("Driver:Driverview") def __str__(self): return self.driver_price this is the view of the user post(views.py) class Loader_post_view(CreateView, LoginRequiredMixin): form_class = forms.Loader_post_form model = Loader_post template_name = "post_detail.html" success_url = reverse_lazy("Loader:my_job") def form_valid(self, form): print(form.cleaned_data) … -
Python, dictionary sum value
I have a dictionary obtained as following: test= {'Test': [sum(t) for t in zip(*data.values())],} And suppose that the test values as the following: test={ 'Test': [ t1, t2, t3, t4, t5 ] } I want to obtain the following result: results={ 'Test': [ r1=s1 , r2=r1+t2 , r3=r2+t3 , r4=r3+t4 , r5=r4+t5 ] } How could I get it? -
Why I send data to Django POST but fetch them in GET?
I am new to Django and built a simple test today. def login_web(request): request.encoding = "utf-8" print("body : ", request.body) print("POST : ", request.POST) print("GET : ", request.GET) username = request.POST.get("username") password = request.POST.get("password") print(username) print(password) user = auth.authenticate(username=username, password=password) if user is not None and user.is_active: print("YR1") auth.login(request, user) return JsonResponse({"foo": "bar1"}) else: print("IM2") return JsonResponse({"foo": "bar2"}) I used Postman to send post request to it. But the result is very confusing. body : b'' POST : <QueryDict: {}> GET : <QueryDict: {'username': ['chivier'], 'password': ['Chivyham07313']}> None None IM2 I should get them in request.POST but why they appear in request.GET. -
Values Are not print in my html table django 3
I want to show the values in an html table but the if elif condition not work or not compare with no_of_days. no_of_days is database table field. {% for item in all_reciept_vouchers %} <tr> {# <td>{{ }}&nbsp;</td>#} <td>{{ item.job_no}}&nbsp;</td> <td>{{ item.invoice_no}}&nbsp;</td> <td>{{ item.party_name}}&nbsp;</td> <td>{{ item.module}}&nbsp;</td> <td>{{ item.invoice_amount}}</td> {% if item.no_of_days >= 0 and item.no_of_days <= 30 %} <td>{{ item.reciept_net_amount}}</td> {% elif item.no_of_days >= 31 and item.no_of_days <= 60 %} <td>{{ item.reciept_net_amount}} </td> {% elif item.no_of_days >= 61 and item.no_of_days <= 90 %} <td>{{ item.reciept_net_amount}} </td> {% elif item.no_of_days >= 91 and item.no_of_days <= 120 %} <td>{{ item.reciept_net_amount}} </td> {% endif %} -
Photo not displaying in django html
I spent a few hours trying to find out what is going on but I can`t see why the photo is not displayed in my html file. Goal: Display the profile photo of each user Issue: Photo not displaying in django html detail.html <div class="col-sx-1 col-sm-5 text-right"> <a href="{% url 'contacts:detail' contact.id %}"> {% if contact.photo %} <img src="/{{ contact.photo.url }}" class="img-responsive"> {% else %} <h3>No image to display</h3> {% endif %} </a> </div> views.py def create_contact(request): form = ContactForm(request.POST or None, request.FILES or None) if form.is_valid(): contact = form.save(commit=False) contact.user = request.user contact.photo = request.FILES['photo'] file_type = contact.photo.url.split('.')[-1] file_type = file_type.lower() if file_type not in IMAGE_FILE_TYPES: context = { 'contact': contact, 'form': form, 'error_message': 'Image file must be PNG, JPG, or JPEG', } return render(request, 'contacts/create_contact.html', context) contact.save() return render(request, 'contacts/detail.html', {'contact': contact}) context = { 'form': form, } return render(request, 'contacts/create_contact.html', context) urls.py urlpatterns = [...] urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) models.py class Contact(models.Model): photo = models.ImageField(upload_to='profileimage', blank = True) settings.py STATIC_URL = '/static/' MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') Many Thanks, -
Python+Django - can't see my product image, name and price when I do those changes :
<div class="cart-row"> <div style="flex:2"><img class="row-image" src="{% static 'images/placeholder.png' %}"></div> <div style="flex:2">Product 1</div> <div style="flex:1">$20</div> <div style="flex:1"> <p class="quantity">2</p> <div class="quantity"> <img class="chg-quantity" src="{% static 'images/arrow-up.png' %}"> <img class="chg-quantity" src="{% static 'images/arrow-down.png' %}"> </div> </div> <div style="flex:1">$40</div> </div> THIS IS THE CODE I HAVE AND BELOW WHAT I HAVE CHANGED : {{**item.product.name**}} ${{**item.product.price|floatformat:2**}} {{**item.quantity**}} $40 -
Troubleshouting when query with date object in django
I followed the guide from django documentation and my code like this: riyou_date__range=(from_date_obj, to_date_obj) i printed the query and got sql like: `RIYOU_DATE` BETWEEN 2000-01-01 AND 2020-01-01 My expect query is `mei_cr`.`RIYOU_DATE` BETWEEN **'2000-01-01'** AND **'2020-01-01'** What should i do to get query like above. Thank you very much! -
(can only concatenate str (not "int") to str) this is the error i am getting why is it saying that i am trying to add string and int?
i am following django official documentation tutorial t make a poll app i am currently stuck on part 4.So when i select one of the choices it shows an error (can only concatenate str (not "int") to str). I cant understand am i trying to add a string to integer where is the problem in the code please herlp here is my code: views.py from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from .models import Choice, Question def index(request): latest_question_list = Question.objects.order_by('-pub_date')[:5] context = {'latest_question_list': latest_question_list} return render(request, 'polls/index.html', context) def detail(request, question_id): question = get_object_or_404(Question, pk=question_id) return render(request, 'polls/detail.html', {'question': question}) def results(request, question_id): question = get_object_or_404(Question, pk=question_id) return render(request, 'polls/results.html', {'question': question}) def vote(request, question_id): question = get_object_or_404(Question, pk=question_id) try: selected_choice = question.choice_set.get(pk=request.POST['choice']) except (KeyError, Choice.DoesNotExist): # Redisplay the question voting form. return render(request, 'polls/detail.html', { 'question': question, 'error_message': "You didn't select a choice.", }) else: selected_choice.votes += 1 selected_choice.save() # Always return an HttpResponseRedirect after successfully dealing # with POST data. This prevents data from being posted twice if a # user hits the Back button. return HttpResponseRedirect(reverse('polls:results', args=(question.id,))) urls.py from django.urls import path from . import views app_name = 'polls' … -
Django 2.0.8 crashes when resetting passwords are unequal
On of web projects that use Django 2.0.8. I forgot my password. So I decided to reset it using the "Forgotten password" wizard. After receiving the mail and opening the link, I got to the form where I need to insert my new password (field password1) and confirm it again (password2). As I made a mistake with writing two unequal passwords (password1=MyNewPass123), (password2=MyNewPass12), the app crashed with the error: ValueError at /auth/password/reset/confirm/<CODE>/set-password/ Need 2 values to unpack in for loop; got 17. <PATH>\lib\site-packages\django\template\defaulttags.py in render, line 202 So I went back and tried again, this time using two equal (valid) passwords which were successful. I repeated the password-reset step, using a new password (again 2 unequal inputs) and yet, it crashed. Searching for any bugs or related issued did not return any result. What is the main question here: Why does ForNode render in defaulttags.py receive so many items, just because of two unequal values.. What could be the solution for this? ForNode in defaulttags.py: class ForNode(Node): child_nodelists = ('nodelist_loop', 'nodelist_empty') def __init__(self, loopvars, sequence, is_reversed, nodelist_loop, nodelist_empty=None): self.loopvars, self.sequence = loopvars, sequence self.is_reversed = is_reversed self.nodelist_loop = nodelist_loop if nodelist_empty is None: self.nodelist_empty = NodeList() else: self.nodelist_empty = nodelist_empty … -
pip install unable to build wheel for scrypt and pyethash
I tried to install django-web3-auth with all the commands described in the official documentation pip install django-web3-auth and also tryied from github https://github.com/Bearle/django-web3-auth/archive/master.zip and pip install https://github.com/atereshkin/django-web3-auth/archive/master.zip but I always get the same error Building wheel for scrypt (setup.py) ... error... ERROR: Failed building wheel for scrypt, Building wheel for pyethash (setup.py) ... ERROR: Failed building wheel for pyethash. I am obsessed and desperate now. i'm on windows 10. I've already tried with all the ways I've read in blogs like use --no-cache-dir, but not work. I will love and be eternally grateful to anyone who can help me. i can't sleep with this problem in my head. -
UnboundLocalError: local variable 'faqs' referenced before assignmen
Unbound local error class ServiceHandlerAPI(APIView): def post(self, request, *args, **kwargs): try: link = kwargs.get('link') user = request.data.get('user') user = User.objects.filter(username=user).first() if user: student = user.student student.service_page_views = student.service_page_views + 1 student.save() service = Service.objects.filter(link=link).first() service_user = ServiceUser.objects.filter(user=user).first() if service_user: service_user = True else: service_user = False # testimonials = list(Testimonial.objects.filter(service=service).order_by('-timestamp').values()) testimonials = Testimonial.objects.filter(service=service).order_by('-timestamp') testimonials = TestimonialSerializer(testimonials, many=True) service = serializers.serialize('json', [service, ]) service = service[1: -1] service_name = list(Service.objects.filter(is_available=True).values('heading')) obj = FAQ.objects.all() serializer = FAQSerializer(obj, many=True) faqs = serializer.data if enable_otp: key_id = "rzp_live_6MxRlb7ZCO7XaB" client = razorpay.Client(auth=(key_id, "fGjvMdo8cs7o48pXou5sa3Y5")) else: key_id = "rzp_test_QiGwvmuHqNFHk5" client = razorpay.Client(auth=(key_id, "v4gHikpMnv2DVK0OK6CQ9Ttm")) except Exception as e: print(e) return JsonResponse({'service': service, "service_user": service_user, "faqs": faqs, 'service_name': service_name, 'testimonials': testimonials.data, 'key_id': key_id}) I have imported and included my faqs but still it throws me this error -
How to get a Count based on a subquery?
I am suffering to get a query working despite all I have been trying based on my web search, and I think I need some help before becoming crazy. I have four models: class Series(models.Model): puzzles = models.ManyToManyField(Puzzle, through='SeriesElement', related_name='series') ... class Puzzle(models.Model): puzzles = models.ManyToManyField(Puzzle, through='SeriesElement', related_name='series') ... class SeriesElement(models.Model): puzzle = models.ForeignKey(Puzzle,on_delete=models.CASCADE,verbose_name='Puzzle',) series = models.ForeignKey(Series,on_delete=models.CASCADE,verbose_name='Series',) puzzle_index = models.PositiveIntegerField(verbose_name='Order',default=0,editable=True,) class Play(models.Model): puzzle = models.ForeignKey(Puzzle, on_delete=models.CASCADE, related_name='plays') user = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True,null=True, on_delete=models.SET_NULL, related_name='plays') series = models.ForeignKey(Series, blank=True, null=True, on_delete=models.SET_NULL, related_name='plays') puzzle_completed = models.BooleanField(default=None, blank=False, null=False) ... each user can play any puzzle several times, each time creating a Play record. that means that for a given set of (user,series,puzzle) we can have several Play records, some with puzzle_completed = True, some with puzzle_completed = False What I am trying (unsuccesfully) to achieve, is to calculate for each series, through an annotation, the number of puzzles nb_completed_by_user and nb_not_completed_by_user. For nb_completed_by_user, I have something which works in almost all cases (I have one glitch in one of my test that I cannot explain so far): Series.objects.annotate(nb_completed_by_user=Count('puzzles', filter=Q(puzzles__plays__puzzle_completed=True, puzzles__plays__series_id=F('id'),puzzles__plays__user=user), distinct=True)) For nb_not_completed_by_user, I was able to make a query on Puzzle that gives me the good answer, but I am not able … -
How do you properly clone something in Javascript/JQuery?
I'm using .clone() to duplicate a form. I make small changes to the clone and then place it after the last form. As you can see from the screenshot it's mostly working; they look identical. The application (Django/Python) can process the clone as well once I press save. The problem is the calendar widget does not open when clicked (on the clone form). It does open if I click on the widget button for a form that already exists on the page when it first loads (not a clone). But on my clones the date picker does not open. What it should look like after I click on it (instead nothing happens): The cloned html seems to look identical in all the right ways. Existing form: Clone: Is something missing from the cloned html? Or is there something behind the scenes that is not working? I just don't understand what is broken here. JS/JQuery: function cloneMore(selector, prefix,form_class) { var newElement = $(selector).clone(true); var total = $('#id_' + prefix + '-TOTAL_FORMS').val(); newElement.find(':input:not([type=button]):not([type=submit]):not([type=reset])').each(function() { var name = $(this).attr('name').replace('-' + (total-1) + '-', '-' + total + '-'); var id = 'id_' + name; $(this).attr({'name': name, 'id': id}).val('').removeAttr('checked'); }); newElement.find('label').each(function() { var forValue … -
Is there any difference between `(\d+)` and `(\d)+` in Django URLconf? [duplicate]
In Django URLconf I saw two way to match a number: url(r'^grades/(\d+)/$', views.grade_detail), url(r'^grades/(\d)+/$', views.grade_detail), (\d+) and (\d)+, seems both works. is there any difference between them? or difference between (\w+) and (\w)+. -
What does "render" mean in Django?
What does it mean to "render a template" or to "render a form" in Django? Example 1: "Generally a view retrieves data according to the parameters, loads a template and renders the template with the retrieved data. Example 2: "Rendering a form in a template involves nearly the same work as rendering any other kind of object" Would the meaning of render in the above two examples be to "provide" or give"? -
Django best practice models question (from a beginner)
I want to create a model in Django that can describes a garden with rows for plants. Every plant needs some room to grow and i want to describe how many plants would fit in a row - I am a little bit stuck on how to best describe this in Django: from django.db import models from django.contrib.auth.models import User class Plant(models.Model): name = models.CharField('Plantname', max_length=120) size = models.PositiveIntegerField("area around plant in cm") qty = models.PositiveIntegerField("number of plants") color = models.CharField("color of blossom", max_length=20) class Patch(models.Model): FERT = "fertilized" BIO = "biological" METHODS = ((FERT, "Fertilized"), (BIO, "Biological")) type = models.Charfield("kind of patch", max_length=20, choices=METHODS) qty = models.PositiveIntegerField("number of patches") size = models.PositiveIntegerField("length of patch in cm") class task(models.Model): task_id = models.PositiveIntegerField('Task ID') person = models.ForeignKey(User, blank=True, null=True, on_delete=models.SET_NULL) patches = models.ManyToManyField(Patch) plants = models.ManyToManyField(Plant) Now I create: two example patches with 300 and 400cm length two example plants with 20 and 15cm length and I want to assign a task to a person that has the number of patches and plants he needs to work on. So when a task is created, I need to: ask for the size and number of the patches Choose the type of plant … -
How to create a pre-save signal in Django?
I have a model which generates a verification token: class VerificationTokenModel(BaseModel): user = models.OneToOneField(User, on_delete=models.PROTECT, related_name='verification_token') verification_token = models.CharField(max_length=100, editable=False, unique=True) token_type = models.CharField(max_length=100, choices=TOKEN_TYPE) expiry_time = models.DateTimeField(default=get_current_time) is_used = models.BooleanField(default=False) Now what I want is that no user can generate another access token within 5 minutes again and user can generate token maximum 10 times a day. How can I achieve this using pre-save signal? -
Implementing Folium inside Django project
I am having a hard time displaying a map inside a django application, and I would like to serve the data from Django models. Is there a way to do this? any help would be appreciated. -
How to use same nested seriaizer for create and listing
I need to use same serializer for create and listing ..... Here is my serializer ..... class OfficeSerializer(ModelSerializer): employees = EmployeeSerializer(many=True, read_only=True) state = StateSerializer(read_only=True) country = CountrySerializer(read_only=True) class Meta: model = Office exclude = ['office_id'] I am using this serializer for listing the office API... Can I able to use the same serializer for Creating ? This is my views.py class OfficeCreateView(CreateAPIView): queryset = Office.objects.order_by('id').all() serializer_class = OfficeSerializer def perform_create(self, serializer): serializer.save() In this case all the fields are saving excluding employees,state,country etc.... class OfficeSerializer(ModelSerializer): employees = EmployeeSerializer(many=True) state = StateSerializer() country = CountrySerializer() class Meta: model = Office exclude = ['office_id'] If I remove read_only field I am getting the following error in Postman { "employees": [ "This field is required." ], "state": [ "This field is required." ], "country": [ "This field is required." ] } How to resolve this -
Django How to customize forms file input
I working with Django & Tailwind CSS project where needs to upload image. I use forms to do this. Now form looks like: image = forms.ImageField(widget=forms.FileInput(attrs={ "class": "bg-nav-blue rounded-xl", } )) But for now it's looks like this one. But for my design I need button How to customize view of this form? -
how to make delete in GenericDeleteView() from Tamplete?
Here is the Model: from django.db import models: class RefugeCamp(models.Model): Camp_Name = models.CharField(max_length=100) Camp_District=models.CharField(max_length=30) Camp_Address =models.CharField(max_length=200) Camp_Block = models.IntegerField() Camp_Population = models.IntegerField() def __str__(self): return str(self.Camp_Name) Here is view : from django.shortcuts import render from django.shortcuts import render, redirect from django.http import HttpResponse from django.views.generic import ListView from django.urls import reverse_lazy from django.db import IntegrityError from django.views.generic import DetailView,UpdateView,DeleteView from django.contrib.auth.decorators import login_required from RefugeCamp.forms import RefugeCampForm from RefugeCamp.models import RefugeCamp # Create your views here. class detail_camp(DetailView): models=RefugeCampForm queryset = RefugeCamp.objects.all() paginate_by = 100 template_name = 'camp/detail.html' class list_camp(ListView): models=RefugeCamp queryset = RefugeCamp.objects.all() paginate_by = 100 template_name = 'camp/camps.html' def add_camp_view(request): if request.method == 'POST': form = RefugeCampForm(request.POST) if form.is_valid(): form.save() pk = form.instance.pk return redirect('camp:detail.html', pk=pk) else: form = RefugeCampForm() context = {'form': form} return render(request, 'camp/addcamp.html', context) class CampDeleteView(DeleteView): # specify the model you want to use model = RefugeCamp template_name = 'camp/delete.html' # can specify success url # url to redirect after sucessfully # deleting object Urls: from django.urls import path from .import views from RefugeCamp.views import list_camp ,detail_camp,CampDeleteView app_name = 'RefugeCamp' urlpatterns = [ path('', views.add_camp_view, name='addcamp'), path('camps/',list_camp.as_view(),name='camps'), path('detail/<int:pk>/', detail_camp.as_view(), name='detail'), path('delete/<int:pk>', CampDeleteView.as_view(), name='camp_delete'), ] now i want to call Delete function from camps.html {% … -
Get Data in a particular Format from serializers in Django
My Models: class Student(models.Model): name = models.CharField(max_length=100) email = models.CharField(max_length=100, unique=True) password = models.CharField(max_length=25) class Subject(models.Model): name = models.CharField(max_length=100) class Student_subject_mapping(models.Model): student = models.ForeignKey(Student, on_delete=models.CASCADE) subject = models.ForeignKey(Subject, on_delete=models.CASCADE) I'm trying to get all Student_subject_mapping data in the database in a format given below: { "results": [{ "id": 1, "email": "student_1@gmail.com", "subjects": [ { "id": 1, "name": "subject_1" }, { "id": 2, "name": "subject_2" }, ... ] }, My serializers: class StudentSerializer(serializers.ModelSerializer): class Meta: model = Student fields = ('email') class SubjectSerializer(serializers.ModelSerializer): class Meta: model = Subject fields = '__all__' class Student_Mapping_Serializers(serializers.ModelSerializer): class Meta: model = Student_subject_mapping fields = "__all__" How can I achieve data in the above format? -
Open edx , oath2 as provider
I want to redirect to support application from open edx using single sign-on using oauth i.e I will log in to open edx only and while redirecting to support application it shouldn't ask for credentials. Anyone can help me with how to configure or achieve this s=using open edx tutor? Any help is appreciated. -
How to make a web platform discussed in my description? please don't close or down vote ques it becomes difficult for new users
Let me start by what all things are involved: Data in csv file a python script that i have a python file containing a function that user have. On website the user will upload python file. Then the data i have in csv file will be parsed through user's given function which will generate a single Column Dataframe. Then the resultant Dataframe will be parsed through my Python script which will generate an output and this output will be presented to user on website. I am not able to get the approach and technologies involved but this is very important for me to do please help please Any resource or Reference will be helpful pls help Thank you.