Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

realpython/django-receipts

Open more actions menu

Repository files navigation

django-receipts

This is the sample code used in the Real Python article How to Write 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 available 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 with:

$ 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 "before" project

The before folder shows the "before" case -- the Django project before the app was made installable.

Docs & Source

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.