Forum for Django framework.
Project description
Forum for Django framework. This reusable application it is designed to be easily integrated into an existing Django application.
Features
Multiple forums ordered by for category.
Support to sub-forums.
Count views for forum and topic.
Support to topics main in forum.
Support to rss to forums.
User registration a forum.
Search topics in a forum.
Pre-moderation of topics with multiple moderators.
Support of media files for topics.
Infinite scroll for comments of one topic.
Notifications and email notifications.
Notifications and comments in real time.
Integrated model profile, but can be extended.
Avatar profile.
Easy integration with other applications Django of your project.
Models registered in admin django for administrators.
Support check user online.
Support to English and Spanish languages.
Validation of forms in real time with AngularJs.
API REST with django-rest-framework.
Support Python 3.
Custom configuration css.
Markdown support in textarea.
Authentication.
Message for forums.
Suggested Topics in topic.
Close topic.
Note 1: When a new record is added to the user model automatically added to your model profile.
Installing
With pip:
pip install django-musette
Quick start
Add application ‘musette’ and dependencies to INSTALLED_APPS:
INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', ... 'hitcount', 'endless_pagination', 'rest_framework', 'musette', )
Add this urls to file urls.py:
url(r'^' , include('musette.urls')), .... # And add this from django.conf import settings if settings.DEBUG: from django.conf.urls.static import static urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
In settings.py configure LOGIN_URL, STATIC, MEDIA root, SITE_ID, SITE_NAME and SITE_URL. Example config of settings.py.
In settings.py in TEMPLATES check in context_processors this values:
'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'django.template.context_processors.media', 'django.template.context_processors.static', 'django.template.context_processors.tz', 'django.template.context_processors.i18n', 'musette.context_processors.data_templates',
Configure in the settings.py the variable CACHES for redis. This is for real time support. Example:
CACHES = { 'default': { 'BACKEND' : 'redis_cache.RedisCache', 'LOCATION' : 'localhost:6379', 'OPTIONS' : { 'DB' : 1 } } }
In MIDDLEWARE_CLASSES add this line:
MIDDLEWARE_CLASSES = ( ... 'musette.middleware.ActiveUserMiddleware', )
In your application must add the profile model do the following. For example your app is ‘main’, in models.py and admin.py add:
# models.py from musette.models import AbstractProfile class Profile(AbstractProfile): # This is in case you need to extend the profile model. If not use 'pass' location = models.CharField("Label name", max_length=200, null=True, blank=True) company = models.CharField("Label name", max_length=150, null=True, blank=True) # admin.py from .models import Profile admin.site.register(Profile) # If you need to extend so, you will create template profile.html indide your app and add this # templates/main/profile.html <h4>Location</h4> <div class="panel panel-default"> <div class="panel-body"> {{ profile.location|safe }} </div> </div> <h4>Company</h4> <div class="panel panel-default"> <div class="panel-body"> {{ profile.company|safe }} </div> </div>
Execute command migrate:
python manage.py makemigrations python manage.py migrate python manage.py makemigrations musette python manage.py migrate musette
If you need to enable the forum in spanish.
Config variables to send email and variable EMAIL_MUSETTE with email from in settings.py.
How to use?
Login in django admin and start to insert categories necessary. Example:
The field position is for indicate the order of the categories.
Insert the forum necessary: Example:
Field more importants:
Position: The field position is for indicate the order of the forums in the categories.
Topics count: Total forum topics.
Check topics: If you need to review the topics by a moderator.
Make sure that each user registration exist in the profile table. Execute in the terminal:
python manage.py runserver
In other terminal execute this command for run server tornado for web sockets:
python manage.py musette_run_server_ws
Visit 127.0.0.1:8000/forums you should see the categories and forums.
Roadmap
Roadmap with content of the next versions of django-musette.
Contribute
Fork this repo and install it
Follow PEP8, Style Guide for Python Code
Write code
Write unit test
Send pull request
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.