diff --git a/.gitignore b/.gitignore index d9437c3..e2531a7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ *.pot *.pyc local_settings.py + +*.swp +.DS_Store diff --git a/manage.py b/manage.py deleted file mode 100644 index a466007..0000000 --- a/manage.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "colab.settings") - - from django.core.management import execute_from_command_line - - execute_from_command_line(sys.argv) diff --git a/src/colab/__init__.py b/src/colab/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/colab/__init__.py diff --git a/src/colab/custom_settings.py b/src/colab/custom_settings.py new file mode 100644 index 0000000..a192089 --- /dev/null +++ b/src/colab/custom_settings.py @@ -0,0 +1,62 @@ +from settings import * + +DEBUG = False + +TEMPLATE_DEBUG = False + +TIME_ZONE = 'America/Sao_Paulo' + +gettext = lambda s: s +LANGUAGES = ( + ('en', gettext('English')), + ('es', gettext('Spanish')), + ('pt-BR', gettext('Portuguese')), +) + +INSTALLED_APPS = INSTALLED_APPS + ( + # Not standard apps + 'south', + 'cliauth', + + # Own apps + 'api', + 'super_archives', + 'rss', +) + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'handlers': { + 'mail_admins': { + 'level': 'ERROR', + 'class': 'django.utils.log.AdminEmailHandler', + 'include_html': True, + } + }, + 'loggers': { + 'django.request': { + 'handlers': ['mail_admins'], + 'level': 'ERROR', + 'propagate': True, + }, + } +} + +SERVER_EMAIL = '"Colab Interlegis" ' +EMAIL_HOST_USER = SERVER_EMAIL + +#SOLR_HOSTNAME = 'solr.interlegis.leg.br' +SOLR_HOSTNAME = '10.1.2.154' +SOLR_PORT = '8080' +SOLR_SELECT_PATH = '/solr/select' + +SOLR_COLAB_URI = 'http://colab.interlegis.leg.br' +SOLR_BASE_QUERY = """ + ((Type:changeset OR Type:ticket OR Type:wiki OR Type:thread) AND Title:["" TO *]) +""" + +try: + from settings_local import * +except ImportError: + pass diff --git a/src/colab/settings.py b/src/colab/settings.py new file mode 100644 index 0000000..a5e22a2 --- /dev/null +++ b/src/colab/settings.py @@ -0,0 +1,84 @@ +""" +Django settings for colab project. + +For more information on this file, see +https://docs.djangoproject.com/en/dev/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/dev/ref/settings/ +""" + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +import os +BASE_DIR = os.path.dirname(os.path.dirname(__file__)) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'd%gy$gfn4z2=z414qvqouyd2h6_i8nr_m4zmlxqklu15u!8&^@' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +TEMPLATE_DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = ( + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +) + +MIDDLEWARE_CLASSES = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +) + +ROOT_URLCONF = 'colab.urls' + +WSGI_APPLICATION = 'colab.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/dev/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + +# Internationalization +# https://docs.djangoproject.com/en/dev/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/dev/howto/static-files/ + +STATIC_URL = '/static/' + +from custom_settings import * diff --git a/src/colab/urls.py b/src/colab/urls.py new file mode 100644 index 0000000..5988b08 --- /dev/null +++ b/src/colab/urls.py @@ -0,0 +1,12 @@ +from django.conf.urls import patterns, include, url + +from django.contrib import admin +admin.autodiscover() + +urlpatterns = patterns('', + # Examples: + # url(r'^$', 'colab.views.home', name='home'), + # url(r'^blog/', include('blog.urls')), + + url(r'^admin/', include(admin.site.urls)), +) diff --git a/src/colab/wsgi.py b/src/colab/wsgi.py new file mode 100644 index 0000000..02679ab --- /dev/null +++ b/src/colab/wsgi.py @@ -0,0 +1,14 @@ +""" +WSGI config for colab project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/ +""" + +import os +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "colab.settings") + +from django.core.wsgi import get_wsgi_application +application = get_wsgi_application() diff --git a/src/manage.py b/src/manage.py new file mode 100644 index 0000000..a466007 --- /dev/null +++ b/src/manage.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "colab.settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) -- libgit2 0.21.2