CMS-like website

Provides a great starting point for using Django with Django-registration, Captcha, Bootstrap, and jQueryUI. Default base template provides a simple starting interface which you can expand on easily.

Provides a good base for a social community of some sort, where registration is available with Captcha along with a theme which most community sites use, a block-based theme.


import os.path
PROJECT_ROOT = os.path.normpath(os.path.dirname(__file__)+'/..')

DEBUG = True

    # ('Your Name', ''),


EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

    'default': {
        'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': '',                      # Or path to database file if using sqlite3.
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.

# Local time zone for this installation. Choices can be found here:
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'America/Winnipeg'

# Language code for this installation. All choices can be found here:


# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/"
MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "", ""
MEDIA_URL = '/m/'

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/"
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')

# URL prefix for static files.
# Example: ""
STATIC_URL = '/s/'

# Additional locations of static files
    os.path.join(PROJECT_ROOT, 'bootstrap'),
    os.path.join(PROJECT_ROOT, 'jquery'),
    os.path.join(PROJECT_ROOT, 'tinymce'),
    os.path.join(PROJECT_ROOT, 'assets'),

# List of finder classes that know how to find static files in
# various locations.
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',

# Make this unique, and don't share it with anybody.

# List of callables that know how to import templates from various sources.
#     'django.template.loaders.eggs.Loader',


    # Uncomment the next line for simple clickjacking protection:
    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',

ROOT_URLCONF = 'project.urls'

# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'project.wsgi.application'

    os.path.join(PROJECT_ROOT, 'templates'),




ADMIN_TOOLS_INDEX_DASHBOARD = 'fluent_dashboard.dashboard.FluentIndexDashboard'
ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'fluent_dashboard.dashboard.FluentAppIndexDashboard'

# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See for
# more details on how to customize your logging configuration.
    'version': 1,
    'disable_existing_loggers': False,
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'filters': ['require_debug_false'],
            'class': 'django.utils.log.AdminEmailHandler'
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
from django.conf.urls import patterns, include, url
from registration.views import activate, register
from django.contrib import admin
from django.views.generic.base import TemplateView
from captcha.forms import RegistrationFormCaptcha

account_urls = patterns('',
    url(r'^activate/complete/$', TemplateView.as_view(template_name='registration/activation_complete.html'), name='registration_activation_complete'),
    url(r'^activate/(?P<activation_key>\w+)/$', activate, {'backend': 'registration.backends.default.DefaultBackend'}, name='registration_activate'),
    url(r'^register/$', register, {'backend': 'registration.backends.default.DefaultBackend', 'form_class':RegistrationFormCaptcha}, name='registration_register'),
    url(r'^register/complete/$', TemplateView.as_view(template_name='registration/registration_complete.html'), name='registration_complete'),
    url(r'^register/closed/$', TemplateView.as_view(template_name='registration/registration_closed.html'), name='registration_disallowed'),
    (r'', include('registration.auth_urls')),

urlpatterns = patterns('',
    url(r'^$', TemplateView.as_view(template_name='base.html')),
    url(r'^accounts/', include(account_urls)),
    url(r'^admin/', include(,
    url(r'^admin_tools/', include('admin_tools.urls')),
{% load url from future %}
<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8">
    <title>Your Site | {% block title %}Home{% endblock %}</title>
    <script src="{{STATIC_URL}}js/jquery-1.8.2.js"></script>
    <script src="{{STATIC_URL}}js/jquery-ui-1.9.1.custom.min.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="{{STATIC_URL}}css/bootstrap.min.css" rel="stylesheet">
    <link href="{{STATIC_URL}}css/cupertino/jquery-ui-1.9.1.custom.min.css" rel="stylesheet">
    <link href="{{STATIC_URL}}css/bootstrap-responsive.min.css" rel="stylesheet">
    body { background-color: #eeeeee; font-size: 10pt; }
    #brand { font-size: 18pt; font-family: courier; }
   .copyright { color: #888888; display: block; text-align: center; }
   .copyright a { color: #555555; }
   {% block css %}{% endblock %}

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src=""></script>
    <script type="text/javascript">
    {% block javascript %}
      {% block jquery %}{% endblock %}
   {% endblock %}
    {% if not debug %}{% include "analytics.html" %}{% endif %}


    <div class="container">
      <div class="row">
        <div class="span3" id="brand">Your Site</div>
      <div class="row">
        <div class="span3">
          <div class="ui-widget">
            <div class="ui-widget-header ui-corner-top"><span class="ui-icon ui-icon-grip-dotted-vertical" style="float:left;"></span>Navigation</div>
            <div class="ui-widget-content ui-corner-bottom"><ul>
            <li><a href="/">Home</a></li>
          {% if not user.is_authenticated %}
          <div class="ui-widget">
            <div class="ui-widget-header ui-corner-top"><span class="ui-icon ui-icon-grip-dotted-vertical" style="float:left;"></span>Login</div>
            <div class="ui-widget-content ui-corner-bottom"><form action="{% url 'auth_login' %}" method="post">{% csrf_token %}
            <b>Username:</b> <input type="text" name="username" id="id_username" /><br/>
            <b>Password:</b> <input type="password" name="password" id="id_password" /><br/>
            <span class="pull-right"><a href="{% url 'registration_register' %}" class="jqbutton">Register</a></span>
            <input type="submit" value="Login" class="jqbutton" /></form></div>
          {% else %}
          <div class="ui-widget">
            <div class="ui-widget-header ui-corner-top"><span class="ui-icon ui-icon-grip-dotted-vertical" style="float:left;"></span>User Panel</div>
            <div class="ui-widget-content ui-corner-bottom">Logged in as <b>{{user.username}}</b><br/><ul>
            <li><a href="{% url 'auth_logout' %}">Sign out</a></li>
          {% if user.is_staff %}
          <div class="ui-widget">
            <div class="ui-widget-header ui-corner-top"><span class="ui-icon ui-icon-grip-dotted-vertical" style="float:left;"></span>Site Administration</div>
            <div class="ui-widget-content ui-corner-bottom"><a href="{% url 'admin:index' %}">Admin Interface</a></div>
          {% endif %}
          {% endif %}
        <div class="span9">
          <div class="ui-widget">
            <div class="ui-widget-header ui-corner-top"><span class="ui-icon ui-icon-grip-dotted-vertical" style="float:left;"></span>{% block heading %}Content{% endblock %}</div>
            <div class="ui-widget-content ui-corner-bottom">{% block content %}Content Block{% endblock %}</div>
    </div> <!-- /container -->
    <div class="copyright">Python Powered | &copy; 2012 Your Site | <a href="">Blog</a> | <a href="#">Contact us</a></div>
Download as ZIP

* ZIP file is automatically generated and some elements such as the SECRET_KEY are regenerated as well.

About Me

My Photo
Names Kevin, hugely into UNIX technologies, not just Linux. I've dabbled with the demons, played with the Sun, and now with the Penguins.

Kevin Veroneau Consulting Services
Do you require the services of a Django contractor? Do you need both a website and hosting services? Perhaps I can help.

This Month

If you like what you read, please consider donating to help with hosting costs, and to fund future books to review.

Python Powered | © 2012-2019 Kevin Veroneau