# Looking for examples of OSS Django projects as PyPi packages

**URL:** https://forum.djangoproject.com/t/looking-for-examples-of-oss-django-projects-as-pypi-packages/36224
**Category:** Using Django
**Created:** [November 6, 2024, 9:01am UTC](https://forum.djangoproject.com/t/looking-for-examples-of-oss-django-projects-as-pypi-packages/36224 "2024-11-06T09:01:33Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mrchrisadams](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mrchrisadams/32/1904_2.png) [@mrchrisadams](https://forum.djangoproject.com/u/mrchrisadams)
#### Post date: [November 6, 2024, 9:01am UTC](https://forum.djangoproject.com/t/looking-for-examples-of-oss-django-projects-as-pypi-packages/36224/1 "2024-11-06T09:01:33Z")

</div>

Hi folks,

I know Django does not do this by default, and I know that by default if you find a package with `django-` in its name on PyPi, the chances are that it is a django app.

Are there any examples you might point me to of full django projects on Pypi, that are packaged up as django packages?

**My example, as I figure out how I should be doing this**

I’m working on one at the link below, where I have an existing software library, and then a bundled directory containing a minimal django project to use the library in API requests. I’m using granian as a bundled web server for a more suitable alternative to the django web server if this needs to be run in production example.

> **[GitHub - thegreenwebfoundation/carbon-txt-validator: A validator for carbon.txt files, and linked...](https://github.com/thegreenwebfoundation/carbon-txt-validator/)**
>
> A validator for carbon.txt files, and linked documents in them

**Why use Django like this?**

I’m mainly doing this because if I want to expose an HTTP API on a project, I’m more comfortable with Django than other tools like FastAPI and the rest, and I find the ecosystem of supporting packages very helpful in the Django ecosystem.

Projects like [NanoDjango](https://pypi.org/project/nanodjango) also make me feel a bit better about packaging up Django like this for relatively small projects, because it give some idea of what smaller, or even single-file django projects can look like.

The other reason is that if you’re using `uv ` now, running a Django app could be as simple as calling

```auto
uv tool run carbon-txt serve

```

And if you have it behind a reverse proxy server like Nginx or Caddy, you could theoretically run it in production with something like this invocation (assuming you have a .env file in the same directory):

```auto
uv tool run carbon-txt serve --production --server granian

```

You can see the [docs as I’m writing it out](https://carbon-txt-validator.readthedocs.io/en/latest/deployment.html). I’ve also [written before about using Caddy with Django in this forum](https://forum.djangoproject.com/t/sample-set-up-with-django-and-caddy/17640/2), as I think it offers one of the best developer experiences of setting up what can otherwise be quite fiddly.

However, I know that Django has a grain, and I haven’t seen many django projects packaged up onto PyPi to learn from, so I can see what the common patterns are.

So as I said higher up in this post - if you know of any django _projects_ on PyPi, would you share a few links to them?

Ta

_As an aside: for those curious about what the above project is about, there’s a fairly in-depth report now online about our plans for carbon.txt, and also a [page on the Green Web Foundation website](https://www.thegreenwebfoundation.org/tools/carbon-txt/) with more info._

---

<div class="post-metadata">

### Author: ![carltongibson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/carltongibson/32/267_2.png) [@carltongibson](https://forum.djangoproject.com/u/carltongibson)
#### Post date: [November 7, 2024, 5:46pm UTC](https://forum.djangoproject.com/t/looking-for-examples-of-oss-django-projects-as-pypi-packages/36224/2 "2024-11-07T17:46:20Z")

</div>

I never did this @mrchrisadams but in theory you’d package up and define an entry point, as for any cli tool.

Flit is lightweight, and my favourite tool for packaging for pure Python packages.

[https://flit.pypa.io/en/stable/pyproject\_toml.html#pyproject-project-entrypoints](https://flit.pypa.io/en/stable/pyproject_toml.html#pyproject-project-entrypoints)

If you get stuck, I can try a demo for you when I’m at the computer.

---

<div class="post-metadata">

### Author: ![mrchrisadams](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mrchrisadams/32/1904_2.png) [@mrchrisadams](https://forum.djangoproject.com/u/mrchrisadams)
#### Post date: [November 8, 2024, 1:41pm UTC](https://forum.djangoproject.com/t/looking-for-examples-of-oss-django-projects-as-pypi-packages/36224/3 "2024-11-08T13:41:23Z")

</div>

Thanks @cartongibson!

You can see how I’ve done this here now in that package - here’s the relevant part of the pyproject. I’m calling `cli:app` to use the typer CLI below:

> <https://github.com/thegreenwebfoundation/carbon-txt-validator/blob/main/pyproject.toml#L27-L33>

Within the CLI, there’s a `serve` command like so:

> <https://github.com/thegreenwebfoundation/carbon-txt-validator/blob/main/src/carbon_txt/cli.py#L118-L176>

This turned out to be quite similar to how nanodjango worked - when I looked it up: that has `serve` command too, but they bundle in Uvicorn, from memory.

I hadn’t got round to deliberately choosing a tool for helping me publish packages yet - so far I had been using a combo of `uv build`, and then publishing with twine, with `uv run twine upload --repository pypi dist/*`.

Flit looks nice though - I’ll give it a go.

---

<div class="post-metadata">

### Author: ![carltongibson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/carltongibson/32/267_2.png) [@carltongibson](https://forum.djangoproject.com/u/carltongibson)
#### Post date: [November 8, 2024, 1:58pm UTC](https://forum.djangoproject.com/t/looking-for-examples-of-oss-django-projects-as-pypi-packages/36224/4 "2024-11-08T13:58:03Z")

</div>

Great! Nice work. 🥇

> [@mrchrisadams](#):
>
> combo of `uv build`

Didn’t know it did that; any Python build tool will do. 👍

---

<div class="post-metadata">

### Author: ![yala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/yala/32/25068_2.png) [@yala](https://forum.djangoproject.com/u/yala)
#### Post date: [November 8, 2024, 2:28pm UTC](https://forum.djangoproject.com/t/looking-for-examples-of-oss-django-projects-as-pypi-packages/36224/5 "2024-11-08T14:28:38Z")

</div>

> [@mrchrisadams](#):
>
> Are there any examples you might point me to of full django projects on Pypi, that are packaged up as django packages?

I know at least these: Fiduswriter, Pretalx and Pretix. There are probably more.
