Skip to main content

Sample installable django app

Project description

This is sample code used in the Real Python article [Writing 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 avilable 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 by:

$ 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 “project” Branch

The master branch contains the final code for the PyPI package. There is also a project branch which shows the “before” case – the Django project before the app has been removed.

Docs & Source

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-receipts-ms-1.0.4.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_receipts_ms-1.0.4-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file django-receipts-ms-1.0.4.tar.gz.

File metadata

  • Download URL: django-receipts-ms-1.0.4.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.5

File hashes

Hashes for django-receipts-ms-1.0.4.tar.gz
Algorithm Hash digest
SHA256 8496a8c4abea3655a15cb3867e60d8b67bce1caf8d11a26a7cacdbf2656e6066
MD5 a00bc10d92e201403380dc95a26551d9
BLAKE2b-256 685b6482906c136151dfd1debab1406194dd8cae0ea13625cceaac9c3e8d7888

See more details on using hashes here.

File details

Details for the file django_receipts_ms-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: django_receipts_ms-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.5

File hashes

Hashes for django_receipts_ms-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 33364b27743682a481e31b66b80befd657fc9a3918c074afa2c3b70fc0c7a30d
MD5 d4b06bdd806d3b74406b7facad8e7c21
BLAKE2b-256 ad300293fde93371f35a673469ec8b3116cb867b9ae92dd569c06285a0db45b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page