This is a generic Content management system made specifically for the purpose of handling the websites of college fests. It is written in Django and uses basically a Bootstrap based UI.
Install sqlite3 for development
- Windows: Steps : http://www.sqlitetutorial.net/download-install-sqlite/
- Mac OS X: Mac ships with sqlite3 already installed
- Ubuntu/Debian:
sudo apt-get install sqlite3
- Fedora/Red Hat/CentOS:
sudo yum install sqlite
Install pip for python3
- Windows: pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4
- Mac OS (via easy_install):
sudo easy_install pip
- Debian/Ubuntu:
sudo apt-get install python3-pip
- Fedora/CentOS:
sudo yum install python-pip python-wheel
- Setup virtual environment with
pip install virtualenvwrapper-win
- Then create a virtual environment for your project:
mkvirtualenv nameofyourproject
- The virtual environment will be activated automatically and you’ll see “(nameofyourproject)” next to the command prompt to designate that.
- If you start a new command prompt, you’ll need to activate the environment again using:
workon nameofproject
.
- Virtualenv is available on PyPI, we can install it with the pip command:
pip install virtualenv
- Then create a virtual environment for your project:
virtualenv --python=python3 nameofproject
- Log into the virtualenv created:
source nameofproject/bin/activate
- Clone the repository with
git clone [email protected]:ghoshbishakh/festcms.git
- Enter the directory using
cd festcms
- Copy
festcms/settings.py.example
tofestcms/settings.py
- Enter any arbitary key in the
SECRET_KEY
field insettings.py
- To setup mail server, enter the details in email testing section of
settings.py
- Ensure that you have python3 set as default. You can do this by
alias python=python3
- Run
pip install -r requirements.txt
to install all dependencies - Run migrations using
python manage.py migrate
- Run server with
python manage.py runserver
- Ok you are all set! Visit http://localhost:8000 in your browser
- Create a
superuser
account withpython manage.py createsuperuser
, create your credentials. - Go to
http://localhost:8000/admin
and enter your credentials. - Create a new form in the forms section to your desire, by the name feedback and publish it.
- You're done. You can now test the form at
http://localhost:8000/forms/feedback
. - You could check for submissions or make changes to the form via forms section in the admin panel.
- You could create any other form in a similar way.
- Login the admin panel and create entries in the Navbar Entries section as per your requirement.
- Load and use the
navbar
tag if required in any of your custom pages.
- Login the admin panel and click on the Newsletters section.
- Create a new newsletter to your liking and save it.
- Now in the Newsletter section presented, mark the letters to be sent.
- Choose the action Send email from the Actions menu and click Go.
- This sends the marked Newsletters to subscribed users.
- Create HTML(
.html
) and text(.txt
) based templates for mail with the context as per your requirements. - Place both the HTML and text based files in
festflow/templates/email_extras
directory. - Now these templates could be used anywhere within the application by using the
send_mail_template
method ofemail_extras.utils
package. Eg. Suppose we haveexample_mail.html
andexample_mail.txt
as our text based and HTML based templates with some contextctx
, attachmentsatch
and headersheaders
, then we could do the following to use the template system.
from email_extras.utils import send_mail_template
send_mail_template("Subject", 'example_mail', from_address, to_address,
fail_silently=False, attachments=atch, context=ctx, headers=headers)
We use django-email-extras to send template based mails. The email templates should be placed in
festflow/templates/email-extras/
. PGP encrypted mails could also be sent via the django-email-extras module. For more information on how to configure PGP encryption module, please refer here.
We use django-forms-builder for making custom forms available via admin section. A lot of stuff could be configured as mentioned here in
settings.py
.