Skip to content

Commit 943c978

Browse files
madhu
1 parent 1e39fae commit 943c978

24 files changed

+150
-11
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-803 Bytes
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.

generatepdf/pdf/htmltopdfconverter.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
from rest_framework import generics
99
from rest_framework.response import Response
1010

11-
path_to_wkhtmltopdf = r"C:\Users\madhu\Downloads\vasu\wkhtmltopdf.exe"
11+
path_to_wkhtmltopdf = r"C:\Program Files (x86)\wkhtmltopdf\wkhtmltopdf.exe" # give path of the wkhtmltopdf for windows#
12+
1213
config = pdfkit.configuration(wkhtmltopdf=path_to_wkhtmltopdf)
1314

1415

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Generated by Django 4.1.8 on 2023-04-26 11:16
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
initial = True
9+
10+
dependencies = []
11+
12+
operations = [
13+
migrations.CreateModel(
14+
name="Image",
15+
fields=[
16+
("id", models.IntegerField(primary_key=True, serialize=False)),
17+
("nameofimage", models.CharField(max_length=50)),
18+
("photo", models.ImageField(upload_to="store")),
19+
],
20+
options={
21+
"db_table": "table",
22+
},
23+
),
24+
migrations.CreateModel(
25+
name="MyModel",
26+
fields=[
27+
(
28+
"id",
29+
models.BigAutoField(
30+
auto_created=True,
31+
primary_key=True,
32+
serialize=False,
33+
verbose_name="ID",
34+
),
35+
),
36+
("image_url", models.FileField(upload_to="uploads/")),
37+
],
38+
),
39+
migrations.CreateModel(
40+
name="User_Profile",
41+
fields=[
42+
(
43+
"id",
44+
models.BigAutoField(
45+
auto_created=True,
46+
primary_key=True,
47+
serialize=False,
48+
verbose_name="ID",
49+
),
50+
),
51+
("fname", models.CharField(max_length=200)),
52+
("display_picture", models.FileField(upload_to="")),
53+
],
54+
),
55+
]
Binary file not shown.
Binary file not shown.

generatepdf/pdf/s3file.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030

3131

3232

33-
import boto3
34-
b_name = "ivin-pro-data-conversion"
35-
s3 = boto3.client("s3")
36-
b_res = s3.list_buckets()
37-
# for i in b_res['Buckets']:
38-
# print(i)
39-
with open(r"D:\Madhu\project\Python\PDF-Generator-Python\generatepdf\generatepdf\result.html",'rb') as img:
40-
s3.upload_fileobj(img,b_name,"testfile.jpg")
41-
#
42-
s3.download_file(b_name,"testfile.jpg ","download.jpg")
33+
# import boto3
34+
# b_name = "ivin-pro-data-conversion"
35+
# s3 = boto3.client("s3")
36+
# b_res = s3.list_buckets()
37+
# # for i in b_res['Buckets']:
38+
# # print(i)
39+
# with open(r"D:\Madhu\project\Python\PDF-Generator-Python\generatepdf\generatepdf\result.html",'rb') as img:
40+
# s3.upload_fileobj(img,b_name,"testfile.jpg")
41+
# #
42+
# s3.download_file(b_name,"testfile.jpg ","download.jpg")
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div><h1>madhu</h1></div>
2+
3+
<html>
4+
<head>
5+
<title>Href Attribute Example</title>
6+
</head>
7+
<body>
8+
<h1>Href Attribute Example</h1>
9+
<p>
10+
<a href="https://www.freecodecamp.org/contribute/">The freeCodeCamp Contribution Page</a> shows you how and where you can contribute to freeCodeCamp's community and growth.
11+
</p>
12+
</body>
13+
</html>
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div><h1>madhu</h1></div>
2+
3+
<html>
4+
<head>
5+
<title>Href Attribute Example</title>
6+
</head>
7+
<body>
8+
<h1>Href Attribute Example</h1>
9+
<p>
10+
<a href="https://www.freecodecamp.org/contribute/">The freeCodeCamp Contribution Page</a> shows you how and where you can contribute to freeCodeCamp's community and growth.
11+
</p>
12+
</body>
13+
</html>
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div><h1>madhu</h1></div>
2+
3+
<html>
4+
<head>
5+
<title>Href Attribute Example</title>
6+
</head>
7+
<body>
8+
<h1>Href Attribute Example</h1>
9+
<p>
10+
<a href="https://www.freecodecamp.org/contribute/">The freeCodeCamp Contribution Page</a> shows you how and where you can contribute to freeCodeCamp's community and growth.
11+
</p>
12+
</body>
13+
</html>

requirements.txt

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
asgiref ==3.6.0
2+
boto3 ==1.26.120
3+
botocore == 1.29.120
4+
certifi == 2022.12.7
5+
charset-normalizer == 3.1.0
6+
contourpy == 1.0.7
7+
coreapi == 2.3.3
8+
coreschema == 0.0.4
9+
cycler == 0.11.0
10+
Django == 4.1.8
11+
django-rest-swagger== 2.2.0
12+
djangorestframework ==3.14.0
13+
djongo == 1.3.6
14+
dnspython == 2.3.0
15+
drf-yasg == 1.21.5
16+
fonttools == 4.39.3
17+
idna == 3.4
18+
inflection == 0.5.1
19+
itypes == 1.2.0
20+
Jinja2 == 3.1.2
21+
jmespath == 1.0.1
22+
kiwisolver == 1.4.4
23+
MarkupSafe == 2.1.2
24+
matplotlib == 3.7.1
25+
numpy == 1.24.3
26+
openapi-codec == 1.3.2
27+
packaging == 23.1
28+
pdfkit == 1.0.0
29+
Pillow == 9.5.0
30+
pip == 22.3.1
31+
pymongo == 3.12.2
32+
pyparsing == 3.0.9
33+
python-dateutil == 2.8.2
34+
pytz == 2023.3
35+
requests == 2.28.2
36+
ruamel.yaml == 0.17.21
37+
s3transfer == 0.6.0
38+
setuptools == 65.5.0
39+
simplejson == 3.19.1
40+
six == 1.16.0
41+
sqlparse == 0.2.4
42+
tzdata == 2023.3
43+
uritemplate == 4.1.1
44+
urllib3 == 1.26.15

0 commit comments

Comments
 (0)