A small reusable package that adds a News app to a project
Project description
Giant News
A re-usable package which can be used in any project that requires a generic News app.
This will include the basic formatting and functionality such as model creation via the admin.
Installation
To install with the package manager, run:
$ poetry add giant-news
You should then add "news", "easy_thumbnails" and "filer" to the INSTALLED_APPS in your settings file.
The detail pages in this app use plugins which are not contained within this app. It is recommended that you include a set of plugins in your project, or use the giant-plugins app.
In order to run django-admin commands you will need to set the DJANGO_SETTINGS_MODULE by running
$ export DJANGO_SETTINGS_MODULE=settings
Configuration
This application exposes the following settings:
-
ARTICLETAG_ADMIN_LIST_DISPLAYis the field list for the admin index. This must be a list -
ARTICLETAG_ADMIN_FIELDSETSallows the user to define the admin fieldset. This must be a list of two-tuples -
ARTICLETAG_ADMIN_READONLY_FIELDSallows the user to configure readonly fields in the admin. This must be a list -
ARTICLE_ADMIN_LIST_DISPLAYis the field list for the admin index. This must be a list -
ARTICLE_ADMIN_SEARCH_FIELDSallows the user to configure search fields in the admin. This must be a list -
ARTICLE_ADMIN_FIELDSETSallows the user to define the admin fieldset. This must be a list of two-tuples -
ARTICLE_ADMIN_READONLY_FIELDSallows the user to configure readonly fields in the admin. This must be a list -
AUTHOR_ADMIN_LIST_DISPLAYis the field list for the admin index. This must be a list -
AUTHOR_ADMIN_FIELDSETSallows the user to define the admin fieldset. This must be a list of two-tuples -
AUTHOR_ADMIN_READONLY_FIELDSallows the user to configure readonly fields in the admin. This must be a list -
RELATED_ARTICLES_LIMITallows the user to set how many articles are pulled through in the related articles plugin, the default is 3. Must be an int
URLs
Add the following to core.urls for general functionality:
path("news/", include("news.urls"), name="news"),
If you want to customize the urls to include a different path and/or templates, first you must import from news import views as news_views in core.urls and then you could add the following:
path("news/", news_views.ArticleIndex.as_view(template_name="news/index.html"), name="news-index"),
path("news/<slug:slug>/", news_views.ArticleDetail.as_view(template_name="news/detail.html"), name="news-detail"),
Preparing for release
In order to prep the package for a new release on TestPyPi and PyPi there is one key thing that you need to do. You need to update the version number in the pyproject.toml.
This is so that the package can be published without running into version number conflicts. The version numbering must also follow the Semantic Version rules which can be found here https://semver.org/.
Publishing
Publishing a package with poetry is incredibly easy. Once you have checked that the version number has been updated (not the same as a previous version) then you only need to run two commands.
$ `poetry build`
will package the project up for you into a way that can be published.
$ `poetry publish`
will publish the package to PyPi. You will need to enter the username and password for the account which can be found in the company password manager
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file giant-news-0.3.4.tar.gz.
File metadata
- Download URL: giant-news-0.3.4.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.7.0 Linux/5.11.0-25-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
426730852711155ed64b0964cadcaab89c973fdca2de4dd6fb2a1f83d981afb5
|
|
| MD5 |
8d3a3595b5d015f26161d7f994881749
|
|
| BLAKE2b-256 |
a95d0c7e4ffacea51859da140ee58e0e749fa284f3e24b4a87f6c3a2663d9581
|
File details
Details for the file giant_news-0.3.4-py3-none-any.whl.
File metadata
- Download URL: giant_news-0.3.4-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.7.0 Linux/5.11.0-25-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65b042b4cdb4de6288d787a3eb2d022bddbf98fa168808f921dce6c44c2c269b
|
|
| MD5 |
8e2d55a1a4eeb2f7acc776bee6d17612
|
|
| BLAKE2b-256 |
1d21d9cfe44177caacd9f3f93a96621c0ff28d440143cdca483c96e3e158cc1a
|