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
Built Distribution
Hashes for realpython-django-receipts-1.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6983dadff1c68a1f4b36c48c63803199cae6b58cf1c00350f27e9b4ee978126e |
|
MD5 | 7a3f12f325a8e899dd88ff7851f0be04 |
|
BLAKE2b-256 | eab134292ed92148db8acce54c01aef542346caba27f931af832ddc6f683dd18 |
Hashes for realpython_django_receipts-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88376aa4de7e827b3cddc16905ed95730d50fd94732839a55f68fa1035867137 |
|
MD5 | 89f468071be171111de248c20d0c6178 |
|
BLAKE2b-256 | 76f03acfdbfabaad8b9b8a73ff863ab2e94098d52f84dc209cf9d6308f6007ea |