Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Scope <style> tag inside markup of text field created by WYSIWYG editor in Django
I have Django website with django-summernote WYSIWYG editor. Admin can add news. Editor is used for editing text fields of DB models using HTML markup. User can edit field in HTML source mode. So he can paste <style> tag inside. For example he can paste something like this: <style> p { color:red; } </style> And of course after rendering field with this snippet in Django HTML template it will affect all next <p> tags, not only those which are inside field. And this is the problem. I want to allow user use <style> tag inside markup but prevent it from affecting other parts of the page. I know I can put markup in iframe but maybe there are other solutions. So I want to to know how should I do it. P.S If there is another WYSIWYG editor lib for django which can scope style in some way tell me. -
How can I integrate SSLCommerze to my django app?
I have created a ecommerce site. Now i want to integrate payment method. By adding SSLCommerce to my site, all payment method will be taken care of in Bangladesh. But I don't know how can I add it to my Django app. Please help! They said something session. But I did not get it. Here is thier github repo https://github.com/sslcommerz/SSLCommerz-Python?fbclid=IwAR0KkEH3H-AOwaWneQy0POGkTw6O3vvL9NiRM4amflyQEt54_W1g1rgYB48 -
Unble to use image which is store in django database
i create a model name profile with the help of signal so ever time a user get created it automatically create a profile with that usename in db all i want to fetch the image which i used as default in model like we fetch username with this {{ user.username }} here is my code my model class Profile(models.Model): user = models.OneToOneField(User ,on_delete=models.CASCADE,) profile_pic = models.ImageField(upload_to='profile_pics/', default='default.png',) first_name = models.CharField(max_length=50, blank=True) last_name = models.CharField(max_length=75, blank=True) dob = models.DateField(blank=True, null=True) joined_date = models.DateTimeField(default=timezone.now,editable=False) update_at = models.DateTimeField(auto_now=True) def __str__(self): return self.user.username @receiver(post_save, sender=User) def create_user_profile(sender, instance, created, *args, **kwargs): if created: Profile.objects.create(user=instance) @receiver(post_save, sender=User) def save_user_profile(sender, instance, **kwargs): instance.profile.save() my html <img class="profile-pic nav-link dropdown-toggle" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="max-width: 45px; max-height:45px; border-radius: 50%;" src="{{ user.Profile.profile_pic.url|escape }}" > please help -
Filter object by common words in title
I try to get related objects by get title of the current objects and and filter the common words between two titles, I could able to make something but it is not accurete I get the title and split it using .split() and use Q to filter by first and second word but this not accurate .What I want to do I want get results by get the common words between the current object title and result title def get_queryset(self): book_pk = self.kwargs['pk'] book = Video.objects.get(pk=book_pk) lst = book.title split = lst.split() return Book.objects.filter(Q(title__icontains=split[0]) & Q(title__icontains=split[1])) -
Calculate value of multiple columns in single row in django
hi i am new to django framework and i am trying to develop results management system for my degree project. i need to calculate total value of multiple subjects for each student and view the total and name of student. i aready created model and upload results usign excel. `class Marks_sheet(models.Model): id = models.AutoField(primary_key=True) term = models.CharField(max_length=20) grade = models.CharField(max_length=20) year = models.IntegerField(null=True, blank=True) school_name = models.CharField(max_length=40) student_registrationno = models.CharField(max_length=30) student_name = models.CharField(max_length=30) maths = models.IntegerField(max_length=20, null=True, blank=True) science = models.IntegerField(max_length=20, null=True, blank=True) english = models.IntegerField(max_length=20, null=True, blank=True) sinhala = models.IntegerField(max_length=20, null=True, blank=True) relegion = models.IntegerField(null=True,blank=True) history = models.IntegerField(null=True, blank=True) group1 = models.IntegerField(null=True,blank=True) group2 = models.IntegerField(null=True,blank=True) group3 = models.IntegerField(null=True,blank=True) def __str__(self): return self.student_name` this now i am try but it only show one student details only `def analyse(request): cursor = connection.cursor() cursor.execute("SELECT student_name, relegion + maths + science + english + sinhala + history + group1 + group2+ group3 as total FROM marks_Marks_sheet GROUP BY id ") r = cursor.fetchone() #r = Marks_sheet.objects.all() print(r) return render(request,'student.html',{'result':r})` -
Hello I buils a web app using react and django but when I deployit its using serverside camers as feed and not at client side
"""Please Help """ """Hello I buils a web app using react and django but when I deployit its using serverside camers as feed and not at client side. Means its not using React camera /how to use client camrea as feed for django opencv .One more thing is I am displaying django only on client side and using react as only template for django""" -
Read with python and django an array of input fields
i'm tring to read from request.POST an array of fields <input type="text" name="arrayfield[]" /><br /> <input type="text" name="arrayfield[]" /><br /> <input type="text" name="arrayfield[]" /><br /> <input type="text" name="arrayfield[]" /><br /> <input type="text" name="arrayfield[]" /><br /> <input type="text" name="arrayfield[]" /><br /> <input type="text" name="arrayfield[]" /><br /> if i use print(request.POST) i get that output <QueryDict: {'csrfmiddlewaretoken': ['p0GWUzgXEEYOTI1710vTsUAPrjUUv5NpqlVCGU7Oq1zw4LWA20d222q1aE8QvlIg'], 'username': ['Oscurodrago'], 'birthday': ['1988-04-16'], 'arrayfield[]': ['try', 'tyey', 'egr', '', 'tyr', '', ''], 'edit': ['Modifica']}> but when i try get it with request.POST.get('arrayfield[]','') dosen't work what i have to do? -
name 'SocialAccount' is not defined
I want to access the 'extra-data' dictionary provided by Social Account. I need to store the family name of the user in a variable. I have attached the the code below . The following code throws an error "name 'SocialAccount' is not defined ". I saw this on "https://stackoverflow.com/questions/51804368/django-allauth-social-application-extra-data/51805154#51805154" . data=SocialAccount.objects.get(user=request.user).extra_data follows=data.get('family_name') return render(request, 'main/index.html', {"name":follows}) -
Django -- Views MultiValueDictKeyError
I want to return 4 different versions of the homepage Homepage with search bar. No data present from API Homepage with search bar. Data present from API Homepage with search bar. No data present if request doesn't exist in API Homepage with search bar. No data present if submit button is hit without any data being entered. Version two, three and four all work. However version 1, the homepage without a GET request is not returned. Due to: MultiValueDictKeyError at / 'city'" in the views.py file. How can this be resolved? Any help will be greatly appreciated urls.py from django.urls import path from . import views urlpatterns = [ path('', views.index), ] views.py from django.shortcuts import render import requests def index(request): # Query API with user input payload = {'q': request.GET['city'], 'appid': 'b3ad513f98dae40c26f94e989b7fcb84'} response = requests.get('http://api.openweathermap.org/data/2.5/weather', params=payload) # successful request if response.status_code == 200: # Parse json output for key value pairs e = response.json() context = { 'city_name': e['name'], 'weather':e['weather'][0]['main'], 'description' : e['weather'][0]['description'], 'temp' : e['main']['temp'], 'pressure':e['main']['pressure'], 'humidity':e['main']['humidity'], 'visibility':e['visibility'], 'wind_speed':e['wind']['speed'], 'wind_deg':e['wind']['deg'] } return render(request, 'index.html', {'context': context}) else: # returns homepage if invalid city name is given in form return render(request, 'index.html') -
Add Homepage and About Page to Django Dynamic sitemap.xml
I am getting all the links for 'blog_splash', this is fine. In addition to those links I need the home and about links to be generated in sitemap.xml. sitemaps.py is as follows from django.contrib.sitemaps import Sitemap from .models import DbPost class BlogPostSitemap(Sitemap): changefreq = "weekly" priority = 0.8 protocol = 'https' def items(self): return DbPost.objects.all() def lastmod(self, obj): return obj.date def location(self,obj): return '/blog_splash/%s' % (obj.id) urls.py is as follows: urlpatterns = [ path('sitemap.xml', sitemap, {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap'), path('', MainView.as_view(), name="home"), path('about', AboutView.as_view(), name="about"), path('blog_splash/<int:pk>', BlogSplashView.as_view(), name="blog_splash"), ] -
i want to calculate basic salary of the employees and add or deduct allownace on the basic salary
I`m trying to create an allowance when I pass the enter on allowance model and after that I want dropdown on create contract model to select multiple allowance there. after that I want to generate the payroll on basic salary to add or deduct the allowance in percentages. allowance models.py class allowances(models.Model): operationType = models.CharField(max_length=200, choices=operationType_CHOICES) arName = models.CharField(max_length=200, blank=True, null=True) enName = models.CharField(max_length=200, blank=True, null=True) valueType = models.CharField(max_length=200, choices=valueType_CHOICES) value = models.FloatField() maxValue = models.FloatField() company = models.ForeignKey(Company, on_delete=models.CASCADE) def __str__(self): return "{}".format(self.enName) **contract models.py** class CreateContracts(models.Model): ContractsReference = models.CharField(max_length=250) Employee = models.ForeignKey(Employees, on_delete=models.CASCADE) Department = models.ForeignKey(Department, on_delete=models.CASCADE) Contract_Type = models.CharField(max_length=250, choices=Type_CHOICE) Date_From = models.DateField(default=timezone.now) Date_To = models.DateField(default=timezone.now) Stage = models.CharField(max_length=250, choices=Stage_CHOICE) base_salary = models.IntegerField(default=0) shift_start = models.TimeField() shift_end = models.TimeField() workinghours = models.IntegerField(default=0) breakhours = models.IntegerField(default=0) employment_type = models.CharField(max_length=250) contract_period = models.CharField(max_length=250) notice_period = models.CharField(max_length=250) probation_period = models.CharField(max_length=250) otherallowance = models.IntegerField(max_length=250) allowance = models.ManyToManyField(allowances) def __str__(self): return "{}".format(self.ContractsReference) **views.py** def savecontract(request): c = chklogin(request) if c: empid = request.POST['empid'] cid = request.POST['cid'] emptype = request.POST['emptype'] contPerid = request.POST['contPerid'] sdate = request.POST['sdate'] endDate = request.POST['endDate'] notPeriod = request.POST['notPeriod'] probPeriod = request.POST['probPeriod'] bs = request.POST['bs'] shiftstart = request.POST['shiftstart'] shiftend = request.POST['shiftend'] workhours = request.POST['workhours'] lunch = request.POST['lunch'] if empid == … -
error connecting to postgresql server with django
I am trying to connect to a postgresql server using django. I was given connection details from the host, but am still receiving the error: conn = _connect(dsn, connection_factory=connection_factory, **kwasync) django.db.utils.OperationalError: could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 54 My main question is in regards to the host. The original files were set up with localhost, and I was never given another host.... However, the server is not located on my computer and I am wondering if a different host address is needed. If so would it be an IP address only, or would a website work? I'm new to this, so any help is appreciated! I did try and look through other questions but I couldn't figure out the host question from it. My database setup (most info is commented out) is: 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'server web address', 'USER': 'username', 'PASSWORD': 'password', 'HOST': '127.0.0.1', 'PORT' : 5432, }, Thank you! -
How can I change value on one table while creating an instance on another in django model?
I wanted to select multiple users from the Profile and change their amountDue to the amount on the Matchpayment model, in other words - the amountdue for each player should increment according to each of the Matchpayment they are in using the amount from MatchPayment. Hope it makes sense. from django.db import models from django.contrib.auth.models import User # Create your models here. class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) amountDue = models.IntegerField() def __str__(self): return self.user.username class MatchPayment(models.Model): match = models.CharField(max_length=30) amount = models.IntegerField() players = models.ManyToManyField(Profile) datespent = models.DateField('Date Spent') def __str__(self): return self.match -
I want to get the user's id on the url path or in the address of the page
i have a url on my page that is "http://127.0.0.1:8000/affiliation/link/10006/". In the above url I want to add the user id along so that it looks like :"http://127.0.0.1:8000/affiliation/link/01/10006/" something like this, whereas '01' is the user id of the user who uploaded the product. Below are the files. views: #Display individual product and render short links for all using pyshorteners def link_view(request, uid): results = AffProduct.objects.get(uid=uid) slink = "http://127.0.0.1:8000/" + request.get_full_path() shortener = pyshorteners.Shortener() short_link = shortener.tinyurl.short(slink) return render(request, 'link.html', {"results": results, "short_link": short_link}) models: #Product details uploaded class AffProduct(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='foo') product_title = models.CharField(max_length=255) uid = models.IntegerField(primary_key=True) specification = models.CharField(max_length=255) sale_price = models.IntegerField() discount = models.IntegerField() img1 = models.ImageField(max_length=255, null=True, blank=True, upload_to="images/") img2 = models.ImageField(max_length=255, null=True, blank=True, upload_to="images/") promote_method = models.TextChoices terms_conditions = models.CharField(max_length=255, null=True) promote_method = models.CharField( max_length=20, choices=promote_choices, default='PPC' ) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) urls: urlpatterns = [ path('link/<int:uid>/', views.link_view, name='link_view') ]+static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) -
How to redirect to another page in vanilla JavaScript on submitting HTML form with Django backend?
I have just started working on Django. What I need is to link a js file to my HTML file with a form and save form data. Then go to next screen, click a picture and POST the form data along with the picture. I have linked the JS file. I have created an input type button instead of submit as I wanted to use JS. My use case is of register and login. The first page to open is login then on clicking signup button I am taken to register page where I want the functionality that after user fills form and submits he is taken to face capture page. I am not able to redirect to capture face page from JavaScript. I am using Vanilla JS. When I am using window.location.href = "camera_capture.html" all I am getting is a url appended to the current url and no change in the current page. Something like register/capture_face.html Is there a way I can do what I am trying to achieve and is it a good method to do it like this? or is there a better way I can do it? -
REST API for Django User Authentication and Private Profile View
I'm new with django and react so basically I've been working with django viewsets, which have been of great help as they provide a simple api to communicate b/w django and react, what i now want is to create a register a user. after user logins I then want to present a few details to fill which only that user will be able to view after filling the form. But all I've been able to find on the internet is info with django forms, I don't want to use django forms. I'm using simple models, serializers and models, viewsets. Login/signup form(react) -> after filling form -> react transfers data to django -> django authenticates -> returns authenticated data or error -> react shows authenticated data and option to update info something like this -
How to save a list of dictionaries as each object in a Django database model's field?
I got this dictionary sample_dict = [ {'sale_id': 14, 'name': 'Macarena', 'fecha': datetime.date(2021, 3, 11), 'debe': 500.0}, {'sale_id': 14, 'name': 'Macarena', 'fecha': datetime.date(2021, 4, 11), 'debe': 500.0}, {'sale_id': 15, 'name': 'Yamila', 'fecha': datetime.date(2021, 4, 14), 'debe': 2000.0} ] And I would like to store it in the Django DataBase (SQLite3) like this: BUT before append this dict to the DB I would like to clear the Database and avoid duplicated values (or remove duplicates after append the dict to the db) And when I remove duplicates, I should remove duplicates from the "sale_id", "name", "fecha" and "debe" columns, not only from "sale_id" because I got many "sale_id" with the same number but with different dates ("fecha"). I've tried this but every time I run the "objects.create" I got duplicated values in the DB: class Creditos1(models.Model): sale_id = models.IntegerField(default=0) name = models.CharField(max_length=150) fecha = models.DateTimeField(default=datetime.now) debe = models.IntegerField(default=0) for i in range(0,len(h)): Creditos1.objects.create(name=h[i]['name'], sale_id=h[i]['sale_id'], fecha=h[i]['fecha'], debe=h[i]['debe']) Thanks a lot! -
django image src is not working , I send the image location using django context object
Here is my code: views.py: def adminlogin(request): return render(request,'hospital/login.html',context={ "usertype":"Admin", "image":"images/admin.png" }) HTML code: <div class="image"> images/admin.png <img src="{%static '{{image}}' %}" alt=""> </div> HTML output: <div class="image"> images/admin.png <img src="/static/%7B%7B%20image%20%7D%7D" alt=""> </div> image src doesn't work. How to solve this problem? Regards. -
The information is not stored in the database. Django
There is code in models.py: class Product(models.Model): name = models.CharField(max_length=255) state = models.CharField(max_length=255) b_info = models.CharField(max_length=255) def save(self, *arg, **kwarg): r = requests.get(f'https://system-one.uno/api/cli/bln_check/?card={self.name[:6]}') if r.status_code == 200: _r = r.json() self.b_info = _r.get('reason') in it, part of the number is separated and sent to the checker(connected via API), which sends information to this number. And this information is stored in the same database table as the product number. when adding a new line to the database through the admin panel, this line is not saved in the database table. Why and how to fix this problem? -
In inlineformset_factory, can't change widget of primary model (django 3.0)
NOTE: This question is asked in this SO post. I applied the solution but its not working as expected. Maybe because I'm in Django 3.0? Problem: I am using an inlineformset_factory. I can modify the "child" form (aka formset) but not the "parent" form. You can see an illustration of the problem here: https://www.dropbox.com/s/won84143o16njhr/dj007_inlineformsetfactory_unable_to_modify_primary_form.jpg?dl=0 Here is following code so far: # FORMS.PY class Invoice_AJAX_Form(forms.ModelForm): model: Invoice_AJAX class Meta: model: Invoice_AJAX widgets = { 'ref_num': forms.TextInput(attrs={ 'class': 'form-control', }), 'customer': forms.TextInput(attrs={ 'class': 'form-control', }) } class Invoice_Inventory_JAX_Form(forms.ModelForm): class Meta: model: Inventory_Invoice_AJAX widgets = { 'price': forms.NumberInput(attrs={ 'class': 'form-control cls_price', 'placeholder': 'Price', }), 'inventory': forms.Select(attrs={ 'class': 'form-control cls_inventory', }), 'amount': forms.NumberInput(attrs={ 'class': 'form-control cls_amount', }), 'quantity': forms.NumberInput(attrs={ 'class': 'form-control cls_quantity', }), 'ref_num': forms.NumberInput(attrs={ 'class': 'form-control', }), 'discount': forms.NumberInput(attrs={ 'class': 'form-control cls_discount', }) } form=Invoice_Inventory_JAX_Form, fields = '__all__', can_delete = False) inventory_AJAX_formset = inlineformset_factory(Invoice_AJAX, Inventory_Invoice_AJAX, form=Invoice_Inventory_JAX_Form, fields = '__all__', can_delete = False) # MODEL.PY class Invoice_AJAX(models.Model): ref_num = models.CharField(max_length=100) customer = models.ForeignKey(Customer, on_delete=models.CASCADE, default=1) date = models.DateField(default=datetime.date.today(), null=True, blank=True) def __str__(self): return str(self.ref_num) class Inventory_AJAX(models.Model): name = models.CharField(max_length=100) price = models.DecimalField(max_digits=9, decimal_places=2) invoice = models.ForeignKey(Invoice_AJAX, on_delete=models.CASCADE) def __str__(self): return self.name class Inventory_Invoice_AJAX(models.Model): inventory = models.ForeignKey(Inventory_AJAX, on_delete=models.CASCADE) invoice = models.ForeignKey(Invoice_AJAX, on_delete=models.CASCADE) price = models.DecimalField(max_digits=9, … -
Django Terminal 404 warning - how to find the root cause
I am creating a forum as part of a larger web project to aid my Django development. I am trying to display a user-created 'topic'(article) that allows users to comment on the article. Anyway been on it a couple of days and got the users set up, some models for articles and comments with bootstrap templates to display it all. I wish for comments to be added without leaving for an external page. I have achieved it and the functionality is as I wanted. However, in the terminal, I keep getting the message Not Found: /forum_topic/1/... [06/Jul/2021 14:29:26] "GET /forum_topic/1/... HTTP/1.1" 404 3682** With the functionality working as expected how do I trace what is trying to generate the url "/forum_topic/1/..." (i've assumed its a url?)? Should I even be worried about it? @Urls urlpatterns = [ path('forum/', ForumViewHome.as_view(), name="forum-home"), path('forum/DevArea/<str:dev_area_name>', ForumDevAreaTopics, name="forum-dev-area"), path('forum_topic/<int:pk>/', ForumTopicView, name="forum-topic-view"), #<int:pk> references the specifc blog path('forum_topic/new/', ForumTopicNew.as_view(), name="forum-topic-new"), path('forum_topic/edit/<int:pk>', ForumTopicEdit.as_view(), name="forum-topic-edit"), path('forum_topic/delete/<int:pk>', ForumTopicDelete.as_view(), name="forum-topic-delete"), ] @Views def ForumTopicView(request, pk): topic = get_object_or_404(Post,id=pk)# comment_form = ForumTopicCommentForm(request.POST or None)# template_name = "forum_topic_view.html" if request.method == "GET": topic_comments = Comment.objects.filter(on_post=pk) # For splitting comments into groups of 3 allowing them to be # displayed in seperate tabs. … -
Using cms_shiny in a django project error "cannot import name 'six' from 'django.utils'..."
I am trying to create a web app using django and I would like part of it to show a shiny dashboard. Recently I have been trying to use djangocms-shiny-app 0.1.3 package to accomplish this; however, after following the setup guide for the package, I am running into an error File "C:\Users\rdkbh\AppData\Local\Programs\Python\Python39\lib\site-packages\cms_shiny\models.py", line 2, in <module> from filer.fields.image import FilerImageField File "C:\Users\rdkbh\AppData\Local\Programs\Python\Python39\lib\site-packages\filer\fields\image.py", line 4, in <module> from .. import settings File "C:\Users\rdkbh\AppData\Local\Programs\Python\Python39\lib\site-packages\filer\settings.py", line 11, in <module> from .utils.loader import load_object File "C:\Users\rdkbh\AppData\Local\Programs\Python\Python39\lib\site-packages\filer\utils\loader.py", line 13, in <module> from django.utils import six ImportError: cannot import name 'six' from 'django.utils' (C:\Users\rdkbh\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\__init__.py) If anyone knows what is causing the error (Based on the error message I believe it is something to do with cms_shiny) and how to fix it or if there are any better packages for integrating a shiny app into Django I would greatly appreciate it. Thanks in advance! -
SMTPAuthenticationError after deployment even with recognized activity
hello after deployment of my site I have the problem that google blocks the email I recognized the activity normally there like heroku and local host it works but in the host it sends me more email let's say that the activity is blocked but they also do not send the verification email error "" "Google blocked the application you were trying to use because it does not meet our security standards. Some apps and devices use less secure sign-in technology, which makes your account more vulnerable. You can disable access for these apps (recommended) or enable it if you want to use them despite the risks involved. Google automatically turns this setting off if it is not used. "" " -
Django/Python: how to analyzing financial stock data (daily/monthly etc.)
I would like to do a lot of analysis/performance/statistics on my stock portfolio, which I plan to track with my app. E.g.: Week performance Month performance Year performance Best performer and a lot of other things I can't imagine right now... Where I'm struggling right now: - What is a good/the best way to archive this? - Also to show this info on a dashboard --> I think I should store this information somehow... But how to do this on a daily/weekly/whatever basis? --> I don't see a way to do such things while runtime? --> furthermore I need to know, when do do such thinks... It's end of the week so do weekly performance calculations... --> Maybe there is also an MVP solution, that can evolve into a top-notch solution? My models are locking like this at the moment - The position is the clamp around my orders and my EOD data. Right now I'm working with yfinance to get range financial data + finnhub API to get real time prices: class Position(models.Model): name = models.CharField(max_length=100) shares = models.FloatField(default=0.0) symbol = models.CharField(max_length=100, default="") transaction_fee_sum = models.FloatField(default=0.0) profit = models.FloatField(default=0.0) average_price = models.FloatField(default=0.0) cost_value = models.FloatField(default=0.0) last_price = models.FloatField(default=0.0) position_value … -
html2pdf with python : How to set footer and header on each page and control page cut
I use the app html2pdf with python on django framework. I use the html way and convert it in pdf by : pdf = render_to_pdf('front/bill.html', {'order': self, 'ligns': self.orderlign_set.all(), 'paiements':self.orderpayement_set.filter(paid__isnull=False)}) I have few questions : 1/ How to repeat the same header on each page ? I have used <page_header></page_header> in bill.html without effect 2/ How to repeat the same footer on each page AND stuck it on the bottom of the page ? I have used <page_footer></page_footer> in bill.html without effect. 3/ How to control where xhtml2pdf cut the text for write the next page ? its an invoice/bill, i can't split the text anywhere. 4/ How to display a page counter on each page ? Like page_number/total_page Thanks for your time