django-cloudflareimages-toolkit 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- django_cloudflareimages_toolkit-1.0.0/.github/ISSUE_TEMPLATE/bug_report.yml +167 -0
- django_cloudflareimages_toolkit-1.0.0/.github/ISSUE_TEMPLATE/config.yml +14 -0
- django_cloudflareimages_toolkit-1.0.0/.github/ISSUE_TEMPLATE/feature_request.yml +140 -0
- django_cloudflareimages_toolkit-1.0.0/.github/ISSUE_TEMPLATE/question.yml +158 -0
- django_cloudflareimages_toolkit-1.0.0/.github/workflows/publish.yml +93 -0
- django_cloudflareimages_toolkit-1.0.0/.github/workflows/test.yml +264 -0
- django_cloudflareimages_toolkit-1.0.0/.gitignore +294 -0
- django_cloudflareimages_toolkit-1.0.0/.readthedocs.yaml +32 -0
- django_cloudflareimages_toolkit-1.0.0/CONTRIBUTING.md +245 -0
- django_cloudflareimages_toolkit-1.0.0/LICENSE +21 -0
- django_cloudflareimages_toolkit-1.0.0/MANIFEST.in +15 -0
- django_cloudflareimages_toolkit-1.0.0/PKG-INFO +556 -0
- django_cloudflareimages_toolkit-1.0.0/README.md +479 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/__init__.py +50 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/admin.py +604 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/apps.py +18 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/management/__init__.py +3 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/management/commands/__init__.py +3 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/management/commands/cleanup_expired_images.py +97 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/models.py +148 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/serializers.py +168 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/services.py +312 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/settings.py +60 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/static/admin/css/cloudflare_images_admin.css +400 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/static/admin/js/cloudflare_images_admin.js +141 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/templatetags/__init__.py +3 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/templatetags/cloudflare_images.py +380 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/transformations.py +338 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/urls.py +32 -0
- django_cloudflareimages_toolkit-1.0.0/django_cloudflareimages_toolkit/views.py +300 -0
- django_cloudflareimages_toolkit-1.0.0/docs/api.rst +655 -0
- django_cloudflareimages_toolkit-1.0.0/docs/conf.py +77 -0
- django_cloudflareimages_toolkit-1.0.0/docs/configuration.rst +367 -0
- django_cloudflareimages_toolkit-1.0.0/docs/index.rst +100 -0
- django_cloudflareimages_toolkit-1.0.0/docs/installation.rst +175 -0
- django_cloudflareimages_toolkit-1.0.0/docs/requirements.txt +5 -0
- django_cloudflareimages_toolkit-1.0.0/docs/usage.rst +502 -0
- django_cloudflareimages_toolkit-1.0.0/llms-full.txt +899 -0
- django_cloudflareimages_toolkit-1.0.0/llms.txt +195 -0
- django_cloudflareimages_toolkit-1.0.0/pyproject.toml +164 -0
- django_cloudflareimages_toolkit-1.0.0/tests/settings.py +163 -0
- django_cloudflareimages_toolkit-1.0.0/tests/test_imports.py +103 -0
- django_cloudflareimages_toolkit-1.0.0/tests/urls.py +11 -0
- django_cloudflareimages_toolkit-1.0.0/uv.lock +1255 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
name: 🐛 Bug Report
|
|
2
|
+
description: Report a bug or unexpected behavior
|
|
3
|
+
title: "[BUG] "
|
|
4
|
+
labels: ["bug", "needs-triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for taking the time to report a bug! Please fill out the information below to help us diagnose and fix the issue.
|
|
10
|
+
|
|
11
|
+
- type: checkboxes
|
|
12
|
+
id: checklist
|
|
13
|
+
attributes:
|
|
14
|
+
label: Pre-submission Checklist
|
|
15
|
+
description: Please check the following before submitting
|
|
16
|
+
options:
|
|
17
|
+
- label: I have searched existing issues to ensure this is not a duplicate
|
|
18
|
+
required: true
|
|
19
|
+
- label: I have read the documentation and troubleshooting guide
|
|
20
|
+
required: true
|
|
21
|
+
- label: I am using a supported version of Django (4.2+)
|
|
22
|
+
required: true
|
|
23
|
+
|
|
24
|
+
- type: textarea
|
|
25
|
+
id: description
|
|
26
|
+
attributes:
|
|
27
|
+
label: Bug Description
|
|
28
|
+
description: A clear and concise description of what the bug is
|
|
29
|
+
placeholder: Describe the bug...
|
|
30
|
+
validations:
|
|
31
|
+
required: true
|
|
32
|
+
|
|
33
|
+
- type: textarea
|
|
34
|
+
id: expected
|
|
35
|
+
attributes:
|
|
36
|
+
label: Expected Behavior
|
|
37
|
+
description: What did you expect to happen?
|
|
38
|
+
placeholder: I expected...
|
|
39
|
+
validations:
|
|
40
|
+
required: true
|
|
41
|
+
|
|
42
|
+
- type: textarea
|
|
43
|
+
id: actual
|
|
44
|
+
attributes:
|
|
45
|
+
label: Actual Behavior
|
|
46
|
+
description: What actually happened?
|
|
47
|
+
placeholder: Instead, what happened was...
|
|
48
|
+
validations:
|
|
49
|
+
required: true
|
|
50
|
+
|
|
51
|
+
- type: textarea
|
|
52
|
+
id: reproduction
|
|
53
|
+
attributes:
|
|
54
|
+
label: Steps to Reproduce
|
|
55
|
+
description: Provide detailed steps to reproduce the issue
|
|
56
|
+
placeholder: |
|
|
57
|
+
1. Install django-cloudflareimages-toolkit
|
|
58
|
+
2. Configure settings with...
|
|
59
|
+
3. Call cloudflare_service.create_direct_upload_url(...)
|
|
60
|
+
4. See error
|
|
61
|
+
validations:
|
|
62
|
+
required: true
|
|
63
|
+
|
|
64
|
+
- type: textarea
|
|
65
|
+
id: code
|
|
66
|
+
attributes:
|
|
67
|
+
label: Code Sample
|
|
68
|
+
description: Provide a minimal code sample that reproduces the issue
|
|
69
|
+
render: python
|
|
70
|
+
placeholder: |
|
|
71
|
+
# settings.py
|
|
72
|
+
INSTALLED_APPS = [
|
|
73
|
+
'django_cloudflareimages_toolkit',
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
CLOUDFLARE_IMAGES = {
|
|
77
|
+
'ACCOUNT_ID': 'your-account-id',
|
|
78
|
+
'API_TOKEN': 'your-api-token',
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
# views.py
|
|
82
|
+
from django_cloudflareimages_toolkit.services import cloudflare_service
|
|
83
|
+
|
|
84
|
+
image = cloudflare_service.create_direct_upload_url(
|
|
85
|
+
user=request.user,
|
|
86
|
+
metadata={'type': 'avatar'}
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
- type: textarea
|
|
90
|
+
id: error
|
|
91
|
+
attributes:
|
|
92
|
+
label: Error Message/Traceback
|
|
93
|
+
description: If applicable, provide the full error message or traceback
|
|
94
|
+
render: text
|
|
95
|
+
placeholder: Paste the full error message here...
|
|
96
|
+
|
|
97
|
+
- type: dropdown
|
|
98
|
+
id: django_version
|
|
99
|
+
attributes:
|
|
100
|
+
label: Django Version
|
|
101
|
+
description: Which version of Django are you using?
|
|
102
|
+
options:
|
|
103
|
+
- "5.2.x"
|
|
104
|
+
- "5.1.x"
|
|
105
|
+
- "5.0.x"
|
|
106
|
+
- "4.2.x (LTS)"
|
|
107
|
+
- "Other (please specify in additional context)"
|
|
108
|
+
validations:
|
|
109
|
+
required: true
|
|
110
|
+
|
|
111
|
+
- type: input
|
|
112
|
+
id: package_version
|
|
113
|
+
attributes:
|
|
114
|
+
label: django-cloudflareimages-toolkit Version
|
|
115
|
+
description: Which version of django-cloudflareimages-toolkit are you using?
|
|
116
|
+
placeholder: "1.0.0"
|
|
117
|
+
validations:
|
|
118
|
+
required: true
|
|
119
|
+
|
|
120
|
+
- type: input
|
|
121
|
+
id: python_version
|
|
122
|
+
attributes:
|
|
123
|
+
label: Python Version
|
|
124
|
+
description: Which version of Python are you using?
|
|
125
|
+
placeholder: "3.11.0"
|
|
126
|
+
validations:
|
|
127
|
+
required: true
|
|
128
|
+
|
|
129
|
+
- type: dropdown
|
|
130
|
+
id: environment
|
|
131
|
+
attributes:
|
|
132
|
+
label: Environment
|
|
133
|
+
description: Where are you experiencing this issue?
|
|
134
|
+
options:
|
|
135
|
+
- "Development"
|
|
136
|
+
- "Staging"
|
|
137
|
+
- "Production"
|
|
138
|
+
- "Testing"
|
|
139
|
+
validations:
|
|
140
|
+
required: true
|
|
141
|
+
|
|
142
|
+
- type: textarea
|
|
143
|
+
id: configuration
|
|
144
|
+
attributes:
|
|
145
|
+
label: Configuration
|
|
146
|
+
description: Share relevant configuration (remove sensitive data)
|
|
147
|
+
render: python
|
|
148
|
+
placeholder: |
|
|
149
|
+
# settings.py
|
|
150
|
+
INSTALLED_APPS = [
|
|
151
|
+
'rest_framework',
|
|
152
|
+
'django_cloudflareimages_toolkit',
|
|
153
|
+
]
|
|
154
|
+
|
|
155
|
+
CLOUDFLARE_IMAGES = {
|
|
156
|
+
'ACCOUNT_ID': 'your-account-id',
|
|
157
|
+
'API_TOKEN': 'your-api-token',
|
|
158
|
+
'DEFAULT_EXPIRY_MINUTES': 30,
|
|
159
|
+
'REQUIRE_SIGNED_URLS': True,
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
- type: textarea
|
|
163
|
+
id: additional
|
|
164
|
+
attributes:
|
|
165
|
+
label: Additional Context
|
|
166
|
+
description: Add any other context about the problem here
|
|
167
|
+
placeholder: Any additional information that might be helpful...
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: 📚 Documentation
|
|
4
|
+
url: https://github.com/Pacificient-Labs/django-cloudflareimages-toolkit/blob/main/README.md
|
|
5
|
+
about: Read the comprehensive documentation and examples
|
|
6
|
+
- name: 💬 GitHub Discussions
|
|
7
|
+
url: https://github.com/Pacificient-Labs/django-cloudflareimages-toolkit/discussions
|
|
8
|
+
about: Ask questions and discuss ideas with the community
|
|
9
|
+
- name: 🔧 Webhook Setup Guide
|
|
10
|
+
url: https://github.com/Pacificient-Labs/django-cloudflareimages-toolkit/blob/main/WEBHOOK_SETUP.md
|
|
11
|
+
about: Detailed guide for setting up Cloudflare webhooks
|
|
12
|
+
- name: 🌐 Cloudflare Images Documentation
|
|
13
|
+
url: https://developers.cloudflare.com/images/
|
|
14
|
+
about: Official Cloudflare Images API documentation
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
name: ✨ Feature Request
|
|
2
|
+
description: Suggest a new feature or enhancement
|
|
3
|
+
title: "[FEATURE] "
|
|
4
|
+
labels: ["enhancement", "needs-triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for suggesting a new feature! Please provide as much detail as possible to help us understand your request.
|
|
10
|
+
|
|
11
|
+
- type: checkboxes
|
|
12
|
+
id: checklist
|
|
13
|
+
attributes:
|
|
14
|
+
label: Pre-submission Checklist
|
|
15
|
+
description: Please check the following before submitting
|
|
16
|
+
options:
|
|
17
|
+
- label: I have searched existing issues to ensure this is not a duplicate
|
|
18
|
+
required: true
|
|
19
|
+
- label: I have read the documentation to confirm this feature doesn't already exist
|
|
20
|
+
required: true
|
|
21
|
+
- label: This feature would benefit the broader community, not just my specific use case
|
|
22
|
+
required: true
|
|
23
|
+
|
|
24
|
+
- type: textarea
|
|
25
|
+
id: problem
|
|
26
|
+
attributes:
|
|
27
|
+
label: Problem Statement
|
|
28
|
+
description: What problem does this feature solve? What limitation are you facing?
|
|
29
|
+
placeholder: |
|
|
30
|
+
I'm trying to... but I can't because...
|
|
31
|
+
Currently, the toolkit doesn't support...
|
|
32
|
+
It would be helpful if...
|
|
33
|
+
validations:
|
|
34
|
+
required: true
|
|
35
|
+
|
|
36
|
+
- type: textarea
|
|
37
|
+
id: solution
|
|
38
|
+
attributes:
|
|
39
|
+
label: Proposed Solution
|
|
40
|
+
description: What feature would solve this problem? How should it work?
|
|
41
|
+
placeholder: |
|
|
42
|
+
I would like to see...
|
|
43
|
+
The feature should work by...
|
|
44
|
+
Users would be able to...
|
|
45
|
+
validations:
|
|
46
|
+
required: true
|
|
47
|
+
|
|
48
|
+
- type: textarea
|
|
49
|
+
id: use_case
|
|
50
|
+
attributes:
|
|
51
|
+
label: Use Case
|
|
52
|
+
description: Provide a specific example of how you would use this feature
|
|
53
|
+
placeholder: |
|
|
54
|
+
In my Django application, I need to...
|
|
55
|
+
For example, when a user uploads an image...
|
|
56
|
+
This would allow me to...
|
|
57
|
+
validations:
|
|
58
|
+
required: true
|
|
59
|
+
|
|
60
|
+
- type: textarea
|
|
61
|
+
id: api_example
|
|
62
|
+
attributes:
|
|
63
|
+
label: API Design Example
|
|
64
|
+
description: If applicable, show how you envision the API would work
|
|
65
|
+
render: python
|
|
66
|
+
placeholder: |
|
|
67
|
+
# Example of how the feature might be used
|
|
68
|
+
from django_cloudflareimages_toolkit.services import cloudflare_service
|
|
69
|
+
|
|
70
|
+
# Your proposed API usage
|
|
71
|
+
result = cloudflare_service.new_feature_method(
|
|
72
|
+
parameter1='value1',
|
|
73
|
+
parameter2='value2'
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
- type: dropdown
|
|
77
|
+
id: priority
|
|
78
|
+
attributes:
|
|
79
|
+
label: Priority
|
|
80
|
+
description: How important is this feature to you?
|
|
81
|
+
options:
|
|
82
|
+
- "Low - Nice to have"
|
|
83
|
+
- "Medium - Would be helpful"
|
|
84
|
+
- "High - Important for my project"
|
|
85
|
+
- "Critical - Blocking my use of the toolkit"
|
|
86
|
+
validations:
|
|
87
|
+
required: true
|
|
88
|
+
|
|
89
|
+
- type: dropdown
|
|
90
|
+
id: complexity
|
|
91
|
+
attributes:
|
|
92
|
+
label: Estimated Complexity
|
|
93
|
+
description: How complex do you think this feature would be to implement?
|
|
94
|
+
options:
|
|
95
|
+
- "Low - Simple addition or modification"
|
|
96
|
+
- "Medium - Moderate changes required"
|
|
97
|
+
- "High - Significant new functionality"
|
|
98
|
+
- "Unknown - Not sure about implementation complexity"
|
|
99
|
+
validations:
|
|
100
|
+
required: true
|
|
101
|
+
|
|
102
|
+
- type: textarea
|
|
103
|
+
id: alternatives
|
|
104
|
+
attributes:
|
|
105
|
+
label: Alternatives Considered
|
|
106
|
+
description: What alternatives have you considered? What workarounds are you currently using?
|
|
107
|
+
placeholder: |
|
|
108
|
+
I've tried...
|
|
109
|
+
Currently I'm working around this by...
|
|
110
|
+
Other solutions I considered...
|
|
111
|
+
|
|
112
|
+
- type: textarea
|
|
113
|
+
id: implementation
|
|
114
|
+
attributes:
|
|
115
|
+
label: Implementation Ideas
|
|
116
|
+
description: If you have technical suggestions for how this could be implemented, share them here
|
|
117
|
+
placeholder: |
|
|
118
|
+
This could be implemented by...
|
|
119
|
+
It might require changes to...
|
|
120
|
+
The Cloudflare API supports...
|
|
121
|
+
|
|
122
|
+
- type: checkboxes
|
|
123
|
+
id: contribution
|
|
124
|
+
attributes:
|
|
125
|
+
label: Contribution
|
|
126
|
+
description: Would you be interested in contributing to this feature?
|
|
127
|
+
options:
|
|
128
|
+
- label: I would be willing to help implement this feature
|
|
129
|
+
- label: I would be willing to test this feature once implemented
|
|
130
|
+
- label: I would be willing to help with documentation for this feature
|
|
131
|
+
|
|
132
|
+
- type: textarea
|
|
133
|
+
id: additional
|
|
134
|
+
attributes:
|
|
135
|
+
label: Additional Context
|
|
136
|
+
description: Add any other context, screenshots, or examples about the feature request
|
|
137
|
+
placeholder: |
|
|
138
|
+
Links to relevant documentation...
|
|
139
|
+
Screenshots or mockups...
|
|
140
|
+
Related features in other libraries...
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
name: ❓ Question
|
|
2
|
+
description: Ask a question about usage, configuration, or implementation
|
|
3
|
+
title: "[QUESTION] "
|
|
4
|
+
labels: ["question", "needs-triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for your question! Please provide as much detail as possible to help us give you the best answer.
|
|
10
|
+
|
|
11
|
+
- type: checkboxes
|
|
12
|
+
id: checklist
|
|
13
|
+
attributes:
|
|
14
|
+
label: Pre-submission Checklist
|
|
15
|
+
description: Please check the following before submitting
|
|
16
|
+
options:
|
|
17
|
+
- label: I have searched existing issues and discussions for similar questions
|
|
18
|
+
required: true
|
|
19
|
+
- label: I have read the documentation and README
|
|
20
|
+
required: true
|
|
21
|
+
- label: I have checked the troubleshooting guide and examples
|
|
22
|
+
required: true
|
|
23
|
+
|
|
24
|
+
- type: textarea
|
|
25
|
+
id: question
|
|
26
|
+
attributes:
|
|
27
|
+
label: Question
|
|
28
|
+
description: What would you like to know? Be as specific as possible.
|
|
29
|
+
placeholder: |
|
|
30
|
+
How do I...?
|
|
31
|
+
What's the best way to...?
|
|
32
|
+
Why does... happen when I...?
|
|
33
|
+
Is it possible to...?
|
|
34
|
+
validations:
|
|
35
|
+
required: true
|
|
36
|
+
|
|
37
|
+
- type: textarea
|
|
38
|
+
id: context
|
|
39
|
+
attributes:
|
|
40
|
+
label: Context
|
|
41
|
+
description: What are you trying to achieve? What's your use case?
|
|
42
|
+
placeholder: |
|
|
43
|
+
I'm building a Django application that...
|
|
44
|
+
I need to implement image uploads for...
|
|
45
|
+
My goal is to...
|
|
46
|
+
validations:
|
|
47
|
+
required: true
|
|
48
|
+
|
|
49
|
+
- type: textarea
|
|
50
|
+
id: attempted
|
|
51
|
+
attributes:
|
|
52
|
+
label: What I've Tried
|
|
53
|
+
description: What have you already attempted? Show your code and approach.
|
|
54
|
+
render: python
|
|
55
|
+
placeholder: |
|
|
56
|
+
# settings.py
|
|
57
|
+
CLOUDFLARE_IMAGES = {
|
|
58
|
+
'ACCOUNT_ID': 'my-account-id',
|
|
59
|
+
'API_TOKEN': 'my-api-token',
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
# views.py
|
|
63
|
+
from django_cloudflareimages_toolkit.services import cloudflare_service
|
|
64
|
+
|
|
65
|
+
def my_view(request):
|
|
66
|
+
# What I tried...
|
|
67
|
+
image = cloudflare_service.create_direct_upload_url(
|
|
68
|
+
user=request.user
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
- type: textarea
|
|
72
|
+
id: expected
|
|
73
|
+
attributes:
|
|
74
|
+
label: Expected Outcome
|
|
75
|
+
description: What result are you hoping to achieve?
|
|
76
|
+
placeholder: |
|
|
77
|
+
I expect to...
|
|
78
|
+
The result should be...
|
|
79
|
+
I want to see...
|
|
80
|
+
|
|
81
|
+
- type: textarea
|
|
82
|
+
id: current_behavior
|
|
83
|
+
attributes:
|
|
84
|
+
label: Current Behavior
|
|
85
|
+
description: What's happening instead? Include any error messages.
|
|
86
|
+
placeholder: |
|
|
87
|
+
Instead, I'm getting...
|
|
88
|
+
The error message is...
|
|
89
|
+
The behavior I see is...
|
|
90
|
+
|
|
91
|
+
- type: dropdown
|
|
92
|
+
id: django_version
|
|
93
|
+
attributes:
|
|
94
|
+
label: Django Version
|
|
95
|
+
description: Which version of Django are you using?
|
|
96
|
+
options:
|
|
97
|
+
- "5.2.x"
|
|
98
|
+
- "5.1.x"
|
|
99
|
+
- "5.0.x"
|
|
100
|
+
- "4.2.x (LTS)"
|
|
101
|
+
- "Other (please specify in additional context)"
|
|
102
|
+
validations:
|
|
103
|
+
required: true
|
|
104
|
+
|
|
105
|
+
- type: input
|
|
106
|
+
id: package_version
|
|
107
|
+
attributes:
|
|
108
|
+
label: django-cloudflareimages-toolkit Version
|
|
109
|
+
description: Which version of django-cloudflareimages-toolkit are you using?
|
|
110
|
+
placeholder: "1.0.0"
|
|
111
|
+
validations:
|
|
112
|
+
required: true
|
|
113
|
+
|
|
114
|
+
- type: dropdown
|
|
115
|
+
id: question_type
|
|
116
|
+
attributes:
|
|
117
|
+
label: Question Type
|
|
118
|
+
description: What type of question is this?
|
|
119
|
+
options:
|
|
120
|
+
- "Configuration - How to set up or configure the toolkit"
|
|
121
|
+
- "Usage - How to use specific features or methods"
|
|
122
|
+
- "Integration - How to integrate with other Django features"
|
|
123
|
+
- "Troubleshooting - Something isn't working as expected"
|
|
124
|
+
- "Best Practices - Recommendations for implementation"
|
|
125
|
+
- "Cloudflare API - Questions about Cloudflare Images features"
|
|
126
|
+
- "Other - General questions"
|
|
127
|
+
validations:
|
|
128
|
+
required: true
|
|
129
|
+
|
|
130
|
+
- type: textarea
|
|
131
|
+
id: configuration
|
|
132
|
+
attributes:
|
|
133
|
+
label: Current Configuration
|
|
134
|
+
description: Share your relevant configuration (remove sensitive data)
|
|
135
|
+
render: python
|
|
136
|
+
placeholder: |
|
|
137
|
+
# settings.py
|
|
138
|
+
INSTALLED_APPS = [
|
|
139
|
+
'rest_framework',
|
|
140
|
+
'django_cloudflareimages_toolkit',
|
|
141
|
+
]
|
|
142
|
+
|
|
143
|
+
CLOUDFLARE_IMAGES = {
|
|
144
|
+
'ACCOUNT_ID': 'your-account-id',
|
|
145
|
+
'API_TOKEN': 'your-api-token',
|
|
146
|
+
'DEFAULT_EXPIRY_MINUTES': 30,
|
|
147
|
+
'REQUIRE_SIGNED_URLS': True,
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
- type: textarea
|
|
151
|
+
id: additional
|
|
152
|
+
attributes:
|
|
153
|
+
label: Additional Context
|
|
154
|
+
description: Any other information that might be helpful
|
|
155
|
+
placeholder: |
|
|
156
|
+
Links to relevant documentation...
|
|
157
|
+
Screenshots of the issue...
|
|
158
|
+
Related code or configuration...
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
environment: release
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout code
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@v4
|
|
21
|
+
with:
|
|
22
|
+
version: "latest"
|
|
23
|
+
|
|
24
|
+
- name: Set up Python
|
|
25
|
+
run: uv python install 3.11
|
|
26
|
+
|
|
27
|
+
- name: Install build dependencies
|
|
28
|
+
run: uv sync --extra dev
|
|
29
|
+
|
|
30
|
+
- name: Verify version matches tag
|
|
31
|
+
run: |
|
|
32
|
+
# Extract version from tag (remove 'v' prefix if present)
|
|
33
|
+
TAG_VERSION=${GITHUB_REF#refs/tags/}
|
|
34
|
+
TAG_VERSION=${TAG_VERSION#v}
|
|
35
|
+
|
|
36
|
+
# Extract version from pyproject.toml
|
|
37
|
+
PACKAGE_VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
|
|
38
|
+
|
|
39
|
+
echo "Tag version: $TAG_VERSION"
|
|
40
|
+
echo "Package version: $PACKAGE_VERSION"
|
|
41
|
+
|
|
42
|
+
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
|
|
43
|
+
echo "Error: Tag version ($TAG_VERSION) does not match package version ($PACKAGE_VERSION)"
|
|
44
|
+
exit 1
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
- name: Build package
|
|
48
|
+
run: uv build
|
|
49
|
+
|
|
50
|
+
- name: Verify build
|
|
51
|
+
run: |
|
|
52
|
+
# List contents of the built packages
|
|
53
|
+
echo "Built packages:"
|
|
54
|
+
ls -la dist/
|
|
55
|
+
|
|
56
|
+
# Check that both wheel and source distribution were created
|
|
57
|
+
if [ ! -f dist/*.whl ] || [ ! -f dist/*.tar.gz ]; then
|
|
58
|
+
echo "Error: Both wheel and source distribution should be created"
|
|
59
|
+
exit 1
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
# Basic verification that files exist and have reasonable sizes
|
|
63
|
+
echo "Package verification:"
|
|
64
|
+
for file in dist/*; do
|
|
65
|
+
echo " $file: $(stat -c%s "$file") bytes"
|
|
66
|
+
done
|
|
67
|
+
|
|
68
|
+
- name: Publish to PyPI
|
|
69
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
70
|
+
with:
|
|
71
|
+
# Using trusted publishing (recommended)
|
|
72
|
+
# No need for API tokens when using trusted publishing
|
|
73
|
+
verbose: true
|
|
74
|
+
print-hash: true
|
|
75
|
+
|
|
76
|
+
notify:
|
|
77
|
+
needs: publish
|
|
78
|
+
runs-on: ubuntu-latest
|
|
79
|
+
if: always()
|
|
80
|
+
|
|
81
|
+
steps:
|
|
82
|
+
- name: Notify success
|
|
83
|
+
if: needs.publish.result == 'success'
|
|
84
|
+
run: |
|
|
85
|
+
echo "✅ Successfully published django-cloudflareimages-toolkit to PyPI!"
|
|
86
|
+
echo "📦 Package should be available at: https://pypi.org/project/django-cloudflareimages-toolkit/"
|
|
87
|
+
|
|
88
|
+
- name: Notify failure
|
|
89
|
+
if: needs.publish.result == 'failure'
|
|
90
|
+
run: |
|
|
91
|
+
echo "❌ Failed to publish django-cloudflareimages-toolkit to PyPI"
|
|
92
|
+
echo "Check the logs above for details"
|
|
93
|
+
exit 1
|