Revision: fb433e689f
Author: surenspost
Date: Tue Nov 23 12:38:07 2010
Log: settings.py.sample goes away for a versatile settings.conf
http://code.google.com/p/codechecker/source/detail?r=fb433e689f
Revision: dbad7537e9
Author: surenspost
Date: Tue Nov 23 12:38:51 2010
Log: No longer one has to edit settings.py here. It automattically takes
va...
http://code.google.com/p/codechecker/source/detail?r=dbad7537e9
Revision: 7573a0e53a
Author: surenspost
Date: Tue Nov 23 12:40:43 2010
Log: Simple installer - copies python modules to its respective place,
conf...
http://code.google.com/p/codechecker/source/detail?r=7573a0e53a
Revision: f655d06414
Author: surenspost
Date: Tue Nov 23 12:41:04 2010
Log: removing a dummy file
http://code.google.com/p/codechecker/source/detail?r=f655d06414
Revision: 0eb45e93cd
Author: surenspost
Date: Tue Nov 23 12:41:56 2010
Log: modifying root_url.py to reflect our current settings and urls file.
H...
http://code.google.com/p/codechecker/source/detail?r=0eb45e93cd
Revision: 474844940c
Author: surenspost
Date: Tue Nov 23 12:42:34 2010
Log: This file was a sym link to earlier sample file. So removing these
as ...
http://code.google.com/p/codechecker/source/detail?r=474844940c
Revision: dee6f3c277
Author: surenspost
Date: Tue Nov 23 12:43:51 2010
Log: removing dummy mysql data to discourage usage of root user to save
dja...
http://code.google.com/p/codechecker/source/detail?r=dee6f3c277
==============================================================================
Revision: fb433e689f
Author: surenspost
Date: Tue Nov 23 12:38:07 2010
Log: settings.py.sample goes away for a versatile settings.conf
http://code.google.com/p/codechecker/source/detail?r=fb433e689f
Added:
/conf/settings.conf
Deleted:
/conf/settings.py.sample
=======================================
--- /dev/null
+++ /conf/settings.conf Tue Nov 23 12:38:07 2010
@@ -0,0 +1,15 @@
+[django]
+TIME_ZONE=Asia/Kolkata
+MEDIA_URL=/media/
+ADMIN_MEDIA_PREFIX=/media/
+
+[database]
+DATABASE_ENGINE =mysql
+DATABASE_NAME=codechecker
+DATABASE_USER=root
+DATABASE_PASSWORD=root
+
+[apache]
+BASE_URL=/site/
+SERVERNAME=checker.example.com
+
=======================================
--- /conf/settings.py.sample Tue Nov 23 11:37:17 2010
+++ /dev/null
@@ -1,49 +0,0 @@
-#Django Specific config
-TIME_ZONE = 'Asia/Kolkata'
-SITE_ID = 1
-TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.load_template_source',
- 'django.template.loaders.app_directories.load_template_source',
- )
-
-MIDDLEWARE_CLASSES = (
- 'django.middleware.common.CommonMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
-)
-
-#Database connectivity
-#### EDIT THIS SECTION WITH YOUR DATABASE DETAILS ####
-DATABASE_ENGINE = 'mysql'
-DATABASE_NAME = ''
-DATABASE_USER = ''
-DATABASE_PASSWORD = ''
-###########################
-
-
-
-# codechecker based django config
-ROOT_URLCONF = 'codechecker.root_url'
-TEMPLATE_DIRS = (
- '/opt/checker/templates',
- )
-MEDIA_ROOT = '/opt/checker/media/'
-MEDIA_URL = '/media/'
-ADMIN_MEDIA_PREFIX = '/media/'
-INSTALLED_APPS = (
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.sites',
- 'django.contrib.admin',
- 'codechecker.contests',
- )
-
-# codechecker based custom config
-BASE_URL = '/site/'
-SERVERNAME = 'checker.example.com'
-
-# Debug
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
==============================================================================
Revision: dbad7537e9
Author: surenspost
Date: Tue Nov 23 12:38:51 2010
Log: No longer one has to edit settings.py here. It automattically takes
values from settings.conf from previous commit
http://code.google.com/p/codechecker/source/detail?r=dbad7537e9
Added:
/src/checker/cc_frontend/settings.py
Deleted:
/src/checker/cc_frontend/settings.py.sample
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/settings.py Tue Nov 23 12:38:51 2010
@@ -0,0 +1,49 @@
+import os
+import ConfigParser
+
+config = ConfigParser.ConfigParser()
+config.read('/usr/local/etc/checker/settings.conf')
+
+#Django Specific config
+TIME_ZONE = config.get('django', 'TIME_ZONE')
+SITE_ID = 1
+TEMPLATE_LOADERS = (
+ 'django.template.loaders.filesystem.load_template_source',
+ 'django.template.loaders.app_directories.load_template_source',
+ )
+
+MIDDLEWARE_CLASSES = (
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+)
+
+DATABASE_ENGINE = config.get('database','DATABASE_ENGINE')
+DATABASE_NAME = config.get('database', 'DATABASE_NAME')
+DATABASE_USER = config.get('database', 'DATABASE_USER')
+DATABASE_PASSWORD = config.get('database', 'DATABASE_PASSWORD')
+
+ROOT_URLCONF = 'checker.cc_frontend.root_url'
+TEMPLATE_DIRS = (
+ os.path.join( os.getcwd(), 'templates/')
+ )
+MEDIA_URL = config.get('django', 'MEDIA_URL')
+ADMIN_MEDIA_PREFIX = config.get('django', 'ADMIN_MEDIA_PREFIX')
+
+INSTALLED_APPS = (
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.sites',
+ 'django.contrib.admin',
+ 'checker.cc_frontend'
+ )
+
+# codechecker based custom config
+BASE_URL = config.get('apache', 'BASE_URL')
+SERVERNAME = config.get('apache', 'SERVERNAME')
+
+# Debug
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
=======================================
--- /src/checker/cc_frontend/settings.py.sample Mon Nov 22 05:53:21 2010
+++ /dev/null
@@ -1,49 +0,0 @@
-#Django Specific config
-TIME_ZONE = 'Asia/Kolkata'
-SITE_ID = 1
-TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.load_template_source',
- 'django.template.loaders.app_directories.load_template_source',
- )
-
-MIDDLEWARE_CLASSES = (
- 'django.middleware.common.CommonMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
-)
-
-#Database connectivity
-#### EDIT THIS SECTION WITH YOUR DATABASE DETAILS ####
-DATABASE_ENGINE = 'mysql'
-DATABASE_NAME = ''
-DATABASE_USER = ''
-DATABASE_PASSWORD = ''
-###########################
-
-
-
-# codechecker based django config
-ROOT_URLCONF = 'codechecker.root_url'
-TEMPLATE_DIRS = (
- '/opt/checker/templates',
- )
-MEDIA_ROOT = '/opt/checker/media/'
-MEDIA_URL = '/media/'
-ADMIN_MEDIA_PREFIX = '/media/'
-INSTALLED_APPS = (
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.sites',
- 'django.contrib.admin',
- 'codechecker.contests',
- )
-
-# codechecker based custom config
-BASE_URL = '/site/'
-SERVERNAME = 'checker.example.com'
-
-# Debug
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
==============================================================================
Revision: 7573a0e53a
Author: surenspost
Date: Tue Nov 23 12:40:43 2010
Log: Simple installer - copies python modules to its respective place,
config files to /usr/local/etc
http://code.google.com/p/codechecker/source/detail?r=7573a0e53a
Added:
/install.py
=======================================
--- /dev/null
+++ /install.py Tue Nov 23 12:40:43 2010
@@ -0,0 +1,68 @@
+import os
+import sys
+import shutil
+from distutils.core import setup
+from django.core.management import execute_manager
+
+
+# TODO:One step installation file
+
+prefix = "/usr/local/"
+backend_conf = prefix + 'etc/checker/'
+frontend_conf = prefix + 'etc/apache/'
+
+#check if django exists first
+try :
+ import django
+except ImportError :
+ sys.stderr.write( '''
+---------------------------------------------------------------------------
+Could not find Django, please install Django first.\n
+sys.stderr.write( "Please install Django from www.djagoproject.com.\n
+---------------------------------------------------------------------------
+''' )
+ exit(1)
+# check if python mysql exists
+try :
+ import MySQLdb
+except ImportError :
+ sys.stderr.write( '''
+---------------------------------------------------------------------------
+python-mysqldb is not installed. Please install from apt/yum\n
+---------------------------------------------------------------------------
+''' )
+ exit(1)
+
+#Copy the settings.py from sample file and ask to populate the mysql data
+shutil.copy( os.path.join( os.getcwd(), 'conf/settings.conf' ),
+ os.path.join( backend_conf, 'settings.conf' ) )
+
+# copy all python modules
+ret_code = os.system( "python setup.py install" )
+if not ret_code == 0 :
+ sys.exit(ret_code)
+
+
+# create etc/checker conf directory if not exists already
+if not os.path.exists( backend_conf ):
+ os.mkdir( backend_conf )
+
+# create etc/apache conf directory if not exists already
+if not os.path.exists( frontend_conf ):
+ os.mkdir( frontend_conf )
+
+#copy the codechecker.conf to @prefix/etc/checker
+shutil.copy( os.path.join( os.getcwd(), 'conf/codechecker.conf'),
+ os.path.join( backend_conf, 'codechecker.conf' ) )
+
+#copy the apache conf file
+shutil.copy( os.path.join( os.getcwd(), 'conf/django.conf'),
+ os.path.join( frontend_conf, 'django.conf') )
+
+
+# Now to run syncdb - settings should already be in place
+# It would not have come to this level else
+# currently running manage.py syndb, how to call it here ?
+# TODO: call manage.py syncdb from here
+
+
==============================================================================
Revision: f655d06414
Author: surenspost
Date: Tue Nov 23 12:41:04 2010
Log: removing a dummy file
http://code.google.com/p/codechecker/source/detail?r=f655d06414
Deleted:
/src/__init__.py
==============================================================================
Revision: 0eb45e93cd
Author: surenspost
Date: Tue Nov 23 12:41:56 2010
Log: modifying root_url.py to reflect our current settings and urls file.
Have to change urls now to handle all the views
http://code.google.com/p/codechecker/source/detail?r=0eb45e93cd
Modified:
/src/checker/cc_frontend/root_url.py
=======================================
--- /src/checker/cc_frontend/root_url.py Mon Nov 22 05:53:21 2010
+++ /src/checker/cc_frontend/root_url.py Tue Nov 23 12:41:56 2010
@@ -1,11 +1,11 @@
from django.conf.urls.defaults import patterns,include
-
import settings
+import urls
# Remove the forward slashes !
location_root_url = settings.BASE_URL[1:]
urlpatterns = patterns('',
# Put the root url conf string here.
- (r"%s" % location_root_url, include('codechecker.urls')),
-)
+ (r"%s" % location_root_url, include(urls)),
+)
==============================================================================
Revision: 474844940c
Author: surenspost
Date: Tue Nov 23 12:42:34 2010
Log: This file was a sym link to earlier sample file. So removing these as
well
http://code.google.com/p/codechecker/source/detail?r=474844940c
Deleted:
/codechecker/settings.py.sample
=======================================
--- /codechecker/settings.py.sample Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,49 +0,0 @@
-#Django Specific config
-TIME_ZONE = 'Asia/Kolkata'
-SITE_ID = 1
-TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.load_template_source',
- 'django.template.loaders.app_directories.load_template_source',
- )
-
-MIDDLEWARE_CLASSES = (
- 'django.middleware.common.CommonMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
-)
-
-#Database connectivity
-#### EDIT THIS SECTION WITH YOUR DATABASE DETAILS ####
-DATABASE_ENGINE = 'mysql'
-DATABASE_NAME = ''
-DATABASE_USER = ''
-DATABASE_PASSWORD = ''
-###########################
-
-
-
-# codechecker based django config
-ROOT_URLCONF = 'codechecker.root_url'
-TEMPLATE_DIRS = (
- '/opt/checker/templates',
- )
-MEDIA_ROOT = '/opt/checker/media/'
-MEDIA_URL = '/media/'
-ADMIN_MEDIA_PREFIX = '/media/'
-INSTALLED_APPS = (
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.sites',
- 'django.contrib.admin',
- 'codechecker.contests',
- )
-
-# codechecker based custom config
-BASE_URL = '/site/'
-SERVERNAME = 'checker.example.com'
-
-# Debug
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
==============================================================================
Revision: dee6f3c277
Author: surenspost
Date: Tue Nov 23 12:43:51 2010
Log: removing dummy mysql data to discourage usage of root user to save
django DB's
http://code.google.com/p/codechecker/source/detail?r=dee6f3c277
Modified:
/conf/settings.conf
=======================================
--- /conf/settings.conf Tue Nov 23 12:38:07 2010
+++ /conf/settings.conf Tue Nov 23 12:43:51 2010
@@ -1,13 +1,13 @@
[django]
TIME_ZONE=Asia/Kolkata
-MEDIA_URL=/media/
-ADMIN_MEDIA_PREFIX=/media/
+MEDIA_URL=http://checker.example.com/media
+ADMIN_MEDIA_PREFIX=http://checker.example.com/media
[database]
-DATABASE_ENGINE =mysql
-DATABASE_NAME=codechecker
-DATABASE_USER=root
-DATABASE_PASSWORD=root
+DATABASE_ENGINE=
+DATABASE_NAME=
+DATABASE_USER=
+DATABASE_PASSWORD=
[apache]
BASE_URL=/site/