From c7b48513fb2cb0cdd0e4ec0050b8dbcbddc698f5 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Tue, 22 Oct 2013 17:31:15 +0530 Subject: Adding the project initial commit --- PythonTBC/settings.py | 163 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 PythonTBC/settings.py (limited to 'PythonTBC/settings.py') diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py new file mode 100644 index 0000000..243adf0 --- /dev/null +++ b/PythonTBC/settings.py @@ -0,0 +1,163 @@ +# Django settings for PythonTBC project. + +from os.path import * + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + ('Hardik Ghaghada', 'hardik@fossee.in'), +) + +MANAGERS = ADMINS +PROJDIR = abspath(dirname(__file__)) +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': 'pythontbc', # Or path to database file if using sqlite3. + # The following settings are not used with sqlite3: + 'USER': 'root', + 'PASSWORD': 'Pyth0n321', + 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. + 'PORT': '', # Set to empty string for default. + } +} + +# 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 = [] + +# 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 = 'Asia/Calcutta' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +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 + +# If you set this to False, Django will not format dates, numbers and +# calendars according to the current locale. +USE_L10N = True + +# If you set this to False, Django will not use timezone-aware datetimes. +USE_TZ = True + +# Absolute filesystem path to the directory that will hold user-uploaded files. +# Example: "/var/www/example.com/media/" +MEDIA_ROOT = join(PROJDIR, '../tbc/static/uploads') + +# 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 = '/tbc/static/uploads/' + +# Absolute path to the directory static files should be collected to. +# Don't put anything in this directory yourself; store your static files +# in apps' "static/" subdirectories and in STATICFILES_DIRS. +# Example: "/var/www/example.com/static/" +STATIC_ROOT = '' + +# URL prefix for static files. +# Example: "http://example.com/static/", "http://static.example.com/" +STATIC_URL = '/static/' + +# 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. + join(PROJDIR, '../tbc/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 = 'a8zm$)bj&k9p2$1*biby#mo5fga#8$sr4&cmz%h=vum-xkbkme' + +# 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 = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + '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', +) + +ROOT_URLCONF = 'PythonTBC.urls' + +# Python dotted path to the WSGI application used by Django's runserver. +WSGI_APPLICATION = 'PythonTBC.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. + join(PROJDIR, '../tbc/templates'), +) + +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', + 'tbc', +) + +SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer' + +# 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': { + 'handlers': ['mail_admins'], + 'level': 'ERROR', + 'propagate': True, + }, + } +} -- cgit From 76e013fd4efe5a5262243d4ac10445a1a5d4b1ad Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Mon, 28 Oct 2013 11:52:38 +0530 Subject: removed explicitly specified passwords for db & LDAP --- PythonTBC/settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'PythonTBC/settings.py') diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py index 243adf0..7329074 100644 --- a/PythonTBC/settings.py +++ b/PythonTBC/settings.py @@ -1,23 +1,26 @@ # Django settings for PythonTBC project. from os.path import * +from tbc.local import * DEBUG = True TEMPLATE_DEBUG = DEBUG + ADMINS = ( ('Hardik Ghaghada', 'hardik@fossee.in'), ) MANAGERS = ADMINS PROJDIR = abspath(dirname(__file__)) +DATABASE_PASSWORD = DB_PASS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'pythontbc', # Or path to database file if using sqlite3. # The following settings are not used with sqlite3: 'USER': 'root', - 'PASSWORD': 'Pyth0n321', + 'PASSWORD': DATABASE_PASSWORD, 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. 'PORT': '', # Set to empty string for default. } -- cgit From 80043faf74e19064f040a132e3189d3e516c4300 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Wed, 19 Feb 2014 18:45:53 +0530 Subject: setting mysql username --- PythonTBC/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'PythonTBC/settings.py') diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py index 7329074..a182395 100644 --- a/PythonTBC/settings.py +++ b/PythonTBC/settings.py @@ -19,7 +19,7 @@ DATABASES = { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'pythontbc', # Or path to database file if using sqlite3. # The following settings are not used with sqlite3: - 'USER': 'root', + 'USER': 'pythontbc', 'PASSWORD': DATABASE_PASSWORD, 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. 'PORT': '', # Set to empty string for default. -- cgit From b4c1a09498735f10bb21c7dccb28970675db3f14 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Wed, 19 Feb 2014 18:48:53 +0530 Subject: setting mysql username --- PythonTBC/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'PythonTBC/settings.py') diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py index a182395..67dc106 100644 --- a/PythonTBC/settings.py +++ b/PythonTBC/settings.py @@ -13,7 +13,7 @@ ADMINS = ( MANAGERS = ADMINS PROJDIR = abspath(dirname(__file__)) -DATABASE_PASSWORD = DB_PASS +DATABASE_PASSWORD = db_pass DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. -- cgit From 31505b7cdd10ff5a38205b1a40704c95ed00b481 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Wed, 19 Feb 2014 18:58:15 +0530 Subject: changing passwords settings --- PythonTBC/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'PythonTBC/settings.py') diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py index 67dc106..7c6dbcc 100644 --- a/PythonTBC/settings.py +++ b/PythonTBC/settings.py @@ -1,7 +1,7 @@ # Django settings for PythonTBC project. from os.path import * -from tbc.local import * +from local import * DEBUG = True TEMPLATE_DEBUG = DEBUG -- cgit From fd5ed8a1c346243b44cadb3217491515bd9e65cd Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Wed, 12 Mar 2014 18:09:38 +0530 Subject: making changes to take mysql user name from local.py --- PythonTBC/settings.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'PythonTBC/settings.py') diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py index 7c6dbcc..51f4364 100644 --- a/PythonTBC/settings.py +++ b/PythonTBC/settings.py @@ -13,13 +13,14 @@ ADMINS = ( MANAGERS = ADMINS PROJDIR = abspath(dirname(__file__)) +DATABASE_USER = db_user DATABASE_PASSWORD = db_pass DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'pythontbc', # Or path to database file if using sqlite3. # The following settings are not used with sqlite3: - 'USER': 'pythontbc', + 'USER': DATABASE_USER, 'PASSWORD': DATABASE_PASSWORD, 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. 'PORT': '', # Set to empty string for default. @@ -118,8 +119,8 @@ TEMPLATE_DIRS = ( # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. join(PROJDIR, '../tbc/templates'), + join(PROJDIR, '../tbc/static/uploads') ) - INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', -- cgit From 4c535a956e8a6d5bb9c0b124f4180fcf9d0275e9 Mon Sep 17 00:00:00 2001 From: Jayaram R Pai Date: Sun, 6 Jul 2014 23:10:02 +0530 Subject: added comments app --- PythonTBC/settings.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'PythonTBC/settings.py') diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py index 51f4364..e2cafba 100644 --- a/PythonTBC/settings.py +++ b/PythonTBC/settings.py @@ -119,7 +119,8 @@ TEMPLATE_DIRS = ( # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. join(PROJDIR, '../tbc/templates'), - join(PROJDIR, '../tbc/static/uploads') + join(PROJDIR, '../tbc/static/uploads'), + join(PROJDIR, '../comments/templates') ) INSTALLED_APPS = ( 'django.contrib.auth', @@ -133,6 +134,7 @@ INSTALLED_APPS = ( # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'tbc', + 'comments', ) SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer' -- cgit From 81298b9ef6455650eb1b01cf2fa54bd081715263 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Wed, 26 Nov 2014 12:04:13 +0530 Subject: added south --- PythonTBC/settings.py | 1 + 1 file changed, 1 insertion(+) (limited to 'PythonTBC/settings.py') diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py index e2cafba..f7cab4e 100644 --- a/PythonTBC/settings.py +++ b/PythonTBC/settings.py @@ -135,6 +135,7 @@ INSTALLED_APPS = ( # 'django.contrib.admindocs', 'tbc', 'comments', + 'south', ) SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer' -- cgit From d6e7f2e1e0e5bc7bd5f222c4eac71dbaf4875c84 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Thu, 5 Mar 2015 17:10:06 +0530 Subject: changed to clean URL for convert notebook --- PythonTBC/settings.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'PythonTBC/settings.py') diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py index f7cab4e..a225d8a 100644 --- a/PythonTBC/settings.py +++ b/PythonTBC/settings.py @@ -56,12 +56,14 @@ USE_TZ = True # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/var/www/example.com/media/" -MEDIA_ROOT = join(PROJDIR, '../tbc/static/uploads') +MEDIA_ROOT = '/home/hardik/Virtualenvs/PythonTBC/Python-Textbook-Companions' +#MEDIA_ROOT = join(PROJDIR, '../tbc/static/uploads') +#print PROJDIR # 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 = '/tbc/static/uploads/' +MEDIA_URL = '/Python-Textbook-Companions/' # Absolute path to the directory static files should be collected to. # Don't put anything in this directory yourself; store your static files @@ -79,6 +81,7 @@ STATICFILES_DIRS = ( # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. join(PROJDIR, '../tbc/static'), + '/home/hardik/PythonTBC' ) # List of finder classes that know how to find static files in @@ -120,7 +123,8 @@ TEMPLATE_DIRS = ( # Don't forget to use absolute paths, not relative paths. join(PROJDIR, '../tbc/templates'), join(PROJDIR, '../tbc/static/uploads'), - join(PROJDIR, '../comments/templates') + join(PROJDIR, '../comments/templates'), + '/home/hardik/Virtualenvs/PythonTBC/Python-Textbook-Companions' ) INSTALLED_APPS = ( 'django.contrib.auth', -- cgit From 5b91f30a4a14a03bd860a6ce2fe715841156f031 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Wed, 11 Mar 2015 12:53:19 +0530 Subject: modified settings to use absolute paths from local file --- PythonTBC/settings.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'PythonTBC/settings.py') diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py index a225d8a..0f056d3 100644 --- a/PythonTBC/settings.py +++ b/PythonTBC/settings.py @@ -56,14 +56,12 @@ USE_TZ = True # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/var/www/example.com/media/" -MEDIA_ROOT = '/home/hardik/Virtualenvs/PythonTBC/Python-Textbook-Companions' -#MEDIA_ROOT = join(PROJDIR, '../tbc/static/uploads') -#print PROJDIR +MEDIA_ROOT = LOCAL_MEDIA_ROOT # 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 = '/Python-Textbook-Companions/' +MEDIA_URL = LOCAL_MEDIA_URL # Absolute path to the directory static files should be collected to. # Don't put anything in this directory yourself; store your static files @@ -81,7 +79,7 @@ STATICFILES_DIRS = ( # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. join(PROJDIR, '../tbc/static'), - '/home/hardik/PythonTBC' + LOCAL_static_file_path, ) # List of finder classes that know how to find static files in @@ -124,7 +122,7 @@ TEMPLATE_DIRS = ( join(PROJDIR, '../tbc/templates'), join(PROJDIR, '../tbc/static/uploads'), join(PROJDIR, '../comments/templates'), - '/home/hardik/Virtualenvs/PythonTBC/Python-Textbook-Companions' + LOCAL_template_dirs, ) INSTALLED_APPS = ( 'django.contrib.auth', -- cgit From 59d3c4b1cf183a2772c7337fbb27543aa4046e01 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Tue, 26 May 2015 18:39:19 +0530 Subject: Added sitemap --- PythonTBC/settings.py | 1 + 1 file changed, 1 insertion(+) (limited to 'PythonTBC/settings.py') diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py index 0f056d3..2849625 100644 --- a/PythonTBC/settings.py +++ b/PythonTBC/settings.py @@ -131,6 +131,7 @@ INSTALLED_APPS = ( 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', + 'django.contrib.sitemaps', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: -- cgit From 5b77fdb95f6c3d71dfa1dd5d7ff06cd8bf519c98 Mon Sep 17 00:00:00 2001 From: kinitrupti Date: Thu, 24 Sep 2015 18:23:55 +0530 Subject: Hit-Count --- PythonTBC/settings.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'PythonTBC/settings.py') diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py index 2849625..5ffd4af 100644 --- a/PythonTBC/settings.py +++ b/PythonTBC/settings.py @@ -139,10 +139,14 @@ INSTALLED_APPS = ( 'tbc', 'comments', 'south', + 'hitcount', ) -SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer' +# needed for django-hitcount to function properly +SESSION_SAVE_EVERY_REQUEST = True +SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer' +SOUTH_MIGRATION_MODULES = {"hitcount": "hitcount.south_migrations"} # 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. @@ -171,3 +175,7 @@ LOGGING = { }, } } +HITCOUNT_KEEP_HIT_ACTIVE = { 'minutes': 60 } +HITCOUNT_HITS_PER_IP_LIMIT = 0 #unlimited +HITCOUNT_EXCLUDE_USER_GROUP = ( ) # not used +HITCOUNT_KEEP_HIT_IN_DATABASE = { 'seconds': 10 } -- cgit From b2c79f1fba13972db99af8a45558b6ca39980f16 Mon Sep 17 00:00:00 2001 From: Trupti Rajesh Kini Date: Mon, 25 Jan 2016 11:31:15 +0530 Subject: Update settings.py --- PythonTBC/settings.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'PythonTBC/settings.py') diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py index 5ffd4af..1ffd70d 100644 --- a/PythonTBC/settings.py +++ b/PythonTBC/settings.py @@ -139,14 +139,14 @@ INSTALLED_APPS = ( 'tbc', 'comments', 'south', - 'hitcount', + ) # needed for django-hitcount to function properly SESSION_SAVE_EVERY_REQUEST = True SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer' -SOUTH_MIGRATION_MODULES = {"hitcount": "hitcount.south_migrations"} + # 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. @@ -175,7 +175,4 @@ LOGGING = { }, } } -HITCOUNT_KEEP_HIT_ACTIVE = { 'minutes': 60 } -HITCOUNT_HITS_PER_IP_LIMIT = 0 #unlimited -HITCOUNT_EXCLUDE_USER_GROUP = ( ) # not used -HITCOUNT_KEEP_HIT_IN_DATABASE = { 'seconds': 10 } + -- cgit From 909d934c15168d743066a6efc5d04dfee8a50a97 Mon Sep 17 00:00:00 2001 From: Trupti Rajesh Kini Date: Mon, 25 Jan 2016 11:35:42 +0530 Subject: Update settings.py --- PythonTBC/settings.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'PythonTBC/settings.py') diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py index 1ffd70d..bfcb2d5 100644 --- a/PythonTBC/settings.py +++ b/PythonTBC/settings.py @@ -142,8 +142,7 @@ INSTALLED_APPS = ( ) -# needed for django-hitcount to function properly -SESSION_SAVE_EVERY_REQUEST = True + SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer' -- cgit