update imports
This commit is contained in:
parent
5d63ad1760
commit
3e8f28ff47
7 changed files with 13 additions and 16 deletions
|
@ -1,7 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# vi:si:et:sw=4:sts=4:ts=4
|
# vi:si:et:sw=4:sts=4:ts=4
|
||||||
|
|
||||||
from django.conf.urls.defaults import *
|
from django.conf.urls import patterns
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = patterns("item.views",
|
urlpatterns = patterns("item.views",
|
||||||
|
|
|
@ -14,7 +14,7 @@ from django.template import RequestContext
|
||||||
from django.http import HttpResponse, HttpResponseForbidden, Http404
|
from django.http import HttpResponse, HttpResponseForbidden, Http404
|
||||||
from django.shortcuts import get_object_or_404, redirect, render_to_response
|
from django.shortcuts import get_object_or_404, redirect, render_to_response
|
||||||
from django.core.files.temp import NamedTemporaryFile
|
from django.core.files.temp import NamedTemporaryFile
|
||||||
from django.core.servers.basehttp import FileWrapper
|
from wsgiref.util import FileWrapper
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
from ox.utils import json, ET
|
from ox.utils import json, ET
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
root_dir = os.path.normpath(os.path.abspath(os.path.dirname(__file__)))
|
root_dir = os.path.normpath(os.path.abspath(os.path.dirname(__file__)))
|
||||||
os.chdir(root_dir)
|
os.chdir(root_dir)
|
||||||
|
@ -9,19 +10,14 @@ activate_this = os.path.join(root_dir, '..', 'bin', 'activate_this.py')
|
||||||
execfile(activate_this, dict(__file__=activate_this))
|
execfile(activate_this, dict(__file__=activate_this))
|
||||||
|
|
||||||
|
|
||||||
from django.core.management import execute_manager
|
|
||||||
try:
|
|
||||||
import 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(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
|
||||||
|
from django.core.management import execute_from_command_line
|
||||||
|
import settings
|
||||||
if not os.path.exists(settings.SITE_CONFIG):
|
if not os.path.exists(settings.SITE_CONFIG):
|
||||||
import sys
|
import sys
|
||||||
sys.stderr.write("Error: Can't find '%s'.\nBefore you run pan.do/ra you must create it\n" % settings.SITE_CONFIG)
|
sys.stderr.write("Error: Can't find '%s'.\nBefore you run pan.do/ra you must create it\n" % settings.SITE_CONFIG)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
execute_manager(settings)
|
execute_from_command_line(sys.argv)
|
||||||
import app.config
|
import app.config
|
||||||
app.config.shutdown()
|
app.config.shutdown()
|
||||||
|
|
|
@ -13,7 +13,7 @@ from django.contrib.auth.models import User
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db.models.signals import pre_delete
|
from django.db.models.signals import pre_delete
|
||||||
import ox
|
import ox
|
||||||
from ox.django.fields import DictField, TupleField
|
from ox.django.fields import TupleField
|
||||||
|
|
||||||
from archive import extract
|
from archive import extract
|
||||||
from archive.chunk import save_chunk
|
from archive.chunk import save_chunk
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vi:si:et:sw=4:sts=4:ts=4
|
# vi:si:et:sw=4:sts=4:ts=4
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from django.conf.urls.defaults import *
|
from django.conf.urls import patterns, include
|
||||||
from ox.django.http import HttpFileResponse
|
from ox.django.http import HttpFileResponse
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
@ -28,7 +28,7 @@ urlpatterns = patterns('',
|
||||||
(r'^api/upload/?$', 'archive.views.firefogg_upload'),
|
(r'^api/upload/?$', 'archive.views.firefogg_upload'),
|
||||||
(r'^url=(?P<url>.*)$', 'app.views.redirect_url'),
|
(r'^url=(?P<url>.*)$', 'app.views.redirect_url'),
|
||||||
(r'^file/(?P<oshash>.*)$', 'archive.views.lookup_file'),
|
(r'^file/(?P<oshash>.*)$', 'archive.views.lookup_file'),
|
||||||
(r'^api/?$', include(ox.django.api.urls)),
|
(r'^api/?', include(ox.django.api.urls)),
|
||||||
(r'^resetUI$', 'user.views.reset_ui'),
|
(r'^resetUI$', 'user.views.reset_ui'),
|
||||||
(r'^documents/(?P<id>[A-Z0-9]+)/(?P<size>\d*)p(?P<page>[\d,]*).jpg$', 'document.views.thumbnail'),
|
(r'^documents/(?P<id>[A-Z0-9]+)/(?P<size>\d*)p(?P<page>[\d,]*).jpg$', 'document.views.thumbnail'),
|
||||||
(r'^documents/(?P<id>[A-Z0-9]+)/(?P<name>.*?\.[^\d]{3})$', 'document.views.file'),
|
(r'^documents/(?P<id>[A-Z0-9]+)/(?P<name>.*?\.[^\d]{3})$', 'document.views.file'),
|
||||||
|
|
|
@ -7,7 +7,8 @@ from django.contrib.auth.models import User, Group
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.db.models import Max
|
from django.db.models import Max
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.gis.utils import GeoIP
|
from django.contrib.gis.geoip import GeoIP
|
||||||
|
|
||||||
|
|
||||||
import ox
|
import ox
|
||||||
from ox.django.fields import DictField
|
from ox.django.fields import DictField
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
import random
|
import random
|
||||||
random.seed()
|
random.seed()
|
||||||
import re
|
import re
|
||||||
|
import json
|
||||||
|
|
||||||
from django.contrib.auth import authenticate, login, logout
|
from django.contrib.auth import authenticate, login, logout
|
||||||
from django.template import RequestContext, loader
|
from django.template import RequestContext, loader
|
||||||
from django.utils import simplejson as json
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.mail import send_mail, BadHeaderError, EmailMessage
|
from django.core.mail import send_mail, BadHeaderError, EmailMessage
|
||||||
from django.shortcuts import redirect
|
from django.shortcuts import redirect
|
||||||
|
|
Loading…
Reference in a new issue