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: ???
PyPI: ???
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6bb9cfc76d7bd897f9cb9ba72f2171689683d0d7fb3d4b86666e8a45aab299c |
|
MD5 | 59da8df56a1a8accec3f98322285142e |
|
BLAKE2b-256 | ef3a9f4ecb7000da6020608e25580448beb4e1674588e98446ba2bc3d3788715 |
Hashes for realpython_django_receipts-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 513596703ca8a9091c981f45800d4866148c8e3e9ce25896b0a3ccef6d813278 |
|
MD5 | ea71f0f9058c046868383d52da31240d |
|
BLAKE2b-256 | c022bf1ae6e82236b06584027f449e83b4f409e93c5dd645135a15d1a3c43971 |