Skip to main content

App for publishing articles with tags and categories

Project description

Anarticle uses tag, catelog, and article models to publish articles. Support for Ariadne graphQL with pre-defined types and basic resolvers.

Requirements

  • Python 3.10+

  • django 4.0+

  • pillow 9.4.0+

Settings

Store uploaded file with tokenize file name, default to False

  • ANARTICLE_USE_TOKEN_FILENAME = True

Django admin mixins

Use predefined mixins to construct the admin class.

  • TagAdminMixin

  • CategoryAdminMixin

  • ArticleAdminMixin

from django.contrib import admin

from anarticle.models import Tag
from anarticle.admin.mixins import TagAdminMixin


@admin.register(Tag)
class TagAdmin(TagAdminMixin, ModelAdmin):
    ...

Ariadne types and resolvers

Integrate predefined types and resolvers to scheme.

Requirements

  • ariadne 0.16.0+

  • ariadne-relay 0.1.0a8+

scheme

from anarticle.graphqls import anarticle_schema
  • anarticle/graphqls/article.graphql

  • anarticle/graphqls/tag.graphql

  • anarticle/graphqls/category.graphql

types

from anarticle.graphqls import anarticle_bindables
  • anarticle

  • anarticle_paragraph

  • anarticle_tag

  • anarticle_category

resolvers

Async version

from anarticle.graphqls import resolve_anarticle_tag_instance, \
        resolve_anarticle_tag_articles_connection, resolve_anarticle_tags

anarticle_tag.set_instance_resolver(resolve_anarticle_tag_instance)
anarticle_tag.set_connection('articles', resolve_anarticle_tag_articles_connection)

query.set_field('tags', resolve_anarticle_tags)
  • resolve_anarticle_tag_instance,

  • resolve_anarticle_tag_articles_connection,

  • resolve_anarticle_category_instance,

  • resolve_anarticle_category_tags_connection,

  • resolve_anarticle_instance,

  • resolve_anarticle_paragraphs,

  • resolve_anarticle_tags_connection,

  • resolve_anarticle_tags,

  • resolve_anarticle_categories,

  • resolve_anarticles,

Sync version

  • resolve_anarticle_tag_instance_sync,

  • resolve_anarticle_tag_articles_connection_sync,

  • resolve_anarticle_category_instance_sync,

  • resolve_anarticle_category_tags_connection_sync,

  • resolve_anarticle_instance_sync,

  • resolve_anarticle_paragraphs_sync,

  • resolve_anarticle_tags_connection_sync,

  • resolve_anarticle_tags_sync,

  • resolve_anarticle_categories_sync,

  • resolve_anarticles_sync,

License

django-anarticle is released under the terms of Apache license. Full details in LICENSE file.

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-anarticle-0.1.0rc3.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

django_anarticle-0.1.0rc3-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file django-anarticle-0.1.0rc3.tar.gz.

File metadata

  • Download URL: django-anarticle-0.1.0rc3.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for django-anarticle-0.1.0rc3.tar.gz
Algorithm Hash digest
SHA256 65621cd590e21e4fcc8e5444de95ae7eae402fdce1c4f3347fababdaf0834b1f
MD5 c5c15785e5f1ab379516632cb68c9d60
BLAKE2b-256 8601c8709c4c12bd01461e2e10f23c7aa8e7c76f4b917e5a19b1ec601473790c

See more details on using hashes here.

File details

Details for the file django_anarticle-0.1.0rc3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_anarticle-0.1.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 1f02a388fa746c902a0d7de9e40adb34e2530d58fbd7b7dc57d964ca46e33164
MD5 8a6c8815b50146fd907e05049fcd7aa8
BLAKE2b-256 c77fc443e4134ee0a59c13bfc09ffe2c2f9c0385ed86e9ab58329caee2d2383b

See more details on using hashes here.

Supported by

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