Skip to main content

A small example plugin package

Project description

AI VIEW - DJANGO BLOG API PLUGIN POC

This a small example plugin for AI VIEW, showing how and what you need to create a pluggable package

Plugin Structure

  1. you will need to create the package main folder with the same name as the main module folder name, for example here we created "django_blog_api" as the main package folder and inside it the main module folder "django_blog_api", this structure will help in building the package later to export the code with the package.
  2. inside the main module you can create as many as apps inside it following the default Django APPS structure.
  3. then you need to configer pyproject.toml, setup.py files and add the needed files for python package like setup.cfg if needed and LICENSE, MANIFEST.in, README.md, CHANGELOG.rst, CONTRIBUTING.rst, AUTHORS.rst
  4. IMPORTANT make sure to add all the apps names you created to the main module init.py file in all variable, this step needed to make the package a plugable to AI VIEW.
  5. inside the main package you need to create a config folder to define the general plugin settings like URLS.

Plugin package bullied

to build a package, in the main package folder path, NOT the main module folder run

$  python -m pip install --upgrade build # run this in your system for the first time
$  python -m build # run this inside the main package folder path to build it 

this will generate 2 folder dist and name-of-package.egg-info folders that will be used by pypi,

  1. each time you build delete both folder
  2. and update the plugin version in pyproject.toml

Plugin package upload to pypi

to upload package to pypi, in the main package folder path, NOT the main module folder run

$ python -m pip install --upgrade twine # run this in your system for the first time
$ python -m twine upload  dist/*  # run this inside the main package folder path to upload it 

Plugin package installation from pypi

after you upload the package do a pip install

$ pip install django-blog-api

useful links

  1. https://packaging.python.org/en/latest/tutorials/packaging-projects/
  2. https://github.com/jazzband/django-redis

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

django-blog-api-0.0.6.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_blog_api-0.0.6-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file django-blog-api-0.0.6.tar.gz.

File metadata

  • Download URL: django-blog-api-0.0.6.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.0

File hashes

Hashes for django-blog-api-0.0.6.tar.gz
Algorithm Hash digest
SHA256 75276be5513127dc24f87156d7adaae3fc12481940a812dc23defcfcbb288459
MD5 ecb17d96c5c00d408f3be7bb6720e322
BLAKE2b-256 af196952649e387f9afa2db880db1c43746fc442d30fc25a8e9a9e0c2188b59c

See more details on using hashes here.

File details

Details for the file django_blog_api-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for django_blog_api-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 fe5c1fdb4a15a2d559ba9104044e6e74528a33a6a84251e2c4cf9528682ab3b6
MD5 6fc7827ca823331f1200ea8e0da5cd0e
BLAKE2b-256 612210e1b226ccdf9240904d75819d50a7d97664b23e130ccb59b02c0190f54d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page