Skip to main content

djgo

Description

This package provides some shortcuts for your django app.

Installation

pip install djgo

Usage

djgo has shortcuts for different parts of the app. To use it, simply import it with import djgo.

manage.py

Method start_django() (or manage()) is a shortcut for launching Django.

wsgi.py

Method set_wsgi() is a shortcut that sets Django settings env variable and returns default wsgi application.

urls.py

Method load_app() is a shortcut that loads and returns an app module or its part.

app/contrib.py

Method app_config() is a shortcut that sets Django app config. Example:

from djpp import app_config
default_app_config = app_config(verbose_name='My Cool App')

app/models.py

Decorator @meta is a shortcut that sets meta and __str__() for your model.
WARNING: All meta defined this way won't register in migrations.
Example:

@meta(single='My Client', plural='My Clients', display='name')
class Client(models.Model):
    name = models.CharField()

is equal to

class Client(models.Model):
    name = models.CharField()
    class Meta:
        verbose_name = 'My Client'
        verbose_name_plural = 'My Clients'
    def \_\_str\_\_():
        return self.name

except the meta (name and verbose_name) won't register in migrations.

You can also pass functions to display:

@meta('My Client', display=lambda self: 'Cool ' + str(self.name))
class Client(models.Model):
    name = models.CharField()

is equal to

class Client(models.Model):
    name = models.CharField()
    class Meta:
        name = 'My Client'
        verbose_name = 'My Client'
    def \_\_str\_\_():
        return 'Cool ' + str(self.name)

except the meta (name and verbose_name) won't register in migrations.

djgo.admin

djgo has a small set of methods for admin site and admin.py file:

  • admin.urls is a shortcut for path('url', admin.site.urls), except adds '/' in the end of your url string if it doesn't have one.
  • admin.meta is a shortcut for setting admin.site.site_header and admin.site.site_title.
  • admin.clear_models is a shortcut for clearing models from admin site registry.
  • admin.quick_inline is a decorator for setting some tabular inline params.

Other features

You can also access settings through djgo with djgo.settings!

Lastly, djgo provides a small log() method for printing some info.

Metadata

Release files for djgo 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for djgo 0.0.2
File Size Uploaded Provenance
djgo-0.0.2.tar.gz 5.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for djgo 0.0.2
File Interpreter ABI Platform
djgo-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.5 kB

Release files / djgo-0.0.2.tar.gz

Download URL djgo-0.0.2.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2d7b43d9feeb5298749136407c36ac16e7b9dc076a59ed152eb93c775187e788
BLAKE2b-256 checksum
How to use checksums
97325307c1b758e4f1af8458ac69f22cfb568eaeec48c117b3c31341ae72bf90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.1 Windows/10

Release files / djgo-0.0.2-py3-none-any.whl

Download URL djgo-0.0.2-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
902c878633b0ba21a749e804733eedb40f7ab004c63c997866ecb41424532729
BLAKE2b-256 checksum
How to use checksums
ae0e0a717debbcd2eccb3496a8e354adaf9d4d1626cd137653a5fc9abdc98b71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.1 Windows/10

Security for djgo 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page