Metadata-Version: 2.1
Name: django-blog-api
Version: 0.0.6
Summary: A small example plugin package
Author-email: Fadi Ghattas <fadoghattas100@outlook.com>
License: MIT License        
        Copyright (c) 2018 Joel Barmettler        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.        
Project-URL: repository, https://github.com/fadighattas100/django_blog_api
Project-URL: documentation, https://github.com/fadighattas100/django_blog_api
Keywords: posts-api,tutorial
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: html2text
Requires-Dist: tomli ; python_version < "3.11"
Provides-Extra: build
Requires-Dist: build ; extra == 'build'
Requires-Dist: twine ; extra == 'build'
Provides-Extra: dev
Requires-Dist: black ; extra == 'dev'
Requires-Dist: bumpver ; extra == 'dev'
Requires-Dist: isort ; extra == 'dev'
Requires-Dist: mypy ; extra == 'dev'
Requires-Dist: pytest ; extra == 'dev'

# 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
