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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fb1aade0f4358cc130aed30a6b5faa48ad0ddb4895e53b8724885544f069148 |
|
MD5 | 35f2bf1449c41865d502304c93c63b7c |
|
BLAKE2b-256 | 392c6f64c15d30afd8f340df69a9d3ed2e2cdd761e7940c34e731a1733cb004c |
Hashes for realpython_django_receipts-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d26d0cb3fc03342ff9a8b66f7eb09119152d7a57819115a48723f2f6992bee38 |
|
MD5 | bef4fde02c92d252f4b4adf94e87f5e2 |
|
BLAKE2b-256 | ffc679f2653caebd7ed3c660c722dd782f400ed6b9b00a415298354abe195004 |