Forum for Django framework. This reusable application it is designed to be easily integrated into an existing Django application.
With pip:
pip install django-musette
- Jquery (Version 2.x)
- Bootstrap (Version 3.x) and bootstrap material design (https://fezvrasta.github.io/bootstrap-material-design/)
- Angular.js (Version 1.x)
Add application 'musette' and dependencies to INSTALLED_APPS:
INSTALLED_APPS = ( ... 'log', 'hitcount', 'endless_pagination', 'rest_framework', 'musette', )
Add this urls to file urls.py:
url(r'^' , include('musette.urls')),
And in settings.py add this variable:
SESSION_SAVE_EVERY_REQUEST = True
Configure in the settings.py URL_LOGIN, STATIC and MEDIA root. Something very important is to set the variable CACHES for redis. example:
CACHES = { 'default': { 'BACKEND' : 'redis_cache.RedisCache', 'LOCATION' : 'localhost:6379', 'OPTIONS' : { 'DB' : 1 } } }
Set this variables if differ from the default values:
APP_PROFILE = 'profiles' # Application for your profiles MODEL_PROFILE = 'Profile' # Model for profiles FIELD_PHOTO_PROFILE = "photo" # Field that contains url the profile photo URL_PROFILE = '/profile/' # Url for profile URL_PROFILE_PARAMS = ("username",) # Params of url profile, indicate field user model
Execute command migrate:
python manage.py migrate
The application django-musette need a template base of name base.html. With the following tags:
{% block content %}{% endblock %} {% block extra_css %}{% endblock %} {% block extra_js %}{% endblock %} {% block hitcount_javascript %}{% endblock %}
And add files static css and js (Angular, Jquery, Bootstrap).
If you need to enable the forum in Spanish:
https://github.com/mapeveri/django-musette/blob/master/internationalization.rst
- 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.
Ready!
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.
- Multiple forums ordered by for category.
- Notifications (Still not support sending emails).
- Notifications and comments in real time.
- Count views for forum and topic.
- Infinite scroll for comments of one topic.
- Support of files media for topics.
- Easy integration with other applications Django of your project.
- Pre-moderation of topics.
- Models registered in admin django for administrators.
- Search for topics in a forum.
- Modern design, thank you to Bootstrap material design.
- Avatar.
- Support to English and Spanish language.
- Validation of forms in real time with AngularJs.
- User registration a forum.
- Support to Markdown.
- Support to rss to forums.
- API REST with django-rest-framework.
- Support to topics main in forum.
- Fork this repo and install it
- Follow PEP8, Style Guide for Python Code
- Write code
- Write unit test
- Send pull request