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
Article: ???
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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3235f9d8ba3d0b079e95746f4952f7500b57684c3aee1f2008c90d1e37db70f |
|
MD5 | 74692c99bb9fc690fc40af94025b1760 |
|
BLAKE2b-256 | 774d965babd751202056cffae7bfedcc9133231699186982ad34aaa04839f221 |
Hashes for realpython_django_receipts-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28c8fc82d2ee6cd60a5adf3aab845dcf04e94089113b3fdd14a2c8a620f5733a |
|
MD5 | b65e74d9221f0bd0d8fe102cfa6fd8e7 |
|
BLAKE2b-256 | 7748aeff1195ce90bc9722ee6df2fa4d778960a8d585a0c12178e2c2f8433272 |