mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-21 23:01:52 +00:00
Django 1.7 mostly working. Big refactor so probably bugs
This commit is contained in:
parent
2c2c815b25
commit
758259be4d
@ -4,7 +4,7 @@ from django.forms import ModelForm
|
||||
import django.forms as forms
|
||||
from django.http import HttpResponse
|
||||
from django.core import serializers
|
||||
from core.views_other import downloadLogbook
|
||||
from troggle.core.views_other import downloadLogbook
|
||||
#from troggle.reversion.admin import VersionAdmin #django-reversion version control
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
from django.conf import settings
|
||||
from core.models import Expedition
|
||||
from troggle.core.models import Expedition
|
||||
|
||||
def troggle_context(request):
|
||||
return { 'settings':settings, 'Expedition':Expedition }
|
@ -15,7 +15,7 @@ from django.template import Context, loader
|
||||
import settings
|
||||
getcontext().prec=2 #use 2 significant figures for decimal calculations
|
||||
|
||||
from models_survex import *
|
||||
from troggle.core.models_survex import *
|
||||
|
||||
|
||||
def get_related_by_wikilinks(wiki_text):
|
||||
|
@ -3,7 +3,7 @@ from django.utils.html import conditional_escape
|
||||
from django.template.defaultfilters import stringfilter
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.conf import settings
|
||||
from core.models import QM, DPhoto, LogbookEntry, Cave
|
||||
from troggle.core.models import QM, DPhoto, LogbookEntry, Cave
|
||||
import re, urlparse
|
||||
|
||||
register = template.Library()
|
||||
|
@ -8,8 +8,8 @@ from django.db import connection
|
||||
from django.contrib.auth.models import User
|
||||
from django.http import HttpResponse
|
||||
from django.core.urlresolvers import reverse
|
||||
from core.models import Cave, Entrance
|
||||
import flatpages.models
|
||||
from troggle.core.models import Cave, Entrance
|
||||
import troggle.flatpages.models
|
||||
|
||||
databasename=settings.DATABASES['default']['NAME']
|
||||
expouser=settings.EXPOUSER
|
||||
|
@ -1,5 +1,5 @@
|
||||
from django.db import models
|
||||
from core.models import Cave, Entrance
|
||||
from troggle.core.models import Cave, Entrance
|
||||
|
||||
class Redirect(models.Model):
|
||||
originalURL = models.CharField(max_length=200, unique=True)
|
||||
|
@ -75,7 +75,7 @@ def flatpage(request, path):
|
||||
body.strip
|
||||
return render_with_context(request, 'flatpage.html', {'editable': True, 'path': path, 'title': title, 'body': body, 'homepage': (path == "index.htm")})
|
||||
else:
|
||||
return HttpResponse(o.read(), mimetype=getmimetype(path))
|
||||
return HttpResponse(o.read(), content_type=getmimetype(path))
|
||||
|
||||
def getmimetype(path):
|
||||
if path.lower().endswith(".png"): return "image/png"
|
||||
|
@ -1,8 +1,10 @@
|
||||
#!/usr/bin/env python
|
||||
import os, sys
|
||||
import os
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
|
||||
from django.core.management import execute_from_command_line
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
execute_from_command_line(sys.argv)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
import csv
|
||||
from django.conf import settings
|
||||
from core.models import QM, LogbookEntry, Cave
|
||||
from troggle.core.models import QM, LogbookEntry, Cave
|
||||
from datetime import *
|
||||
from utils import save_carefully
|
||||
import re, os
|
||||
@ -87,7 +87,7 @@ def parseCaveQMs(cave,inputFile):
|
||||
continue
|
||||
|
||||
def parse_KH_QMs(kh, inputFile):
|
||||
"""import QMs from the 1623-161 (Kaninchenhöhle) html pages
|
||||
"""import QMs from the 1623-161 (Kaninchenh<EFBFBD>hle) html pages
|
||||
"""
|
||||
khQMs=open(settings.EXPOWEB+inputFile,'r')
|
||||
khQMs=khQMs.readlines()
|
||||
|
@ -4,7 +4,7 @@ from django.conf import settings
|
||||
import csv, time, re, os, logging
|
||||
from utils import save_carefully
|
||||
from django.core.urlresolvers import reverse
|
||||
import flatpages.models
|
||||
import troggle.flatpages.models
|
||||
|
||||
##format of CAVETAB2.CSV is
|
||||
KatasterNumber = 0
|
||||
|
@ -1,7 +1,7 @@
|
||||
#.-*- coding: utf-8 -*-
|
||||
|
||||
from django.conf import settings
|
||||
import core.models as models
|
||||
import troggle.core.models as models
|
||||
|
||||
from parsers.people import GetPersonExpeditionNameLookup
|
||||
from parsers.cavetab import GetCaveLookup
|
||||
|
@ -1,7 +1,7 @@
|
||||
#.-*- coding: utf-8 -*-
|
||||
|
||||
from django.conf import settings
|
||||
import core.models as models
|
||||
import troggle.core.models as models
|
||||
import csv, re, datetime, os, shutil
|
||||
from utils import save_carefully
|
||||
|
||||
|
@ -6,7 +6,7 @@ import sys, os
|
||||
|
||||
import os, re, logging
|
||||
from django.conf import settings
|
||||
from core.models import Subcave, Cave
|
||||
from troggle.core.models import Subcave, Cave
|
||||
from utils import save_carefully
|
||||
|
||||
def getLinksInCaveDescription(cave):
|
||||
|
@ -3,7 +3,7 @@ import sys, os, types, logging, stat
|
||||
#from troggle import *
|
||||
#os.environ['DJANGO_SETTINGS_MODULE']='troggle.settings'
|
||||
import settings
|
||||
from core.models import *
|
||||
from troggle.core.models import *
|
||||
from PIL import Image
|
||||
#import settings
|
||||
#import core.models as models
|
||||
|
@ -7,7 +7,13 @@ site-specific user profile model specified in the
|
||||
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import SiteProfileNotAvailable
|
||||
#from django.contrib.auth.models import SiteProfileNotAvailable
|
||||
|
||||
try:
|
||||
from django.contrib.auth.models import SiteProfileNotAvailable
|
||||
except ImportError: # django >= 1.7
|
||||
SiteProfileNotAvailable = type('SiteProfileNotAvailable', (Exception,), {})
|
||||
|
||||
from django.db.models import get_model
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@ from django.template import RequestContext
|
||||
from django.views.generic.list import ListView
|
||||
from django import forms
|
||||
|
||||
from core.models import Person
|
||||
from troggle.core.models import Person
|
||||
|
||||
from profiles import utils
|
||||
|
||||
|
50
settings.py
50
settings.py
@ -2,11 +2,16 @@ from localsettings import * #inital localsettings call so that urljoins work
|
||||
import os
|
||||
import urlparse
|
||||
import django
|
||||
# Django settings for troggle project.
|
||||
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
||||
|
||||
# Django settings for troggle project.
|
||||
DEBUG = True
|
||||
TEMPLATE_DEBUG = DEBUG
|
||||
|
||||
ALLOWED_HOSTS = []
|
||||
|
||||
ADMINS = (
|
||||
# ('Your Name', 'your_email@domain.com'),
|
||||
)
|
||||
@ -30,6 +35,7 @@ SITE_ID = 1
|
||||
# If you set this to False, Django will make some optimizations so as not
|
||||
# to load the internationalization machinery.
|
||||
USE_I18N = True
|
||||
USE_L10N = True
|
||||
|
||||
FIX_PERMISSIONS = []
|
||||
NOTABLECAVESHREFS = [ "161", "204", "258", "76", "107", "264" ]
|
||||
@ -69,23 +75,6 @@ TEMPLATE_CONTEXT_PROCESSORS = ( authmodule, "core.context.troggle_context", )
|
||||
|
||||
LOGIN_REDIRECT_URL = '/'
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'troggle.middleware.SmartAppendSlashMiddleware'
|
||||
)
|
||||
|
||||
ROOT_URLCONF = 'troggle.urls'
|
||||
|
||||
ACCOUNT_ACTIVATION_DAYS=3
|
||||
|
||||
AUTH_PROFILE_MODULE = 'core.person'
|
||||
|
||||
INSTALLED_APPS = (
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
@ -94,9 +83,11 @@ INSTALLED_APPS = (
|
||||
'django.contrib.sites',
|
||||
'django.contrib.redirects',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
#'troggle.photologue',
|
||||
#'troggle.reversion',
|
||||
#'django_evolution',
|
||||
'tinymce',
|
||||
'registration',
|
||||
'troggle.profiles',
|
||||
'troggle.core',
|
||||
@ -104,9 +95,32 @@ INSTALLED_APPS = (
|
||||
'troggle.imagekit',
|
||||
)
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
'troggle.middleware.SmartAppendSlashMiddleware'
|
||||
)
|
||||
|
||||
ROOT_URLCONF = 'troggle.urls'
|
||||
|
||||
WSGI_APPLICATION = 'troggle.wsgi.application'
|
||||
|
||||
ACCOUNT_ACTIVATION_DAYS=3
|
||||
|
||||
AUTH_PROFILE_MODULE = 'core.person'
|
||||
|
||||
QM_PATTERN="\[\[\s*[Qq][Mm]:([ABC]?)(\d{4})-(\d*)-(\d*)\]\]"
|
||||
|
||||
TINYMCE_JS_URL = 'http://debug.example.org/tiny_mce/tiny_mce_src.js'
|
||||
|
||||
#TINYMCE_JS_URL = os.path.join(MEDIA_URL, "tinybibble_mce.js")
|
||||
|
||||
TINYMCE_DEFAULT_CONFIG = {
|
||||
'plugins': "table,spellchecker,paste,searchreplace",
|
||||
'theme': "advanced",
|
||||
|
Loading…
Reference in New Issue
Block a user