1. magik cypress
  2. django-mailreactor

Commits

magik cypress  committed 45cf406

Import first version

  • Participants
  • Branches default
  • Tags v0.4.0

Comments (0)

Files changed (351)

File couchdb-requirements.txt

View file
+#########################################################################
+### this pip requirements file is kept to the bare minimum (django)
+### 
+### uncomment or add your own packages here to have them installed easily
+### with pip:
+###
+### pip -E /path/to/venv/ install -r pip_requirements.txt
+###
+#########################################################################
+
+# Django latest STABLE version
+#-e git+https://github.com/django/django.git#egg=django
+django
+simplejson
+
+# http://couchdbkit.org/docs/django-extension.html
+restkit 
+http-parser 
+couchdbkit
+django_couchdb_utils
+
+# thumbnail creation
+sorl-thumbnail
+redis
+
+# various packages that may be usefull
+# gunicorn

File mailreactor/__init__.py

Empty file added.

File mailreactor/__init__.pyc

Binary file added.

File mailreactor/context_processors.py

View file
+from django.conf import settings
+
+def auth(request):
+    if hasattr(request, 'user'):
+        return {'user': request.user}
+    return {}
+
+def site_info(context):
+    title = getattr(settings, 'SITE_INFO_TITLE', 'Django Mail Reactor')
+    description = getattr(settings, 'SITE_INFO_DESC', 'Django Mail Reactor')
+    domainname = getattr(settings, 'DOMAINE_NAME', 'http://127.0.0.1:8000/') # end slash please ... thanks!
+    return {
+        'SITE_INFO_TITLE': title,
+        'SITE_INFO_DESC': description,
+        'DOMAINE_NAME': domainname,
+    }

File mailreactor/context_processors.pyc

Binary file added.

File mailreactor/templates/base.html

View file
+{% load i18n %}
+<!DOCTYPE html>
+<html lang="fr-FR">
+<head>
+    <meta charset="utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
+    <meta name="author" content="Magik Cypress" />
+    <meta name="country" content="FR" />
+    <meta name="language" content="fr-FR" />    
+         
+    <title>{% block title %}{% endblock %} | {{ SITE_INFO_TITLE }}</title>
+    {% block css %}
+        <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/bootstrap/css/bootstrap.css" />
+        <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/bootstrap/css/bootstrap-responsive.css">
+        <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/bootstrap/css/reste.css" />
+    {% endblock css %}
+    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+    <!--[if lt IE 9]>
+      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->       
+    
+    <!-- Le fav and touch icons -->
+    <link rel="shortcut icon" type="image/x-icon" href="{{ MEDIA_URL }}images/ico/favicon.ico">
+    {% block extrahead %}{% endblock extrahead %}
+</head>
+
+<body data-spy="scroll" data-target=".subnav" data-offset="50">
+
+    <div class="navbar navbar-fixed-top">
+      <div class="navbar-inner">
+        <div class="container">
+          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+          </a>
+          <a class="brand" href="/">{{ SITE_INFO_TITLE }} &hearts;</a>
+          <div class="nav-collapse">
+            <ul class="nav">
+               <li><a href="/admin/">{% trans "More ..." %}</a></li>
+            </ul>
+
+            {% if user.is_authenticated %}
+            <ul class="nav pull-right">
+                <li class="dropdown" id="menu1">
+                <a href="#menu1" class="dropdown-toggle"
+                              data-toggle="dropdown"> 
+                        {% if user.get_full_name %}
+                            <b>{{ user.get_full_name }}</b>
+                        {% else %}
+                            <b>{{ user.email }}</b>
+                        {% endif %}
+                        <b class="caret"></b>
+                      </a>
+                      <ul class="dropdown-menu">
+                        <li><a href="/accounts/logout/"><i class="icon-off"></i>{% trans "Log out" %}</a></li>
+                      </ul>
+              </li>
+              {% endif %} 
+              {% if user.is_authenticated and user.is_superuser %}
+              <li class="dropdown" id="menu2">
+              <a href="#menu2" class="dropdown-toggle"
+                     data-toggle="dropdown">{% trans "Admin superuser" %}<b class="caret"></b></a>
+                      <ul class="dropdown-menu">
+                        <li><a href="/admin/"><i class="icon-cog"></i>{% trans "Admin" %}</a></li>
+                        <li><a href="/privacy/"><i class="icon-info-sign"></i>{% trans "About" %}</a></li>
+                      </ul>
+            </li>
+            </ul>
+            {% endif %}
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <div class="container">
+
+      <h1 class="maintitle hide">{{ SITE_INFO_TITLE }}</h1>
+
+                {% if messages %}
+                <div id="message-action">
+                <script type="text/javascript">
+                $(document).ready(function(){
+                  $(".messages").delay(3000).fadeOut('slow');
+                });
+                </script>
+                <ul class="messages">
+                    {% for message in messages %}
+                    <li {% if message.tags %} class="alert-message {{ message.tags }} fade in" data-alert="alert" {% endif %}>
+                    <a class="close" href="#">&times;</a>
+                    {{ message }}</li>
+                    {% endfor %}
+                </ul>
+                </div>
+                {% endif %}
+
+                {% block content %}{% endblock content %}
+
+    </div>
+
+        <footer>
+            <div class="container">
+            {% if not user.is_authenticated %}
+                <div class="login">
+                <p><a class="btn btn-primary" href="/accounts/login/">{% trans "Log in" %}</a></p>
+                </div>
+                <div class="login">
+                <p><a class="btn" href="/accounts/register/">{% trans "Register" %}</a></p>
+                </div> 
+            {% else %}
+                <div class="login">
+                <p><a class="btn" href="/accounts/logout/">{% trans "Log out" %}</a></p>
+                </div>
+            {% endif %}
+            <div class="foot">
+                <a href="/privacy/">{% trans "Privacy Policy" %}</a>
+            </div>
+            </div>
+        </footer> <!-- /footer -->
+
+
+    <script type="text/javascript" src='{{ MEDIA_URL }}css/bootstrap/js/jquery.js'></script>     
+    <script type="text/javascript" src='{{ MEDIA_URL }}css/bootstrap/js/bootstrap-dropdown.js'></script>    
+    <script type="text/javascript" src='{{ MEDIA_URL }}css/bootstrap/js/bootstrap-collapse.js'></script>    
+    <script type="text/javascript" src='{{ MEDIA_URL }}css/bootstrap/js/bootstrap-scrollspy.js'></script>    
+    <script type="text/javascript" src='{{ MEDIA_URL }}css/bootstrap/js/bootstrap-alert.js'></script> 
+    <script type="text/javascript" src='{{ MEDIA_URL }}css/bootstrap/js/bootstrap-modal.js'></script> 
+    <script type="text/javascript" src='{{ MEDIA_URL }}css/bootstrap/js/bootstrap-tooltip.js'></script>
+    <script type="text/javascript" src='{{ MEDIA_URL }}css/bootstrap/js/bootstrap-popover.js'></script> 
+
+    <!-- IE still hasn't joined the modern world, so let's stub the console.log method -->
+    <script>
+        if (typeof console == 'undefined') {
+            var console = {
+                log: function() {}
+            };
+        }
+    </script>
+
+</body>
+</html>

File mailreactor/templates/mailreactor/admin/dashboard.html

View file
+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Admin" %}{% endblock %}
+
+{% block content %}
+<h2>{% trans "Enjoy" %}</h2>
+
+<h3>{% trans "More ..." %}</h3>
+
+<header class="jumbotron subhead" id="overview">
+      <div class="subnav">
+         <ul class="nav nav-pills">
+             {% for entry in entries %}
+             {% if not entry.static_page %}
+                 <li><a href="#_{{ entry.slug }}"><i class="icon-map-marker"></i>{{ entry.title|safe }}</a></li>
+             {% endif %}
+             {% endfor %}
+                <li><a href="#_list_picture"><i class="icon-picture"></i>{% trans "List" %} {% trans "picture" %}</a></li>
+                <li><a href="#_add_picture"><i class="icon-pencil"></i>{% trans "Add" %} {% trans "picture" %}</a></li>
+        </ul>
+      </div>
+</header>
+
+<section id="entry">
+
+    <div class="page-header">
+        <h1>title</h1>
+    </div>
+
+    {{ email }}
+    {% for mail in email %} 
+        <h2>{{ mail.received }}</h2>
+    {% endfor %}
+</section>
+
+{% endblock %}

File mailreactor/templates/mailreactor/index.html

View file
+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Home page - " %} {{ SITE_INFO_TITLE }}{% endblock %}
+
+{% block content %}
+
+<div class="hero-unit">
+<span class="typeapply">
+    <div align="center">{{ SITE_INFO_TITLE }}<br /><small>Magik Cypress</small></div></span>
+</div>
+
+{% if user.is_authenticated %}
+<div class="post-info">
+    <section>
+    <h1>{% trans "More ..." %}</h1>
+    <p>{% trans "If you want to happy ! Register on this service for more information" %}</p>
+    </section>
+{% endif %} 
+
+{% endblock %}  

File mailreactor/templates/mailreactor/privacy.html

View file
+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Privacy Policy" %}{% endblock %}
+
+{% block content %}
+
+<h2>{% trans "Privacy Policy" %}</h2>
+
+
+<p>If you require any more information or have any questions about our privacy policy, please feel free to contact us.</p>
+
+<p>At zouzzzz.info, the privacy of visitors is important to us. This privacy policy attempts to outline the types of personal information is received, collected and used by curiousconcept.com.</p>
+
+<h2>Log Files</h2>
+
+<p>Like most other sites, zouzzzz.info makes use of log files. The information inside the log files includes internet protocol (IP) addresses, type of browser, Internet Service Provider (ISP), date/time stamp, referring/exit pages.</p>
+
+<p>This information is used to assit in the building and maintenance of zouzzzz.info. For instance, taking the site down for maintenace, when the log shows that few people should be affected.</p>
+
+<p>IP addresses, and other such information are not linked to any information that is personally identifiable.</p>
+
+<h2>Cookies and Web Beacons</h2>
+
+<p>While zouzzzz.info does not set any cookies. Web Beacons is not used, no distribution of your data. </p>
+
+<p>If you wish to disable cookies, you may do so through your individual browser options. More detailed information about cookie management with specific web browsers can be found at the browsers respective websites.</p>
+
+<h2>Search IP information</h2>
+
+<p>While information submitted to the Search IP form is not collected by zouzzzz.info, Search IP URL's may be recorded in the logs.</p>
+
+{% endblock %}  

File mailreactor/templates/registration/activate.html

View file
+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Register" %}{% endblock %}
+
+{% block content %}
+<h2>{% trans "Register" %}</h2>
+
+<p>{% trans "Thank you for putting your real name so that you identify." %}</p>
+
+<form action="" method="post">
+    {% csrf_token %}
+        <table>
+        {{ form }}
+        <tr>
+            <th></th><td><input type="submit" value="{% trans "Register" %}" class="btn btn-primary" /></td>
+    </table>
+</form>
+
+<script type="text/javascript">
+        $(document).ready(function() {
+            $("input:password#id_password").nakedPassword({path: "{{ MEDIA_URL }}/js/nakedpassword/images/", sex: "f"});
+        });
+</script>
+<script type="text/javascript" charset="utf-8" src='{{ MEDIA_URL }}/js/nakedpassword/javascripts/naked_password-0.2.4.min.js'></script> 
+{% endblock %}

File mailreactor/templates/registration/activation_complete.html

View file
+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Activation is complete " %}{% endblock %}
+
+{% block content %}
+
+<h2>{% trans "Activation is complete" %}</h2>
+
+<p>{% trans "Thank you for being registered, your registration is complete." %}</p>
+
+{% endblock %}

File mailreactor/templates/registration/activation_email.txt

View file
+Hello,
+
+Someone has requested to register for account. Click on the link below to access on your account.
+
+{{ site }}/accounts/activate/{{ activation_key }}/
+
+If this doesn't work, please copy-paste the following link to your browser.
+
+If you didn't want to register, just ignore this email.

File mailreactor/templates/registration/activation_email_subject.txt

View file
+[{{ site }}] Activate you registration

File mailreactor/templates/registration/login.html

View file
+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Log In" %}{% endblock %}
+
+{% block content %}
+<h2>{% trans "Log In" %}</h2>
+<div class="clear"></div>
+<form action="" method="post">
+    {% csrf_token %}
+        <table>
+        {{ form }}
+        <tr>
+            <th></th><td><input type="submit" value="{% trans "Log in" %}" class="btn btn-primary" /></td>
+    </table>
+    <input type="hidden" id="next" name="next" value="{{ next }}" />
+</form>
+<div align="center"><a href="/accounts/password/reset/" title="{% trans "Reset password" %}">{% trans "Reset password" %}</a></div>
+{% endblock %}

File mailreactor/templates/registration/logout.html

View file
+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Log out" %}{% endblock %}
+
+{% block content %}
+
+<h2>{% trans "Log out" %}</h2>
+
+<p>{% trans "Connection is closed." %}</p>
+
+<p>{% trans "Have a nice day." %}</p>
+{% endblock %}

File mailreactor/templates/registration/password_change_done.html

View file
+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Change password is done" %}{% endblock %}
+
+{% block content %}
+
+<h2>{% trans "Change password is done" %}</h2>
+
+<p>{% trans "Your password is changed." %}</p>
+
+{% endblock %}

File mailreactor/templates/registration/password_change_form.html

View file
+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Reset password" %}{% endblock %}
+
+{% block content %}
+<h2>{% trans "Reset password" %}</h2>
+<div class="clear"></div>
+<form action="" method="post">
+    {% csrf_token %}
+        <table>
+        {{ form }}
+        <tr>
+            <th></th><td><input type="submit" value="{% trans "Reset password" %}" class="btn btn-primary" /></td>
+    </table>
+</form>
+{% endblock %}

File mailreactor/templates/registration/password_reset_form.html

View file
+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Reset password" %}{% endblock %}
+
+{% block content %}
+<h2>{% trans "Reset password" %}</h2>
+<div class="clear"></div>
+<form action="" method="post">
+    {% csrf_token %}
+        <table>
+        {{ form }}
+        <tr>
+            <th></th><td><input type="submit" value="{% trans "Reset password" %}" class="btn btn-primary" /></td>
+    </table>
+</form>
+{% endblock %}

File mailreactor/templates/registration/registration_closed.html

View file
+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Registration close" %}{% endblock %}
+
+{% block content %}
+
+<h2>{% trans "Registration close" %}</h2>
+
+<p>{% trans "Sorry registration on this service is not possible for the moment." %}</p>
+
+<p>{% trans "We invite you to register later." %}</p>
+{% endblock %}

File mailreactor/templates/registration/registration_complete.html

View file
+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Active your Registration" %}{% endblock %}
+
+{% block content %}
+
+<h2>{% trans "Active your Registration" %}</h2>
+
+<p>{% trans "Thank you for being registered, we sent an email to confirm registration. You will find the information in this email to complete your registration." %}</p>
+
+<p>{% trans "If you can not find our message in the inbox of your email software, looks in your spambox." %}</p>
+{% endblock %}

File mailreactor/templates/registration/registration_form.html

View file
+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Register" %}{% endblock %}
+
+{% block content %}
+<h2>{% trans "Register" %}</h2>
+
+<p>{% trans "Thank you for putting your real name so that you identify." %}</p>
+
+<form action="" method="post">
+    {% csrf_token %}
+        <table>
+        {{ form }}
+        <tr>
+            <th></th><td><input type="submit" value="{% trans "Register" %}" class="btn btn-primary" /></td>
+    </table>
+</form>
+
+<script type="text/javascript">
+        $(document).ready(function() {
+            $("input:password#id_password1").nakedPassword({path: "{{ MEDIA_URL }}js/nakedpassword/images/", sex: "f"});
+            $("input:password#id_password2").nakedPassword({path: "{{ MEDIA_URL }}js/nakedpassword/images/", sex: "m"});
+        });
+</script>
+<script type="text/javascript" charset="utf-8" src='{{ MEDIA_URL }}js/nakedpassword/javascripts/naked_password-0.2.4.min.js'></script> 
+{% endblock %}

File mailreactor/urls.py

View file
+from django.conf.urls.defaults import patterns, include, url, handler404
+from django.conf import settings
+from django.contrib import admin
+from django.conf.urls.defaults import *
+from django.contrib.auth.views import logout
+from django.views.generic.simple import direct_to_template, redirect_to
+from django.views.decorators.cache import cache_page
+
+from mailreactor.views.core import (index)
+from mailreactor.views.admin import (dashboard)
+
+# feeds = {
+#     'rss': RssFeed,
+#     'atom': AtomFeed,
+# }
+
+# use our own handler500 (return 503 instead)
+handler500 = 'utils.handlers.handler500'
+handler404 = 'utils.handlers.handler404'
+
+urlpatterns = patterns('',
+    url('^$', index, name='start'),  
+    url('^privacy/$', direct_to_template, {'template': 'mailreactor/privacy.html'}),
+
+    url('^admin/$', dashboard, name='admin'),
+
+    url(r'^accounts/', include('django_couchdb_utils.registration.backends.default.urls')),
+
+    url(r'^i18n/', include('django.conf.urls.i18n')),
+    # url(r'^robots.txt$', 'mailreactor.views.core.robots'),
+)
+

File mailreactor/urls.pyc

Binary file added.

File mailreactor/version.py

View file
+# -*- coding: utf-8 -
+#
+# This file is part of lepublicateur released under the MIT license. 
+# See the NOTICE for more information.
+
+version_info = (0, 4, 0)
+__version__ =  ".".join(map(str, version_info))

File mailreactor/version.pyc

Binary file added.

File mailreactor/views/__init__.py

Empty file added.

File mailreactor/views/__init__.pyc

Binary file added.

File mailreactor/views/admin.py

View file
+from django.http import (Http404, HttpResponseRedirect, HttpResponseNotFound,
+                        HttpResponse)
+from django.core.urlresolvers import reverse
+from django.conf import settings
+from django.contrib import messages
+from django.shortcuts import render_to_response
+from django.core.context_processors import csrf
+from django.views.decorators.csrf import csrf_protect
+from django.template import Context, RequestContext
+from django.template.loader import get_template
+from datetime import datetime, date, timedelta
+from django_couchdb_utils.auth.models import User
+
+from mailreactor.views.utils import read_mailbox
+
+from django.utils.translation import gettext_lazy as _
+
+def _lookup_template(name):
+        return 'mailreactor/admin/%s.html' % name
+
+def dashboard(request):
+
+    context = {
+        'email': read_mailbox()
+    }
+    print context
+    return render_to_response(_lookup_template('dashboard'), context,
+                              context_instance=RequestContext(request))

File mailreactor/views/admin.pyc

Binary file added.

File mailreactor/views/core.py

View file
+from django.http import (Http404, HttpResponseRedirect, HttpResponseNotFound,
+                        HttpResponse)
+from django.core.urlresolvers import reverse
+from django.conf import settings
+from django.contrib import messages
+from django.shortcuts import render_to_response
+from django.core.context_processors import csrf
+from django.views.decorators.csrf import csrf_protect
+from django.template import Context, RequestContext
+from django.template.loader import get_template
+from datetime import datetime, date, timedelta
+from django_couchdb_utils.auth.models import User
+
+from django.utils.translation import gettext_lazy as _
+
+def _lookup_template(name):
+        return 'mailreactor/%s.html' % name
+
+def index(request):
+    context = {
+    }
+    return render_to_response(_lookup_template('index'), context,
+                              context_instance=RequestContext(request))

File mailreactor/views/core.pyc

Binary file added.

File mailreactor/views/utils.py

View file
+import mailbox
+from django.core import serializers
+import json
+
+def read_mailbox():
+    email = {}
+    mb = mailbox.Maildir('~/Mails/INBOX')
+    while True:
+        msg = mb.next()
+        if not msg:
+            break
+        for k, v in msg.items():
+            # value = k +':'+ v
+            value = '{"%s":%s}' % (k, v)
+            email.append(value)
+        #body = msg.fp.read()
+        #print len(body), "bytes in body"
+
+    return email

File mailreactor/views/utils.pyc

Binary file added.

File plugins/__init__.py

Empty file added.

File plugins/__init__.pyc

Binary file added.

File plugins/deploy/gunicorn.conf.py

View file
+backlog = 2048
+bind = "127.0.0.1:29000"
+debug = False
+workers = 2
+logfile = "/etc/gunicorn/sites/mydomain/myproject/logs/gunicorn.log"
+loglevel = "info"

File plugins/deploy/nginx.conf

View file
+server {
+  listen 80;
+  server_name  mydomain.com www.mydomain.com;
+  rewrite ^(.*) http://blog.mydomain.com permanent;
+}
+
+server {
+  listen 80;
+  server_name heping.mydomain.com;
+
+  access_log /var/log/mydomain.com.access.log;
+  error_log /var/log/mydomain.com.error.log;
+
+  location /static {
+    root /etc/gunicorn/sites/mydomain.com/heping/plugins;
+  }
+
+  location / {
+    proxy_pass http://127.0.0.1:29000;
+  }
+}
+

File plugins/local_settings.py

View file
+from mailreactor.version import __version__
+
+# For testing
+DATABASES = { 
+    'default': { 
+        'ENGINE': 'sqlite3', 
+        'NAME': 'mailreactor.db', 
+    } 
+} 
+
+COUCHDB_DATABASES = (
+    ('mailreactor', 'http://admin:sekrit@127.0.0.1:5984/mailreactor'),
+    ('django_couchdb_utils_auth',     'http://admin:sekrit@127.0.0.1:5984/authdb'),
+    ('django_couchdb_utils_sessions', 'http://admin:sekrit@127.0.0.1:5984/sessionsdb'),
+    ('django_couchdb_utils_cache',    'http://admin:sekrit@127.0.0.1:5984/cachedb'),     
+ )
+
+import os
+PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
+
+DOMAINNAME = 'domainename'
+
+API_KONKR_KEY = 'KONKR_KEY'
+USER_AGENT = 'mailreactor/%s' % __version__
+
+EMAIL_HOST = 'SMTP.DOMAINE.COM'
+EMAIL_HOST_USER = 'DESCRI@DOMAINE.COM'
+EMAIL_HOST_PASSWORD = 'PASSWORD'
+EMAIL_PORT = 'PORT'
+EMAIL_USE_TLS = True
+DEFAULT_FROM_EMAIL = "DESCRI@DOMAINE.COM"
+SERVER_EMAIL = "DESCRI@DOMAINE.COM"

File plugins/local_settings.pyc

Binary file added.

File plugins/mailreactor

View file
+../mailreactor

File plugins/manage.py

View file
+#!/usr/bin/env python
+from django.core.management import execute_manager
+import imp
+try:
+    imp.find_module('settings') # Assumed to be in the same directory.
+except ImportError:
+    import sys
+    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
+    sys.exit(1)
+
+import settings
+
+if __name__ == "__main__":
+    execute_manager(settings)

File plugins/settings.py

View file
+"""CouchDB settings"""
+
+# Django settings for simpletemplate project.
+
+import os
+from local_settings import *
+from django.utils.translation import gettext_lazy as _
+
+ADMINS = (
+    ('Magik', 'magik.cypress@gmail.com'),
+)
+
+MANAGERS = ADMINS
+
+#SITE_ID = 1
+
+TIME_ZONE = 'Europe/Paris'
+LANGUAGE_CODE = 'fr-fr'
+USE_I18N = True
+USE_L10N = True
+gettext = lambda s: s
+LANGUAGES = (
+    ('fr', gettext(u'French')),
+    ('en', gettext(u'English')),
+)
+DEFAULT_LANGUAGE = 2
+
+SECRET_KEY = '_4meh18-_z$dajpjug$s9obp7sxsugwgaxkv$p1uxckhkiyshv'
+
+ROOT_URLCONF = 'urls'
+
+TEMPLATE_DIRS = (
+    os.path.join(PROJECT_PATH, 'templates'),
+)
+
+MEDIA_ROOT = os.path.join(PROJECT_PATH, 'static')
+MEDIA_URL = '/static/'
+
+LOGIN_URL = '/accounts/login/'
+LOGIN_REDIRECT_URL = '/admin/'
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+    ('django.template.loaders.cached.Loader', (
+        'django.template.loaders.filesystem.Loader',
+        'django.template.loaders.app_directories.Loader',
+    )),
+)
+
+TEMPLATE_CONTEXT_PROCESSORS = (
+    'django.core.context_processors.media',
+    'django.core.context_processors.i18n',
+    'django.core.context_processors.request',
+    'mailreactor.context_processors.auth',
+    'mailreactor.context_processors.site_info',
+)
+
+MIDDLEWARE_CLASSES = (
+    'django.middleware.common.CommonMiddleware',
+    'django.middleware.csrf.CsrfViewMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.messages.middleware.MessageMiddleware',
+    'django.middleware.locale.LocaleMiddleware',    
+)
+
+AUTHENTICATION_BACKENDS = (
+    'django_couchdb_utils.auth.backends.CouchDBAuthBackend',
+)
+
+INSTALLED_APPS = (
+    'couchdbkit.ext.django',  
+    'django_couchdb_utils.auth',
+    'django_couchdb_utils.sessions',
+    'django_couchdb_utils.registration',
+    'sorl.thumbnail',
+    'mailreactor',
+)
+
+CACHES = {
+    'default': {
+        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
+        'LOCATION': '/tmp/django_cache',
+    }
+}
+
+FILE_UPLOAD_HANDLERS = (
+    'django.core.files.uploadhandler.MemoryFileUploadHandler',
+    'django.core.files.uploadhandler.TemporaryFileUploadHandler',
+)
+
+THUMBNAIL_KVSTORE = (
+    'sorl.thumbnail.kvstores.redis_kvstore.KVStore'
+    # 'sorl.thumbnail.kvstores.cached_db_kvstore.KVStore'
+)
+
+THUMBNAIL_ENGINE = (
+    'sorl.thumbnail.engines.pil_engine.Engine'
+)
+
+THUMBNAIL_QUALITY = '90'
+THUMBNAIL_DEBUG = True
+
+NUM_PICTURES_PER_PAGE = 12
+
+SESSION_ENGINE = 'django_couchdb_utils.sessions.couchdb'
+
+#TEST_RUNNER = 'couchdbkit.ext.django.testrunner.CouchDbKitTestSuiteRunner'
+
+ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window; you may, of course, use a different value.
+REGISTRATION_OPEN = True
+
+MARKUP_LANGUAGE = 'markdown'
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+TASK_UPLOAD_FILE_TYPES = ['png', 'jpeg','jpg','pdf','gif'] 
+TASK_UPLOAD_FILE_MAX_SIZE = "5242880"

File plugins/settings.pyc

Binary file added.

File plugins/static/css/bootstrap/.git/HEAD

View file
+ref: refs/heads/master

File plugins/static/css/bootstrap/.git/config

View file
+[core]
+	repositoryformatversion = 0
+	filemode = true
+	bare = false
+	logallrefupdates = true
+[remote "origin"]
+	fetch = +refs/heads/*:refs/remotes/origin/*
+	url = https://github.com/twitter/bootstrap.git
+[branch "master"]
+	remote = origin
+	merge = refs/heads/master

File plugins/static/css/bootstrap/.git/description

View file
+Unnamed repository; edit this file 'description' to name the repository.

File plugins/static/css/bootstrap/.git/hooks/applypatch-msg.sample

View file
+#!/bin/sh
+#
+# An example hook script to check the commit log message taken by
+# applypatch from an e-mail message.
+#
+# The hook should exit with non-zero status after issuing an
+# appropriate message if it wants to stop the commit.  The hook is
+# allowed to edit the commit message file.
+#
+# To enable this hook, rename this file to "applypatch-msg".
+
+. git-sh-setup
+test -x "$GIT_DIR/hooks/commit-msg" &&
+	exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
+:

File plugins/static/css/bootstrap/.git/hooks/commit-msg.sample

View file
+#!/bin/sh
+#
+# An example hook script to check the commit log message.
+# Called by "git commit" with one argument, the name of the file
+# that has the commit message.  The hook should exit with non-zero
+# status after issuing an appropriate message if it wants to stop the
+# commit.  The hook is allowed to edit the commit message file.
+#
+# To enable this hook, rename this file to "commit-msg".
+
+# Uncomment the below to add a Signed-off-by line to the message.
+# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
+# hook is more suited to it.
+#
+# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
+# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
+
+# This example catches duplicate Signed-off-by lines.
+
+test "" = "$(grep '^Signed-off-by: ' "$1" |
+	 sort | uniq -c | sed -e '/^[ 	]*1[ 	]/d')" || {
+	echo >&2 Duplicate Signed-off-by lines.
+	exit 1
+}

File plugins/static/css/bootstrap/.git/hooks/post-commit.sample

View file
+#!/bin/sh
+#
+# An example hook script that is called after a successful
+# commit is made.
+#
+# To enable this hook, rename this file to "post-commit".
+
+: Nothing

File plugins/static/css/bootstrap/.git/hooks/post-receive.sample

View file
+#!/bin/sh
+#
+# An example hook script for the "post-receive" event.
+#
+# The "post-receive" script is run after receive-pack has accepted a pack
+# and the repository has been updated.  It is passed arguments in through
+# stdin in the form
+#  <oldrev> <newrev> <refname>
+# For example:
+#  aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
+#
+# see contrib/hooks/ for a sample, or uncomment the next line and
+# rename the file to "post-receive".
+
+#. /usr/share/doc/git-core/contrib/hooks/post-receive-email

File plugins/static/css/bootstrap/.git/hooks/post-update.sample

View file
+#!/bin/sh
+#
+# An example hook script to prepare a packed repository for use over
+# dumb transports.
+#
+# To enable this hook, rename this file to "post-update".
+
+exec git update-server-info

File plugins/static/css/bootstrap/.git/hooks/pre-applypatch.sample

View file
+#!/bin/sh
+#
+# An example hook script to verify what is about to be committed
+# by applypatch from an e-mail message.
+#
+# The hook should exit with non-zero status after issuing an
+# appropriate message if it wants to stop the commit.
+#
+# To enable this hook, rename this file to "pre-applypatch".
+
+. git-sh-setup
+test -x "$GIT_DIR/hooks/pre-commit" &&
+	exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
+:

File plugins/static/css/bootstrap/.git/hooks/pre-commit.sample

View file
+#!/bin/sh
+#
+# An example hook script to verify what is about to be committed.
+# Called by "git commit" with no arguments.  The hook should
+# exit with non-zero status after issuing an appropriate message if
+# it wants to stop the commit.
+#
+# To enable this hook, rename this file to "pre-commit".
+
+if git rev-parse --verify HEAD >/dev/null 2>&1
+then
+	against=HEAD
+else
+	# Initial commit: diff against an empty tree object
+	against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+fi
+
+# If you want to allow non-ascii filenames set this variable to true.
+allownonascii=$(git config hooks.allownonascii)
+
+# Cross platform projects tend to avoid non-ascii filenames; prevent
+# them from being added to the repository. We exploit the fact that the
+# printable range starts at the space character and ends with tilde.
+if [ "$allownonascii" != "true" ] &&
+	# Note that the use of brackets around a tr range is ok here, (it's
+	# even required, for portability to Solaris 10's /usr/bin/tr), since
+	# the square bracket bytes happen to fall in the designated range.
+	test "$(git diff --cached --name-only --diff-filter=A -z $against |
+	  LC_ALL=C tr -d '[ -~]\0')"
+then
+	echo "Error: Attempt to add a non-ascii file name."
+	echo
+	echo "This can cause problems if you want to work"
+	echo "with people on other platforms."
+	echo
+	echo "To be portable it is advisable to rename the file ..."
+	echo
+	echo "If you know what you are doing you can disable this"
+	echo "check using:"
+	echo
+	echo "  git config hooks.allownonascii true"
+	echo
+	exit 1
+fi
+
+exec git diff-index --check --cached $against --

File plugins/static/css/bootstrap/.git/hooks/pre-rebase.sample

View file
+#!/bin/sh
+#
+# Copyright (c) 2006, 2008 Junio C Hamano
+#
+# The "pre-rebase" hook is run just before "git rebase" starts doing
+# its job, and can prevent the command from running by exiting with
+# non-zero status.
+#
+# The hook is called with the following parameters:
+#
+# $1 -- the upstream the series was forked from.
+# $2 -- the branch being rebased (or empty when rebasing the current branch).
+#
+# This sample shows how to prevent topic branches that are already
+# merged to 'next' branch from getting rebased, because allowing it
+# would result in rebasing already published history.
+
+publish=next
+basebranch="$1"
+if test "$#" = 2
+then
+	topic="refs/heads/$2"
+else
+	topic=`git symbolic-ref HEAD` ||
+	exit 0 ;# we do not interrupt rebasing detached HEAD
+fi
+
+case "$topic" in
+refs/heads/??/*)
+	;;
+*)
+	exit 0 ;# we do not interrupt others.
+	;;
+esac
+
+# Now we are dealing with a topic branch being rebased
+# on top of master.  Is it OK to rebase it?
+
+# Does the topic really exist?
+git show-ref -q "$topic" || {
+	echo >&2 "No such branch $topic"
+	exit 1
+}
+
+# Is topic fully merged to master?
+not_in_master=`git rev-list --pretty=oneline ^master "$topic"`
+if test -z "$not_in_master"
+then
+	echo >&2 "$topic is fully merged to master; better remove it."
+	exit 1 ;# we could allow it, but there is no point.
+fi
+
+# Is topic ever merged to next?  If so you should not be rebasing it.
+only_next_1=`git rev-list ^master "^$topic" ${publish} | sort`
+only_next_2=`git rev-list ^master           ${publish} | sort`
+if test "$only_next_1" = "$only_next_2"
+then
+	not_in_topic=`git rev-list "^$topic" master`
+	if test -z "$not_in_topic"
+	then
+		echo >&2 "$topic is already up-to-date with master"
+		exit 1 ;# we could allow it, but there is no point.
+	else
+		exit 0
+	fi
+else
+	not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"`
+	/usr/bin/perl -e '
+		my $topic = $ARGV[0];
+		my $msg = "* $topic has commits already merged to public branch:\n";
+		my (%not_in_next) = map {
+			/^([0-9a-f]+) /;
+			($1 => 1);
+		} split(/\n/, $ARGV[1]);
+		for my $elem (map {
+				/^([0-9a-f]+) (.*)$/;
+				[$1 => $2];
+			} split(/\n/, $ARGV[2])) {
+			if (!exists $not_in_next{$elem->[0]}) {
+				if ($msg) {
+					print STDERR $msg;
+					undef $msg;
+				}
+				print STDERR " $elem->[1]\n";
+			}
+		}
+	' "$topic" "$not_in_next" "$not_in_master"
+	exit 1
+fi
+
+exit 0
+
+<<\DOC_END
+################################################################
+
+This sample hook safeguards topic branches that have been
+published from being rewound.
+
+The workflow assumed here is:
+
+ * Once a topic branch forks from "master", "master" is never
+   merged into it again (either directly or indirectly).
+
+ * Once a topic branch is fully cooked and merged into "master",
+   it is deleted.  If you need to build on top of it to correct
+   earlier mistakes, a new topic branch is created by forking at
+   the tip of the "master".  This is not strictly necessary, but
+   it makes it easier to keep your history simple.
+
+ * Whenever you need to test or publish your changes to topic
+   branches, merge them into "next" branch.
+
+The script, being an example, hardcodes the publish branch name
+to be "next", but it is trivial to make it configurable via
+$GIT_DIR/config mechanism.
+
+With this workflow, you would want to know:
+
+(1) ... if a topic branch has ever been merged to "next".  Young
+    topic branches can have stupid mistakes you would rather
+    clean up before publishing, and things that have not been
+    merged into other branches can be easily rebased without
+    affecting other people.  But once it is published, you would
+    not want to rewind it.
+
+(2) ... if a topic branch has been fully merged to "master".
+    Then you can delete it.  More importantly, you should not
+    build on top of it -- other people may already want to
+    change things related to the topic as patches against your
+    "master", so if you need further changes, it is better to
+    fork the topic (perhaps with the same name) afresh from the
+    tip of "master".
+
+Let's look at this example:
+
+		   o---o---o---o---o---o---o---o---o---o "next"
+		  /       /           /           /
+		 /   a---a---b A     /           /
+		/   /               /           /
+	       /   /   c---c---c---c B         /
+	      /   /   /             \         /
+	     /   /   /   b---b C     \       /
+	    /   /   /   /             \     /
+    ---o---o---o---o---o---o---o---o---o---o---o "master"
+
+
+A, B and C are topic branches.
+
+ * A has one fix since it was merged up to "next".
+
+ * B has finished.  It has been fully merged up to "master" and "next",
+   and is ready to be deleted.
+
+ * C has not merged to "next" at all.
+
+We would want to allow C to be rebased, refuse A, and encourage
+B to be deleted.
+
+To compute (1):
+
+	git rev-list ^master ^topic next
+	git rev-list ^master        next
+
+	if these match, topic has not merged in next at all.
+
+To compute (2):
+
+	git rev-list master..topic
+
+	if this is empty, it is fully merged to "master".
+
+DOC_END

File plugins/static/css/bootstrap/.git/hooks/prepare-commit-msg.sample

View file
+#!/bin/sh
+#
+# An example hook script to prepare the commit log message.
+# Called by "git commit" with the name of the file that has the
+# commit message, followed by the description of the commit
+# message's source.  The hook's purpose is to edit the commit
+# message file.  If the hook fails with a non-zero status,
+# the commit is aborted.
+#
+# To enable this hook, rename this file to "prepare-commit-msg".
+
+# This hook includes three examples.  The first comments out the
+# "Conflicts:" part of a merge commit.
+#
+# The second includes the output of "git diff --name-status -r"
+# into the message, just before the "git status" output.  It is
+# commented because it doesn't cope with --amend or with squashed
+# commits.
+#
+# The third example adds a Signed-off-by line to the message, that can
+# still be edited.  This is rarely a good idea.
+
+case "$2,$3" in
+  merge,)
+    /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
+
+# ,|template,)
+#   /usr/bin/perl -i.bak -pe '
+#      print "\n" . `git diff --cached --name-status -r`
+#	 if /^#/ && $first++ == 0' "$1" ;;
+
+  *) ;;
+esac
+
+# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
+# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"

File plugins/static/css/bootstrap/.git/hooks/update.sample

View file
+#!/bin/sh
+#
+# An example hook script to blocks unannotated tags from entering.
+# Called by "git receive-pack" with arguments: refname sha1-old sha1-new
+#
+# To enable this hook, rename this file to "update".
+#
+# Config
+# ------
+# hooks.allowunannotated
+#   This boolean sets whether unannotated tags will be allowed into the
+#   repository.  By default they won't be.
+# hooks.allowdeletetag
+#   This boolean sets whether deleting tags will be allowed in the
+#   repository.  By default they won't be.
+# hooks.allowmodifytag
+#   This boolean sets whether a tag may be modified after creation. By default
+#   it won't be.
+# hooks.allowdeletebranch
+#   This boolean sets whether deleting branches will be allowed in the
+#   repository.  By default they won't be.
+# hooks.denycreatebranch
+#   This boolean sets whether remotely creating branches will be denied
+#   in the repository.  By default this is allowed.
+#
+
+# --- Command line
+refname="$1"
+oldrev="$2"
+newrev="$3"
+
+# --- Safety check
+if [ -z "$GIT_DIR" ]; then
+	echo "Don't run this script from the command line." >&2
+	echo " (if you want, you could supply GIT_DIR then run" >&2
+	echo "  $0 <ref> <oldrev> <newrev>)" >&2
+	exit 1
+fi
+
+if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
+	echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
+	exit 1
+fi
+
+# --- Config
+allowunannotated=$(git config --bool hooks.allowunannotated)
+allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
+denycreatebranch=$(git config --bool hooks.denycreatebranch)
+allowdeletetag=$(git config --bool hooks.allowdeletetag)
+allowmodifytag=$(git config --bool hooks.allowmodifytag)
+
+# check for no description
+projectdesc=$(sed -e '1q' "$GIT_DIR/description")
+case "$projectdesc" in
+"Unnamed repository"* | "")
+	echo "*** Project description file hasn't been set" >&2
+	exit 1
+	;;
+esac
+
+# --- Check types
+# if $newrev is 0000...0000, it's a commit to delete a ref.
+zero="0000000000000000000000000000000000000000"
+if [ "$newrev" = "$zero" ]; then
+	newrev_type=delete
+else
+	newrev_type=$(git cat-file -t $newrev)
+fi
+
+case "$refname","$newrev_type" in
+	refs/tags/*,commit)
+		# un-annotated tag
+		short_refname=${refname##refs/tags/}
+		if [ "$allowunannotated" != "true" ]; then
+			echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
+			echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
+			exit 1
+		fi
+		;;
+	refs/tags/*,delete)
+		# delete tag
+		if [ "$allowdeletetag" != "true" ]; then
+			echo "*** Deleting a tag is not allowed in this repository" >&2
+			exit 1
+		fi
+		;;
+	refs/tags/*,tag)
+		# annotated tag
+		if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1
+		then
+			echo "*** Tag '$refname' already exists." >&2
+			echo "*** Modifying a tag is not allowed in this repository." >&2
+			exit 1
+		fi
+		;;
+	refs/heads/*,commit)
+		# branch
+		if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then
+			echo "*** Creating a branch is not allowed in this repository" >&2
+			exit 1
+		fi
+		;;
+	refs/heads/*,delete)
+		# delete branch
+		if [ "$allowdeletebranch" != "true" ]; then
+			echo "*** Deleting a branch is not allowed in this repository" >&2
+			exit 1
+		fi
+		;;
+	refs/remotes/*,commit)
+		# tracking branch
+		;;
+	refs/remotes/*,delete)
+		# delete tracking branch
+		if [ "$allowdeletebranch" != "true" ]; then
+			echo "*** Deleting a tracking branch is not allowed in this repository" >&2
+			exit 1
+		fi
+		;;
+	*)
+		# Anything else (is there anything else?)
+		echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
+		exit 1
+		;;
+esac
+