Commit 3f8f4396 authored by svilayphiou's avatar svilayphiou

Update to Django2.0 → a tour to check bugs due to upgrade is still needed

parent 2b0bf092
......@@ -37,26 +37,25 @@ Infrastructures entrelacées, an exhibition by the collective Artivistic at SKOL
## Installation instructions
Requires Django 1.5
Requires Django 2.0
First create and install a virtual environment [1]. Then:
sudo aptitude install python-dev libxml2-dev libxslt-dev libz-dev
pip install "django<1.6" south Markdown html5tidy python-dateutil rdflib pytz six isodate lxml
pip install "django<2.1" django-markdown python-dateutil rdflib
# old pip install html5tidy pytz six isodate lxml
pip install https://github.com/devjones/PyEtherpadLite/archive/master.zip
pip install https://github.com/aleray/markdown-figures/archive/master.zip
mkdir -p ~/src/
cd ~/src
git clone http://gitlab.constantvzw.org/osp/tools.ethertoff.git
# Or use cloning over ssh (requires account):
# git@gitlab.constantvzw.org:osp/tools.ethertoff.git
cd tools.ethertoff # [2]
cd ethertoff
cp local_settings.py.example local_settings.py
# Change database details in local_settings.py
cd ..
python manage.py syncdb
python manage.py migrate etherpadlite
# python manage.py syncdb
python manage.py migrate
Change the info of your domain name and website name in the Sites section on
<http://localhost:8000/admin>. **Do not add "http://" in your domain name,
......@@ -74,19 +73,25 @@ And then do the following (replace the "domain" and "name" with your own info):
site = Site.objects.create(domain='example.com', name='example.com')
site.save()
--> and then install etherpad
## Install Etherpad-lite
mkdir -p ~/src
cd ~/src
git clone https://github.com/ether/etherpad-lite.git
# --> install node js
## --> install node js
Install Make:
sudo aptitude install build-essentials
Linux Binaries (.tar.gz) from http://nodejs.org/download/
## Launch Etherpad-lite
run Etherpad with:
~/src/etherpad-lite/bin/run.sh
......@@ -95,7 +100,11 @@ Your Etherpad is running at http://127.0.0.1:9001/
In Etherpad’s folder, you will find a file called APIKEY.txt
you need its contents later
## Launch Ethertoff
Run the server:
python manage.py runserver
......@@ -108,20 +117,18 @@ Now, on the Django admin:
url: http://127.0.0.1:9001/
# if on a server
url: http://domainname/ether/
api_key: the contents of the file APIKEY.txt
api_key: the contents of the file APIKEY.txt in Etherpad files
Go back to the admin home, and then add a new group:
Auth > Groups > Add
Go back to the admin home, and then add the superuser (and all needed users)
to the group you just created
Go back to the admin home, and then add the superuser (and all needed users) to the group you just created
Auth > Users
Go back to the admin home, and then create an Etherpad Group based upon the group and the server you just created.
Etherpadlite > Groups > Add
Now Ethertoff is served at http://127.0.0.1:8000/ locally, or on your domain
name on a server.
Now Ethertoff is served at http://127.0.0.1:8000/ locally, or on your domain name on a server.
You can set the site name, that appears on the header, in the ‘sites’ app in the admin.
......@@ -144,15 +151,15 @@ example.com / -> django
/ether/ -> etherpad
/static/ -> django static files
To test if everything is working, you can use screen to run gunicorn and
etherpad scripts at the same time, and then use a daemon like Supervisor to run them in the
background.
To test if everything is working, you can use screen to run gunicorn and Etherpad scripts at the same time, and then use a daemon like Supervisor to run them in the background.
## MYSQL
pip install "distribute>0.6.24"
sudo aptitude install libmysqlclient-dev python-dev
pip install MySQL-python
# pip install "distribute>0.6.24"
sudo aptitude install libmysqlclient-dev python-dev
pip install MySQL-python mysqlclient
## DJANGO
......@@ -182,6 +189,8 @@ folder /static/.
To run the server in the background, use Supervisor daemon.
## ETHERPAD
Etherpad, finally, runs as its own server. You probably need to use
a supervisor such as supervisord to make sure it keeps running.
......@@ -190,6 +199,8 @@ is not intended for use on servers. Finally, you will need to reverse
proxy the Etherpad process from your main web server, mapping it to
a folder such as /ether/.
## SUPERVISOR
To run django and etherpad in the background.
......
......@@ -11,4 +11,4 @@ class PadCreate(forms.Form):
class GroupCreate(forms.ModelForm):
class Meta:
model = Group
exclude = ('permissions')
exclude = ('permissions',)
This diff is collapsed.
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Pad.name'
db.alter_column(u'etherpadlite_pad', 'name', self.gf('django.db.models.fields.CharField')(max_length=50))
def backwards(self, orm):
# Changing field 'Pad.name'
db.alter_column(u'etherpadlite_pad', 'name', self.gf('django.db.models.fields.CharField')(max_length=256))
models = {
u'auth.group': {
'Meta': {'object_name': 'Group'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
u'auth.permission': {
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
u'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
u'etherpadlite.pad': {
'Meta': {'ordering': "['display_slug', 'name']", 'object_name': 'Pad'},
'display_name': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
'display_slug': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
'group': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['etherpadlite.PadGroup']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'server': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['etherpadlite.PadServer']"})
},
u'etherpadlite.padauthor': {
'Meta': {'object_name': 'PadAuthor'},
'authorID': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
'group': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'authors'", 'null': 'True', 'symmetrical': 'False', 'to': u"orm['etherpadlite.PadGroup']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'server': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['etherpadlite.PadServer']"}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"})
},
u'etherpadlite.padgroup': {
'Meta': {'object_name': 'PadGroup'},
'group': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.Group']"}),
'groupID': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'server': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['etherpadlite.PadServer']"})
},
u'etherpadlite.padserver': {
'Meta': {'object_name': 'PadServer'},
'apikey': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'notes': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
'url': ('django.db.models.fields.URLField', [], {'max_length': '256'})
}
}
complete_apps = ['etherpadlite']
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Don't use "from appname.models import ModelName".
# Use orm.ModelName to refer to models in this application,
# and orm['appname.ModelName'] for models in other applications.
# and orm['appname.ModelName'] for models in other applications.
for pad in orm.Pad.objects.all():
pad.name = pad.name[:42]
pad.save()
def backwards(self, orm):
"Write your backwards methods here."
raise RuntimeError("Cannot reverse this migration.")
models = {
u'auth.group': {
'Meta': {'object_name': 'Group'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
u'auth.permission': {
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
u'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
u'etherpadlite.pad': {
'Meta': {'ordering': "['display_slug', 'name']", 'object_name': 'Pad'},
'display_name': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
'display_slug': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
'group': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['etherpadlite.PadGroup']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'server': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['etherpadlite.PadServer']"})
},
u'etherpadlite.padauthor': {
'Meta': {'object_name': 'PadAuthor'},
'authorID': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
'group': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'authors'", 'null': 'True', 'symmetrical': 'False', 'to': u"orm['etherpadlite.PadGroup']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'server': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['etherpadlite.PadServer']"}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"})
},
u'etherpadlite.padgroup': {
'Meta': {'object_name': 'PadGroup'},
'group': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.Group']"}),
'groupID': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'server': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['etherpadlite.PadServer']"})
},
u'etherpadlite.padserver': {
'Meta': {'object_name': 'PadServer'},
'apikey': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'notes': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
'url': ('django.db.models.fields.URLField', [], {'max_length': '256'})
}
}
complete_apps = ['etherpadlite']
symmetrical = True
......@@ -3,7 +3,7 @@
from django.db import models
from django.db.models.signals import pre_delete
from django.contrib.auth.models import User, Group
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from py_etherpad import EtherpadLiteClient
......@@ -41,15 +41,15 @@ class PadServer(models.Model):
class PadGroup(models.Model):
"""Schema and methods for etherpad-lite groups
"""
group = models.ForeignKey(Group)
group = models.ForeignKey(Group, models.PROTECT)
groupID = models.CharField(max_length=256, blank=True)
server = models.ForeignKey(PadServer)
server = models.ForeignKey(PadServer, models.PROTECT)
class Meta:
verbose_name = _('group')
def __unicode__(self):
return self.group.__unicode__()
return self.group
@property
def epclient(self):
......@@ -62,8 +62,9 @@ class PadGroup(models.Model):
return ''.join(random.choice(chars) for x in range(size))
def EtherMap(self):
print(self.group)
result = self.epclient.createGroupIfNotExistsFor(
self.group.__unicode__() + self._get_random_id() +
u"%s" % (self.group) + self._get_random_id() +
self.group.id.__str__()
)
self.groupID = result['groupID']
......@@ -104,9 +105,9 @@ pre_delete.connect(groupDel, sender=Group)
class PadAuthor(models.Model):
"""Schema and methods for etherpad-lite authors
"""
user = models.ForeignKey(User)
user = models.ForeignKey(User, models.PROTECT)
authorID = models.CharField(max_length=256, blank=True)
server = models.ForeignKey(PadServer)
server = models.ForeignKey(PadServer, models.PROTECT)
group = models.ManyToManyField(
PadGroup,
blank=True,
......@@ -167,8 +168,8 @@ class Pad(models.Model):
# more hassle then it’s worth
display_name = models.CharField(max_length=256, blank=True, verbose_name=u"Name as used in Display (use → for namespacing)")
server = models.ForeignKey(PadServer)
group = models.ForeignKey(PadGroup)
server = models.ForeignKey(PadServer, models.PROTECT)
group = models.ForeignKey(PadGroup, models.PROTECT)
def __unicode__(self):
return self.display_slug
......
from django.contrib.auth import views as auth_views
from django.conf.urls.defaults import patterns, url
from etherpadlite.models import *
urlpatterns = patterns(
'',
url(r'^$', 'django.contrib.auth.views.login',
urlpatterns = [
#path('', 'django.contrib.auth.views.login',
#{'template_name': 'etherpad-lite/login.html'}, name='login'),
path('', auth_views.LoginView.as_view(),
{'template_name': 'login.html'}, name='login'),
path('etherpad', 'django.contrib.auth.views.login',
{'template_name': 'etherpad-lite/login.html'}),
url(r'^etherpad$', 'django.contrib.auth.views.login',
{'template_name': 'etherpad-lite/login.html'}),
url(r'^logout$', 'django.contrib.auth.views.logout',
path('logout', 'django.contrib.auth.views.logout',
{'template_name': 'etherpad-lite/logout.html'}),
url(r'^accounts/profile/$', 'etherpadlite.views.profile'),
url(r'^etherpad/(?P<pk>\d+)/$', 'etherpadlite.views.pad'),
url(r'^etherpad/create/(?P<pk>\d+)/$', 'etherpadlite.views.padCreate'),
url(r'^etherpad/delete/(?P<pk>\d+)/$', 'etherpadlite.views.padDelete'),
url(r'^group/create/$', 'etherpadlite.views.groupCreate')
)
path('accounts/profile/', 'etherpadlite.views.profile'),
re_path(r'^etherpad/(?P<pk>\d+)/$', 'etherpadlite.views.pad'),
re_path(r'^etherpad/create/(?P<pk>\d+)/$', 'etherpadlite.views.padCreate'),
re_path(r'^etherpad/delete/(?P<pk>\d+)/$', 'etherpadlite.views.padDelete'),
path('group/create/', 'etherpadlite.views.groupCreate')
]
......@@ -11,7 +11,7 @@ from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.core.context_processors import csrf
from django.templates.context_processors import csrf
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext_lazy as _
......
......@@ -7,7 +7,7 @@ import re
import sys
import codecs
import json
from urllib2 import HTTPError
from urllib import error
from time import clock
# PyPi imports
......@@ -21,7 +21,7 @@ from django.template.loader import render_to_string
# Django Apps import
from django.contrib.sites.models import Site
#from django.contrib.sites.models import Site
from etherpadlite.models import Pad, PadAuthor
from ethertoff.settings import BACKUP_DIR
......@@ -99,9 +99,9 @@ short_names = {
}
HOST = None
if Site.objects.count() > 0:
site = Site.objects.all()[0]
HOST = site.domain
#if Site.objects.count() > 0:
#site = Site.objects.all()[0]
#HOST = site.domain
def query_results_to_template_articles(query_results):
"""
......@@ -115,7 +115,7 @@ def query_results_to_template_articles(query_results):
return template_articles
for s, p, o in query_results:
print s.encode('utf-8'), p.encode('utf-8'), o.encode('utf-8')
print(s.encode('utf-8'), p.encode('utf-8'), o.encode('utf-8'))
uri = unicode(s).strip()
key = unicode(p).strip()
value = unicode(o).strip()
......@@ -172,22 +172,22 @@ def snif():
for pad in Pad.objects.all():
i += 1
txt = "checking pad %s of %s: %s" % (i, total, pad.display_slug)
print txt.encode('utf-8')
print(txt.encode('utf-8'))
# We only want to index the articles—
# For now we can distinguish them because they have url’s
# ending in ‘.md’
if not pad.display_slug.endswith('.md'):
print "no *.md extension, probably not meant for publication"
print("no *.md extension, probably not meant for publication")
continue
try:
result = g.parse(host + pad.get_absolute_url())
print "succesfully parsed"
except HTTPError, e:
print("succesfully parsed")
except(HTTPError, e):
if e.code == 403:
# Some of the pads will not be public yet—
# They gives a ‘403 FORBIDDEN’ response
# this is expected, and we don’t need to scrape them
print "pad not public"
print("pad not public")
continue
else:
raise
......@@ -207,7 +207,7 @@ class Command(BaseCommand):
args = ''
help = 'Create an index of all the articles’ metadata'
print "Starting to index, this might take some time..."
print("Starting to index, this might take some time...")
def handle(self, *args, **options):
return snif()
# Django settings for ethertoff project.
import os
import django.conf.global_settings as DEFAULT_SETTINGS
"""
Django settings for ethertoff project.
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
Generated by 'django-admin startproject' using Django 2.0.6.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
MANAGERS = ADMINS
import os
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = []
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# 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 = 'Europe/Brussels'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
# SITE_ID = 1
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'oy9@**&*m*wmw&3um_o!xr@e4jig9u+woz6^szs!a%mye5%qut'
# 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
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True
ALLOWED_HOSTS = []
SITE_ID = 1
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://example.com/media/", "http://media.example.com/"
MEDIA_URL = '/media/'
# Application definition
# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = '/static/'
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
#'django.contrib.sites',
'etherpadlite',
'ethertoff',
#'south'
]
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(PROJECT_DIR, 'static/'),
)
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
# 'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = '4vw!c2+fx*bh35&$a%+bf2wb=y=r=#9$ct1%f+ji0ws9@a27mw'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'ethertoff.middleware.ErrorHandlingMiddleware',
'django.middleware.common.CommonMiddleware',
'ethertoff.middleware.TidyMiddleware',
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'ethertoff.urls'
# Python dotted path to the WSGI application used by Django's runserver.
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'ethertoff.wsgi.application'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(PROJECT_DIR, 'ethertoff/templates'),
)
TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + (
"ethertoff.context_processors.site_name",
"ethertoff.context_processors.pads",
"ethertoff.context_processors.local",
)
# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'etherpadlite',
'example_theme',
'ethertoff',
'south'
)
# 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 http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'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': {