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)
Quick start
-
Install
django rest frameworkandPillow -
Add "rest_framework" and "mickey" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [
...
'rest_framework',
'mickey',
]
- 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'
]
- 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
- Include the mickey URLconf in your project urls.py like this::
re_path(r"^api/v1/", include(blog_urls)),
- 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)
- 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")
-
Run
python manage.py makemigrationsandpython manage.py migrateto create all models. -
Start the development server and visit http://127.0.0.1:8000/admin/ to create a poll (you'll need the Admin app enabled).
-
Create Category, Subcategory, Tags, Media files and blog posts from django admin.
-
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)
Metadata
Release files for mickey 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mickey-0.0.5.tar.gz | 12.4 kB | Without provenance | Details for mickey-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mickey-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for mickey-0.0.5-py3-none-any.whl |
Total release size: 27.4 kB
Release files / mickey-0.0.5.tar.gz
| Download URL | mickey-0.0.5.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c2b5665b83367e2fd07e51744bbb2fdf3ebf2968b194a24d1d687f8a8ebe06c2
|
|
BLAKE2b-256 checksum How to use checksums |
2bea54e7ff90639b2dd7a46b1d9ac83a09595c39f2e6e2539ad1790646ac4731
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Release files / mickey-0.0.5-py3-none-any.whl
| Download URL | mickey-0.0.5-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e8ac1db5bf12aecc91d80394d4ab5926f60eb85d67da2f29f8cac1e4d6426a5
|
|
BLAKE2b-256 checksum How to use checksums |
9c817f8ba45f3fffc13f10a61bc970fac01e74d16f59b724d0e5805028064a37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Security for mickey 0.0.5
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.