Giter Club home page Giter Club logo

punkwebbb's Introduction

PunkwebBB

PunkwebBB is a Django application that provides a simple forum board software for your Django website.

One of the main goals of this project is to be as simple as possible to install, and not depend on any other Django apps. I want users of this package to be able to install a fully working forum board in under a minute, and then be able to configure it further from there.

Check out punkweb.net for documentation, support and a live demonstration of the software.

Built with

Requirements

  • Python 3.9+
  • Django 3.2+

It may work with older versions of Python and Django, but it has not been tested.

Installation

pip install punkweb-bb

Add punkweb_bb to your INSTALLED_APPS in your Django settings module:

INSTALLED_APPS = [
    ...
    "punkweb_bb",
]

Optionally: Add the following middleware to your MIDDLEWARE setting, at the end of the list:

MIDDLEWARE = [
    ...
    "punkweb_bb.middleware.ProfileOnlineCacheMiddleware",
]

Add the following URL pattern to your urls.py:

from django.urls import path, include

urlpatterns = [
    ...
    path("forum/", include("punkweb_bb.urls")), # or any other path you want
]

And finally, install the models:

python manage.py migrate

Configuration

These are the default settings for PunkwebBB, which can be overridden in your Django settings module:

PUNKWEB_BB = {
  "SITE_NAME": "PUNKWEB",
  "SITE_TITLE": "PunkwebBB",
  "PARSER": "bbcode", # "bbcode" or "markdown"
  "FAVICON": "punkweb_bb/favicon.ico",
  "OG_IMAGE": None, # Used for Open Graph meta tags, must be a full URL!
  "SHOUTBOX_ENABLED": True,
  "SHOUTBOX_POLLING_ENABLED": True,
  "SHOUTBOX_POLLING_INTERVAL": 30, # in seconds
  "DISCORD_WIDGET_ENABLED": False,
  "DISCORD_WIDGET_THEME": "dark",
  "DISCORD_SERVER_ID": None, # Found under Server Settings > Widget > Server ID
}

Testing

Report:

coverage run && coverage report

HTML:

coverage run && coverage html
Found 59 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
...........................................................
----------------------------------------------------------------------
Ran 59 tests in 8.594s

OK
Destroying test database for alias 'default'...
Name                                           Stmts   Miss  Cover
------------------------------------------------------------------
punkweb_bb/__init__.py                             0      0   100%
punkweb_bb/admin.py                               42      0   100%
punkweb_bb/admin_forms.py                         34      0   100%
punkweb_bb/apps.py                                 6      0   100%
punkweb_bb/bbcode.py                             118     46    61%
punkweb_bb/decorators.py                          12      0   100%
punkweb_bb/forms.py                               59      0   100%
punkweb_bb/guests.py                              13      0   100%
punkweb_bb/middleware.py                          27      3    89%
punkweb_bb/mixins.py                              11      0   100%
punkweb_bb/models.py                             154      1    99%
punkweb_bb/pagination.py                          11      4    64%
punkweb_bb/response.py                             3      0   100%
punkweb_bb/searching.py                            8      5    38%
punkweb_bb/settings.py                            13      0   100%
punkweb_bb/signals.py                              9      0   100%
punkweb_bb/templatetags/__init__.py                0      0   100%
punkweb_bb/templatetags/can_delete.py              5      0   100%
punkweb_bb/templatetags/can_edit.py                5      0   100%
punkweb_bb/templatetags/can_post.py                5      0   100%
punkweb_bb/templatetags/humanize_int.py            9      5    44%
punkweb_bb/templatetags/punkweb_bb.py              6      0   100%
punkweb_bb/templatetags/render.py                 38     16    58%
punkweb_bb/templatetags/styled_group_name.py       7      1    86%
punkweb_bb/templatetags/styled_username.py         6      0   100%
punkweb_bb/tests.py                              418      0   100%
punkweb_bb/urls.py                                 4      0   100%
punkweb_bb/utils.py                               44     26    41%
punkweb_bb/views.py                              319    123    61%
punkweb_bb/widgets.py                             16      2    88%
------------------------------------------------------------------
TOTAL                                           1402    232    83%

punkwebbb's People

Contributors

shakedown-street avatar zkxjzmswkwl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

punkwebbb's Issues

Test coverage

Ensure test cases stay passing and are regularly updated when new features are added

Do not close until v1.0.0 release

Moderation - ban users and IP addresses

Allow staff to be able to ban users and IP addresses from accessing the forums. As this package is only concerned with the forums, it should only restrict forum usage, not the rest of the site.

Moderation - strikes

Enable moderators to add notes/strikes to user profiles that only that user and other moderators can see

Remove context processor

The context processor is only used for reading forum settings in templates, which could probably be handled better via a templatetag or something. Removing the context processor reduces the amount of steps consumers of the package will need to do during initial installation.

Setting to enable/disable shoutbox polling

Add the following settings:

  • SHOUTBOX_POLLING_ENABLED - True by default, setting to False disables polling for new messages
  • SHOUTBOX_POLLING_INTERVAL - 30 by default, controls how often to poll for new messages

Spoiler tag styles

The spoiler tag is just an html <details> tag with a <summary>. It should have some custom styles so it doesn't look so plain.

Better form layouts

Make sure all forms look good and behave well

Do not close until v1.0.0 release

User searching

Add ability to:

  • search for users by username
  • sort by username
  • sort by join date

Reporting system

Allow users to flag threads, posts, and shouts and have a way for users with the proper permissions to view and resolve the reports

Documentation

  • Basic installation
  • Configuration
  • Optional functionality (middleware, discord widget, shoutbox widget)
  • Themes and customization

Do not close until v1.0.0 release

Mixed parser

Finish building mixed parser that allows for creating posts with both markdown and bbcode content

Bugs:

  • Markdown does not work in spoiler or quote tags, possibly others

If a really good experience can be achieved with this parser, I'd eventually consider making it the default rather than bbcode.

Markdown parser

  • Markdown code tags not allowing <>&"' characters
  • Switch markdown editor, I'm not a big fan of tiny-markdown-editor
  • Create a markdown reference page that replaces the bbcode reference page when parser is set to markdown

Badge system

TODO: come up with a plan and update this description

Improved profile pages

  • Bio
  • Role/Groups
  • Top topics (by number of posts)
  • Top categories (by number of threads and replies)
  • Recent threads and posts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.