Skip to main content

django-receipts

This is the sample code used in the Real Python article How to Write an Installable Django App. The article describes how to take an app from an existing Django project and make it a stand-alone installable package available on PyPI.

Installable App

This app models a list of items on a receipt. Each item has a description and a cost. A receipt may reference multiple items.

This app can be installed and used in your Django project with:

$ pip install realpython-django-receipts

Edit your settings.py file to include ‘receipts’ in the INSTALLED_APPS listing.

INSTALLED_APPS = [
    ...

    'receipts',
]

Edit your project urls.py file to import the URLs:

url_patterns = [
    ...

    path('receipts/', include('receipts.urls')),
]

Finally, add the models to your database:

$ ./manage.py makemigrations receipts

The “before” project

The before folder shows the “before” case – the Django project before the app was made installable.

Docs & Source

Metadata

Release files for realpython-django-receipts 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for realpython-django-receipts 1.1.0
File Size Uploaded Provenance Actions
realpython_django_receipts-1.1.0.tar.gz 4.3 kB Without provenance Details for realpython_django_receipts-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for realpython-django-receipts 1.1.0
File Interpreter ABI Platform Actions
realpython_django_receipts-1.1.0-py3-none-any.whl Python 3 none any Details for realpython_django_receipts-1.1.0-py3-none-any.whl

Total release size: 10.8 kB

Release files / realpython_django_receipts-1.1.0.tar.gz

Download URL realpython_django_receipts-1.1.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
40bd8e99b1261b523c5bf87e21626acefd030adc4d23d3238e8c863ebdfe3ca3
BLAKE2b-256 checksum
How to use checksums
95eb3dc56f90b6cf5a144f5916dc5caf29e8e06c17f2e752d2c0d8dfd5618c7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release files / realpython_django_receipts-1.1.0-py3-none-any.whl

Download URL realpython_django_receipts-1.1.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
734a31abc5a99f472be07a7d759596a41c7a2e7e538aa887156cc121d4639a1f
BLAKE2b-256 checksum
How to use checksums
732aff20388e9546c5f1a99b63dcafacf67a0c7af433bc145c2e6d3276fa04a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Security for realpython-django-receipts 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page