Compare commits
3 commits
d70c1f0182
...
16561eba6f
Author | SHA1 | Date | |
---|---|---|---|
Hugh Rundle | 16561eba6f | ||
Hugh Rundle | c8fc3b4c45 | ||
Hugh Rundle | e8bebca7b4 |
91
README.md
91
README.md
|
@ -1,90 +1 @@
|
||||||
# Aus GLAMR
|
This repository is now at https://git.suboptimal.solutions/hugh/ausglamr
|
||||||
|
|
||||||
A django app running on Docker. Replaces _Aus GLAM Blogs_.
|
|
||||||
|
|
||||||
## Deploy
|
|
||||||
|
|
||||||
* `cp .env.example .env` and enter env values for your app
|
|
||||||
* set up web server config (nginx example coming soon)
|
|
||||||
* `docker compose build`
|
|
||||||
* `./glamr-dev migrate`
|
|
||||||
* `./glamr-dev createsuperuser`
|
|
||||||
* `docker compose up -d`
|
|
||||||
* set up database backups (as cron jobs): `./glamr-dev backup`:
|
|
||||||
* set up cron jobs for management commands as below
|
|
||||||
|
|
||||||
## Admin
|
|
||||||
|
|
||||||
Don't forget to add some Content Warnings for use by the Mastodon bot, within `/admin`.
|
|
||||||
|
|
||||||
## CLI tool
|
|
||||||
|
|
||||||
Use `glamr-dev` to make your life easier (thanks to Mouse Reeve for the inspiration):
|
|
||||||
|
|
||||||
* announce
|
|
||||||
* backup
|
|
||||||
* check_feeds
|
|
||||||
* manage [django management command]
|
|
||||||
* makemigrations
|
|
||||||
* migrate
|
|
||||||
* queue_announcements
|
|
||||||
* send_weekly_email
|
|
||||||
|
|
||||||
And for dev work:
|
|
||||||
|
|
||||||
* black
|
|
||||||
* collectstatic
|
|
||||||
* createsuperuser
|
|
||||||
* pylint
|
|
||||||
* resetdb
|
|
||||||
* test
|
|
||||||
|
|
||||||
## Registration
|
|
||||||
|
|
||||||
- users can register a blog, group, event, newsletter, or Call for Papers.
|
|
||||||
- most of these ask for an "owner email" - this is optional but allows us to communicate with the person registering.
|
|
||||||
- all registrations should trigger an email to admin
|
|
||||||
- all must be approved before they are included
|
|
||||||
|
|
||||||
## Management commands
|
|
||||||
|
|
||||||
There are four commands:
|
|
||||||
|
|
||||||
- announce
|
|
||||||
- check_feeds
|
|
||||||
- queue_announcements
|
|
||||||
- send_weekly_email
|
|
||||||
|
|
||||||
These will not be triggered within the app - they should be called via cron jobs.
|
|
||||||
|
|
||||||
### announce
|
|
||||||
|
|
||||||
This announces the next queued announcement on Mastodon.
|
|
||||||
|
|
||||||
Run every 21 mins.
|
|
||||||
|
|
||||||
### check_feeds
|
|
||||||
|
|
||||||
This checks all blog feeds for any new posts, and adds them to the database as long as they don't have an exclusion tag and were not published during a time the blog was suspended.
|
|
||||||
|
|
||||||
Also checks newsletter articles if there is a feed.
|
|
||||||
|
|
||||||
Run every hour.
|
|
||||||
|
|
||||||
### queue_announcements
|
|
||||||
|
|
||||||
This queues announcements for events and CFPs. These are announced three times, evenly spaced between when they were added and when the event starts or the CFP closes.
|
|
||||||
|
|
||||||
Run daily.
|
|
||||||
|
|
||||||
### send_weekly_email
|
|
||||||
|
|
||||||
Does what you think. Creates a weekly email of the latest stuff, and send to everyone in Subscribers.
|
|
||||||
|
|
||||||
Run weekly.
|
|
||||||
|
|
||||||
### Backups
|
|
||||||
|
|
||||||
There is a `backup` command in `glamr-dev`. You can adjust the filepaths in your `.env` file.
|
|
||||||
|
|
||||||
Run daily
|
|
||||||
|
|
|
@ -131,6 +131,7 @@ class Blog(admin.ModelAdmin):
|
||||||
"active",
|
"active",
|
||||||
)
|
)
|
||||||
ordering = ["approved", "-suspended", "-failing"]
|
ordering = ["approved", "-suspended", "-failing"]
|
||||||
|
search_fields = ["title", "author_name", "url"]
|
||||||
actions = [approve, unapprove, suspend, unsuspend, activate, disable]
|
actions = [approve, unapprove, suspend, unsuspend, activate, disable]
|
||||||
|
|
||||||
|
|
||||||
|
@ -140,6 +141,7 @@ class Article(admin.ModelAdmin):
|
||||||
|
|
||||||
date_hierarchy = "pubdate"
|
date_hierarchy = "pubdate"
|
||||||
list_display = ("title", "blog_title", "pubdate")
|
list_display = ("title", "blog_title", "pubdate")
|
||||||
|
search_fields = ["title", "author_name", "blog_title", "url"]
|
||||||
|
|
||||||
def blog_title(self, obj): # pylint: disable=no-self-use
|
def blog_title(self, obj): # pylint: disable=no-self-use
|
||||||
"""get the title of the parent blog"""
|
"""get the title of the parent blog"""
|
||||||
|
@ -151,7 +153,7 @@ class Tag(admin.ModelAdmin):
|
||||||
"""display settings for tags"""
|
"""display settings for tags"""
|
||||||
|
|
||||||
list_display = ("name",)
|
list_display = ("name",)
|
||||||
|
search_fields = ["name"]
|
||||||
|
|
||||||
@admin.register(models.Event)
|
@admin.register(models.Event)
|
||||||
class Event(admin.ModelAdmin):
|
class Event(admin.ModelAdmin):
|
||||||
|
@ -166,6 +168,7 @@ class Event(admin.ModelAdmin):
|
||||||
"start_date",
|
"start_date",
|
||||||
)
|
)
|
||||||
ordering = ["approved", "announcements"]
|
ordering = ["approved", "announcements"]
|
||||||
|
search_fields = ["name", "description", "url"]
|
||||||
actions = [approve, unapprove]
|
actions = [approve, unapprove]
|
||||||
|
|
||||||
|
|
||||||
|
@ -176,6 +179,7 @@ class CallForPapers(admin.ModelAdmin):
|
||||||
list_display = ("name", "event", "approved", "closing_date")
|
list_display = ("name", "event", "approved", "closing_date")
|
||||||
list_select_related = ("event",)
|
list_select_related = ("event",)
|
||||||
ordering = ["approved", "closing_date"]
|
ordering = ["approved", "closing_date"]
|
||||||
|
search_fields = ["event__name", "event__url", "details"]
|
||||||
actions = [approve, unapprove]
|
actions = [approve, unapprove]
|
||||||
|
|
||||||
|
|
||||||
|
@ -185,6 +189,7 @@ class Group(admin.ModelAdmin):
|
||||||
|
|
||||||
list_display = ("name", "approved", "category", "description")
|
list_display = ("name", "approved", "category", "description")
|
||||||
ordering = ["approved", "name"]
|
ordering = ["approved", "name"]
|
||||||
|
search_fields = ["name", "description", "url"]
|
||||||
actions = [approve, unapprove]
|
actions = [approve, unapprove]
|
||||||
|
|
||||||
|
|
||||||
|
@ -200,6 +205,7 @@ class Newsletter(admin.ModelAdmin):
|
||||||
"active",
|
"active",
|
||||||
)
|
)
|
||||||
ordering = ["approved", "-failing"]
|
ordering = ["approved", "-failing"]
|
||||||
|
search_fields = ["name", "description", "url", "author_name"]
|
||||||
actions = [approve, unapprove, suspend, activate, disable]
|
actions = [approve, unapprove, suspend, activate, disable]
|
||||||
|
|
||||||
|
|
||||||
|
@ -209,6 +215,7 @@ class Edition(admin.ModelAdmin):
|
||||||
|
|
||||||
date_hierarchy = "pubdate"
|
date_hierarchy = "pubdate"
|
||||||
list_display = ("title", "newsletter_name", "pubdate")
|
list_display = ("title", "newsletter_name", "pubdate")
|
||||||
|
search_fields = ["title", "description", "url", "newsletter__name", "author_name"]
|
||||||
|
|
||||||
def newsletter_name(self, obj): # pylint: disable=no-self-use
|
def newsletter_name(self, obj): # pylint: disable=no-self-use
|
||||||
"""get the title of the parent newsletter"""
|
"""get the title of the parent newsletter"""
|
||||||
|
|
Loading…
Reference in a new issue