Skip to content

Commit 805bb67

Browse files
authored
Apply for floss.fund (#2763)
* Fix broken fixture * serve /funding.json
1 parent 93d17e3 commit 805bb67

File tree

4 files changed

+223
-2
lines changed

4 files changed

+223
-2
lines changed

fixtures/downloads.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63066,7 +63066,7 @@
6306663066
"filesize": 18121168,
6306763067
"download_button": false
6306863068
}
63069-
}
63069+
},
6307063070
{
6307163071
"model": "downloads.releasefile",
6307263072
"pk": 3880,

pydotorg/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
path('authenticated', views.AuthenticatedView.as_view(), name='authenticated'),
2222
re_path(r'^humans.txt$', TemplateView.as_view(template_name='humans.txt', content_type='text/plain')),
2323
re_path(r'^robots.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain')),
24+
re_path(r'^funding.json$', views.serve_funding_json, name='funding_json'),
2425
path('shell/', TemplateView.as_view(template_name="python/shell.html"), name='shell'),
2526

2627
# python section landing pages

pydotorg/views.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import json
2+
import os
13
from django.conf import settings
2-
from django.http import HttpResponse
4+
from django.http import HttpResponse, JsonResponse
35
from django.views.generic.base import RedirectView, TemplateView
46

57
from codesamples.models import CodeSample
@@ -10,6 +12,19 @@ def health(request):
1012
return HttpResponse('OK')
1113

1214

15+
def serve_funding_json(request):
16+
"""Serve the funding.json file from the static directory."""
17+
funding_json_path = os.path.join(settings.BASE, 'static', 'funding.json')
18+
try:
19+
with open(funding_json_path, 'r') as f:
20+
data = json.load(f)
21+
return JsonResponse(data)
22+
except FileNotFoundError:
23+
return JsonResponse({'error': 'funding.json not found'}, status=404)
24+
except json.JSONDecodeError:
25+
return JsonResponse({'error': 'Invalid JSON in funding.json'}, status=500)
26+
27+
1328
class IndexView(TemplateView):
1429
template_name = "python/index.html"
1530

static/funding.json

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
{
2+
"version": "v1.0.0",
3+
"entity": {
4+
"type": "organisation",
5+
"role": "owner",
6+
"name": "Python Software Foundation",
7+
"email": "[email protected]",
8+
"description": "The Python Software Foundation is the charitable organization behind the Python programming language. The mission of the Python Software Foundation is to promote, protect, and advance the Python programming language, and to support and facilitate the growth of a diverse and international community of Python programmers.",
9+
"webpageUrl": {
10+
"url": "https://www.python.org/psf"
11+
}
12+
},
13+
"projects": [
14+
{
15+
"guid": "cpython",
16+
"name": "CPython",
17+
"description": "Python is an open-source programming language. By several measures, it is the most widely used programming language in the world. At our last measurement, python.org served over 110 billion downloads for Python releases annually.",
18+
"webpageUrl": {
19+
"url": "https://www.python.org/"
20+
},
21+
"repositoryUrl": {
22+
"url": "https://github.com/python/cpython",
23+
"wellKnown": "https://github.com/python/cpython/blob/main/.well-known/funding-manifest-urls"
24+
},
25+
"licenses": [
26+
"Python Software Foundation License Version 2"
27+
],
28+
"tags": [
29+
"python"
30+
]
31+
},
32+
{
33+
"guid": "pypi",
34+
"name": "Python Package Index",
35+
"description": "PyPI is a public repository of software that is free to use for distributing and downloading bundles of Python software. PyPI is a free service the Python Software Foundation maintains and provides to the public.",
36+
"webpageUrl": {
37+
"url": "https://pypi.org/",
38+
"wellKnown": "https://pypi.org/.well-known/funding-manifest-urls"
39+
},
40+
"repositoryUrl": {
41+
"url": "https://github.com/pypi/warehouse",
42+
"wellKnown": "https://github.com/pypi/warehouse/blob/main/warehouse/templates/funding-manifest-urls.txt"
43+
},
44+
"licenses": [
45+
"Apache 2.0 License"
46+
],
47+
"tags": [
48+
"python",
49+
"packaging"
50+
]
51+
},
52+
{
53+
"guid": "pyconus",
54+
"name": "PyCon US",
55+
"description": "PyCon US is the largest annual gathering for the Python community. Each year, the community comes together to network, learn, share ideas, and create new relationships and partnerships.",
56+
"webpageUrl": {
57+
"url": "https://us.pycon.org/",
58+
"wellKnown": "https://us.pycon.org/.well-known/funding-manifest-urls"
59+
},
60+
"repositoryUrl": {
61+
"url": "https://github.com/psf/pycon-us-mobile",
62+
"wellKnown": "https://github.com/psf/pycon-us-mobile/blob/main/.well-known/funding-manifest-urls"
63+
},
64+
"licenses": [
65+
"MIT"
66+
],
67+
"tags": [
68+
"python",
69+
"community",
70+
"events"
71+
]
72+
},
73+
{
74+
"guid": "community",
75+
"name": "Global Community Support",
76+
"description": "The PSF Grants Program supports a thriving global network of regional Python events, workshops, user groups, communities, and initiatives.",
77+
"webpageUrl": {
78+
"url": "https://www.python.org/psf/grants/"
79+
},
80+
"repositoryUrl": {
81+
"url": "https://github.com/psf/.github",
82+
"wellKnown": "https://github.com/psf/.github/blob/main/.well-known/funding-manifest-urls"
83+
},
84+
"licenses": [
85+
"MIT"
86+
],
87+
"tags": [
88+
"python",
89+
"community",
90+
"networking"
91+
]
92+
}
93+
],
94+
"funding": {
95+
"channels": [
96+
{
97+
"guid": "paypal",
98+
"type": "payment-provider",
99+
"address": "https://psfmember.org/civicrm/contribute/transact?reset=1&id=2",
100+
"description": "Donate directly via PayPal"
101+
},
102+
{
103+
"guid": "paypal-member",
104+
"type": "payment-provider",
105+
"address": "https://psfmember.org/civicrm/contribute/transact/?reset=1&id=1",
106+
"description": "Become a Supporting Member via PayPal"
107+
},
108+
{
109+
"guid": "github",
110+
"type": "payment-provider",
111+
"address": "https://github.com/sponsors/psf",
112+
"description": "Donate via GitHub Sponsors, and get recognized on your GitHub profile"
113+
},
114+
{
115+
"guid": "bank",
116+
"type": "bank",
117+
"address": "[email protected]",
118+
"description": "Please email us for ACH payment details."
119+
}
120+
],
121+
"plans": [
122+
{
123+
"guid": "supportingmember",
124+
"status": "active",
125+
"name": "Supporting Member - Individual",
126+
"amount": 99,
127+
"currency": "USD",
128+
"frequency": "yearly",
129+
"channels": ["paypal-member"]
130+
},
131+
{
132+
"guid": "visionary",
133+
"status": "active",
134+
"name": "Visionary Sponsor",
135+
"amount": 155000,
136+
"currency": "USD",
137+
"frequency": "yearly",
138+
"channels": ["bank"]
139+
},
140+
{
141+
"guid": "sustainability",
142+
"status": "active",
143+
"name": "Sustainability Sponsor",
144+
"amount": 95000,
145+
"currency": "USD",
146+
"frequency": "yearly",
147+
"channels": ["bank"]
148+
},
149+
{
150+
"guid": "maintaining",
151+
"status": "active",
152+
"name": "Maintaining Sponsor",
153+
"amount": 63000,
154+
"currency": "USD",
155+
"frequency": "yearly",
156+
"channels": ["bank"]
157+
},
158+
{
159+
"guid": "contributing",
160+
"status": "active",
161+
"name": "Contributing Sponsor",
162+
"amount": 33000,
163+
"currency": "USD",
164+
"frequency": "yearly",
165+
"channels": ["bank"]
166+
},
167+
{
168+
"guid": "supporting",
169+
"status": "active",
170+
"name": "Supporting Sponsor",
171+
"amount": 16500,
172+
"currency": "USD",
173+
"frequency": "yearly",
174+
"channels": ["bank"]
175+
},
176+
{
177+
"guid": "partner",
178+
"status": "active",
179+
"name": "Partner Sponsor",
180+
"amount": 11000,
181+
"currency": "USD",
182+
"frequency": "yearly",
183+
"channels": ["bank"]
184+
},
185+
{
186+
"guid": "participating",
187+
"status": "active",
188+
"name": "Participating Sponsor",
189+
"amount": 4000,
190+
"currency": "USD",
191+
"frequency": "yearly",
192+
"channels": ["paypal", "github", "bank"]
193+
},
194+
{
195+
"guid": "associate",
196+
"status": "active",
197+
"name": "Associate Sponsor",
198+
"amount": 1500,
199+
"currency": "USD",
200+
"frequency": "yearly",
201+
"channels": ["paypal", "github", "bank"]
202+
}
203+
]
204+
}
205+
}

0 commit comments

Comments
 (0)