Skip to main content

A Django app to build complete blog site.

Project description

Mickey

Mickey is a Django package to create a blog site quickly and easily. Mickey provide severals public REST APIs which can be integrated with frontend which are for such as Category List, Tag List, Post List etc. Mickey also provide a little bit customized Django admin from where user can easily create groups, site information, category, sub category, blog posts and media images.

Features

  • Add category and Subcategory
  • Add tags
  • Add images
  • Add posts (as public/ archive)

Below are the detail information to install the app.

Quick start

  1. Install django rest framework first from here https://www.django-rest-framework.org/#installation and add it to INSTALLED_APPS

  2. Add "mickey" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [ ... 'mickey', ]

  3. Add a middleware 'mickey.middleware.CurrentUserMiddleware' at the very bottom of the MIDDLEWARE list this::

    MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'mickey.middleware.CurrentUserMiddleware' ]

  4. In your project root folder import mickey urls like as::

    from django.urls import path, re_path, include from django.conf.urls import url from django.conf import settings from django.conf.urls.static import static from mickey import urls as blog_urls

  5. Include the mickey URLconf in your project urls.py like this::

    re_path(r"^api/v1/", include(blog_urls)),

  6. At the bottom of the urls.py file add this::

    if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

  7. Add media url in settings.py file like as ::

    MEDIA_URL = "/media/" MEDIA_ROOT = os.path.join(BASE_DIR, "media/images/") STATIC_ROOT = os.path.join(BASE_DIR, "static")

  8. Run python manage.py makemigrations and python manage.py migrate to create all models.

  9. Start the development server and visit http://127.0.0.1:8000/admin/ to create a poll (you'll need the Admin app enabled).

  10. Create Category, Subcategory, Tags, Media files and blog posts from django admin.

  11. Public REST APIs endpoints are::

    'categories': 'http://localhost:8000/api/v1/public/categories/', 'tags': 'http://localhost:8000/api/v1/public/tags/' 'posts': 'http://localhost:8000/api/v1/public/posts/', 'reacts': 'http://localhost:8000/api/v1/public/reacts/', 'comments': 'http://localhost:8000/api/v1/public/comments/', 'site-information': 'http://localhost:8000/api/v1/public/site-information/'

Advance options

Mickey provide APIs for public post and archive post. /api/v1/public/posts/ and /api/v1/public/posts/?type=published both API endpoints fetch all posts which are published and not archive. /api/v1/public/posts/?type=archive To make a post archive, mark check box archive in django admin. Remember a archive post is also a published post but in a different scheme. To get all posts for a single tag use the API endpoint /api/v1/public/posts/?tag=

In Mickey, image need to choose in time of creation a blog post. Hence there is a media browser named Media. To use any image, first need to upload images from Media. In each time of uploading a single image, Mickey created extra 2 copy of same image with different size which are mainly medium and small size. By default the medium and small size are (768,1024) and (265, 300).

But you can override the size from settings.py file which is your root app folder. To change, create two variable in your setting.py file named MID_IMAGE_SIZE and SM_IMAGE_SIZE and assign to them image sizes as a tuple.

Example ::

MID_IMAGE_SIZE = (768, 1024)
SM_IMAGE_SIZE = (264, 300)

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

mickey-0.0.2.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

mickey-0.0.2-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file mickey-0.0.2.tar.gz.

File metadata

  • Download URL: mickey-0.0.2.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for mickey-0.0.2.tar.gz
Algorithm Hash digest
SHA256 621e2a2ad7e3d9315543532142fd475a3a79f87bcd6261c4b6fb0901df6838e4
MD5 cc64f63175e522082a1509ef86eecbf7
BLAKE2b-256 31f889e41c5396d4913b667e551a70698e531cd1b531c9c289d4ce9883a4b05b

See more details on using hashes here.

File details

Details for the file mickey-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: mickey-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for mickey-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 18a39eb24a410f2ddb8082c8a00434a3d65442305b3194ec47c1e6bb04988164
MD5 4cbbd34e6c5e21e04e21fe976511dfac
BLAKE2b-256 b5432d3ff94c1b03295eeb529daa21f6d24759b1b4bbeb56be5bc6306bc16a1d

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