Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #87920 > unrolled thread

test2

Started byTiglath Suriol <tiglathsuriol@gmail.com>
First post2015-03-24 20:11 -0700
Last post2015-03-25 15:59 +1100
Articles 5 — 5 participants

Back to article view | Back to comp.lang.python


Contents

  test2 Tiglath Suriol <tiglathsuriol@gmail.com> - 2015-03-24 20:11 -0700
    Re: test2 Chris Angelico <rosuav@gmail.com> - 2015-03-25 14:22 +1100
      Re: test2 alister <alister.nospam.ware@ntlworld.com> - 2015-03-25 20:10 +0000
    Re: test2 Ryan Stuart <ryan.stuart.85@gmail.com> - 2015-03-25 14:55 +1000
    Re: test2 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-25 15:59 +1100

#87920 — test2

FromTiglath Suriol <tiglathsuriol@gmail.com>
Date2015-03-24 20:11 -0700
Subjecttest2
Message-ID<bc16920e-4c86-4662-b1d7-4d39806292a8@googlegroups.com>
# Django settings for ipdb project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', 'your_email@example.com'),
    ('jol', 'tegijjjlath.net'),
    ('totis', 'tis@oint.com'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE':    'django.db.backends.postgresql_psycopg2',
        'NAME':      'ipdb_db',        # Or path to database file if using sqlite3.
        'USER':      'ipdb',           # Not used with sqlite3.
        'PASSWORD':  'admin',          # Not used with sqlite3.
        'HOST':      'localhost',      # Set to empty string for localhost (NOT TRUE). Not used with sqlite3.
        'PORT':      '',               # Set to empty string for default. Not used with sqlite3.
    }
}

PROJECT_PATH = '/var/opt/ipdb/ipdb/' # this dir contains 'ipdb' and 'manage.py'
GEOIP_PATH   = PROJECT_PATH + '/ipdb/asset/geo'
AS_IPV4_PATH = PROJECT_PATH + '/ipdb/asset/geo/GeoIPASNum.dat'
AS_IPV6_PATH = PROJECT_PATH + '/ipdb/asset/geo/GeoIPASNumv6.dat'
RUN_DIR      = PROJECT_PATH + '/ipdb/asset/run'
LOCK_FILE    = PROJECT_PATH + '/ipdb/asset/crawler.pid'



# 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 = 'America/Atikokan'

# 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: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = PROJECT_PATH + '/ipdb/asset/media/'

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = '/media/'

# 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: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = PROJECT_PATH + '/ipdb/asset/static/'

#
#  Temporary client files.
#
FILE_UPLOAD_DIR = '/tmp/'

LOG_DIR = PROJECT_PATH + '/ipdb/asset/log/'

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
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.
)

# 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 = '42=kv!a-il*!4j&amp;7v+0(@a@vq_3j-+ysatta@l6-h63odj2)75'

# 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.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    # Uncomment the next line for simple clickjacking protection:
    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': '127.0.0.1:11211',
    }
}

SESSION_ENGINE = 'django.contrib.sessions.backends.cache'

ROOT_URLCONF = 'ipdb.urls'

# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'ipdb.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.
    PROJECT_PATH + '/ipdb/asset/templates', # Change this to your own directory.
)

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',
    'django.contrib.flatpages',
    'ipdb.asset',
    'registration',
)

# 
# Send logs to the console and to a file. 
#
LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'formatters': {
        'standard': {
            'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
            'datefmt' : "%d/%b/%Y %H:%M:%S"
        },
    },
    'handlers': {
        'null': {
            'level':'DEBUG',
            'class':'django.utils.log.NullHandler',
        },
        'logfile': {
            'level':'DEBUG',
            'class':'logging.handlers.RotatingFileHandler',
            'filename': LOG_DIR + "/ipdb.log",
            'maxBytes': 50000,
            'backupCount': 2,
            'formatter': 'standard',
        },
        'console':{
            'level':'DEBUG',
            'class':'logging.StreamHandler',
            'formatter': 'standard'
        },
    },
    'loggers': {
        'django': {
            'handlers':['console'],
            'propagate': True,
            'level':'DEBUG',
        },
        'django.db.backends': {
            'handlers': ['console'],
            'level': 'DEBUG',
            'propagate': False,
        }#from django.conf.urls.defaults import patterns, include, url
from django.conf import *
from django.conf.urls.static import static
from django.views.static import serve
from django.conf.urls import *
#from ip_db.views import ipdb_input_add, ipdb_input_start, ipdb_input_delete, ipdb_input_save, ipdb_api_add, ipdb_api_search
from asset.views import api_add, api_search,  gui_search, gui_add, ipdb_overview, api_file
from asset.utils.elastic_func import country_tally, grid, newest_to_oldest, country_tally_web_top10, country_tally_web, asset_tally
from django.http import HttpResponsePermanentRedirect
from django.shortcuts import render_to_response
from django.contrib import admin
admin.autodiscover()

import os

PROJECT_PATH = os.path.realpath(os.path.dirname(__file__))

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('asset.views',
    # Examples:
    # url(r'^$', 'ipdb.views.home', name='home'),
    # url(r'^ipdb/', include('ipdb.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    #(r'^accounts/', include('registration.urls')),
    (r'^$', lambda request: HttpResponsePermanentRedirect('/asset/overview')),
    (r'^heatmap/', country_tally),
    (r'^grid/',grid),
    (r'^nto/',newest_to_oldest),
    (r'^ctwtt/',country_tally_web_top10),
    (r'^ctw/',country_tally_web),
    (r'^at/',asset_tally),

     #(r'^/$', ipdb_overview), #Start
     #(r'^$', ipdb_overview), #Start
    (r'^asset/overview/$', ipdb_overview), #Start
    (r'^input/$', gui_add),
    (r'^search/$', gui_search),
    (r'^search$', gui_search),
    # (r'^delete/$', ipdb_input_delete),
    (r'^api/add/$', api_add), #check sensornet urls.py and views/sensors.py for cool tricks.
    (r'^api/search/$', api_search), #check sensornet urls.py and views/sensors.py for cool tricks.
    (r'^api/file/$', api_file),

    #(r'^asset/media/(?P<path>.*)$', 'django.views.static.serve', {'document_root':  os.path.join(PROJECT_PATH, '../asset/media')}),

    #(r'^ip_db/media/(?P<path>.*)$', 'django.views.static.serve', {'document_root':  os.path.join(PROJECT_PATH, 'ip_db/media')}),
    #(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root':  os.path.join(PROJECT_PATH, 'media')}),
    #(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root':  '/home/sensornet/static'}),

    # extjs4 stuff
    #(r'^asset/overview/extjs/(?P<path>.*)$', 'serve', {'document_root':  os.path.join(PROJECT_PATH, '../asset/extjs')}),
    #(r'^extjs/(?P<path>.*)$', 'django.views.static.serve', {'document_root':  os.path.join(PROJECT_PATH, '../ip_db/extjs')}),
    #(r'^extjs/(?P<path>.*)$', 'django.views.static.serve', {'document_root':  '/home/totis/tree/ipdb/django/ipdb/asset/static/extjs'}),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT),
        'ipdb.asset': {
            'handlers': ['console', 'logfile'],
            'level': 'DEBUG',
        },
    }
}

===========


[toc] | [next] | [standalone]


#87922

FromChris Angelico <rosuav@gmail.com>
Date2015-03-25 14:22 +1100
Message-ID<mailman.127.1427253751.10327.python-list@python.org>
In reply to#87920
On Wed, Mar 25, 2015 at 2:11 PM, Tiglath Suriol <tiglathsuriol@gmail.com> wrote:
> # Make this unique, and don't share it with anybody.
> SECRET_KEY = '42=kv!a-il*!4j&amp;7v+0(@a@vq_3j-+ysatta@l6-h63odj2)75'

This right here is a reason to send your test messages someplace other
than a huge, high-traffic mailing list!

ChrisA

[toc] | [prev] | [next] | [standalone]


#87976

Fromalister <alister.nospam.ware@ntlworld.com>
Date2015-03-25 20:10 +0000
Message-ID<mev4o6$d9l$2@speranza.aioe.org>
In reply to#87922
On Wed, 25 Mar 2015 14:22:23 +1100, Chris Angelico wrote:

> On Wed, Mar 25, 2015 at 2:11 PM, Tiglath Suriol
> <tiglathsuriol@gmail.com> wrote:
>> # Make this unique, and don't share it with anybody.
>> SECRET_KEY = '42=kv!a-il*!4j&amp;7v+0(@a@vq_3j-+ysatta@l6-h63odj2)75'
> 
> This right here is a reason to send your test messages someplace other
> than a huge, high-traffic mailing list!
> 
> ChrisA

:-)
is Nicos back?



-- 
Any given program will expand to fill available memory.

[toc] | [prev] | [next] | [standalone]


#87929

FromRyan Stuart <ryan.stuart.85@gmail.com>
Date2015-03-25 14:55 +1000
Message-ID<mailman.130.1427259366.10327.python-list@python.org>
In reply to#87920

[Multipart message — attachments visible in raw view] — view raw

On Wed, Mar 25, 2015 at 1:11 PM, Tiglath Suriol <tiglathsuriol@gmail.com>
wrote:

> # Make this unique, and don't share it with anybody.
>

.......


> SECRET_KEY = '42=kv!a-il*!4j&amp;7v+0(@a@vq_3j-+ysatta@l6-h63odj2)75'
>
> # 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.middleware.csrf.CsrfViewMiddleware',
>     'django.contrib.sessions.middleware.SessionMiddleware',
>     'django.contrib.auth.middleware.AuthenticationMiddleware',
>     'django.contrib.messages.middleware.MessageMiddleware',
>     # Uncomment the next line for simple clickjacking protection:
>     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> )
>
> CACHES = {
>     'default': {
>         'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
>         'LOCATION': '127.0.0.1:11211',
>     }
> }
>
> SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
>
> ROOT_URLCONF = 'ipdb.urls'
>
> # Python dotted path to the WSGI application used by Django's runserver.
> WSGI_APPLICATION = 'ipdb.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.
>     PROJECT_PATH + '/ipdb/asset/templates', # Change this to your own
> directory.
> )
>
> 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',
>     'django.contrib.flatpages',
>     'ipdb.asset',
>     'registration',
> )
>
> #
> # Send logs to the console and to a file.
> #
> LOGGING = {
>     'version': 1,
>     'disable_existing_loggers': True,
>     'formatters': {
>         'standard': {
>             'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s]
> %(message)s",
>             'datefmt' : "%d/%b/%Y %H:%M:%S"
>         },
>     },
>     'handlers': {
>         'null': {
>             'level':'DEBUG',
>             'class':'django.utils.log.NullHandler',
>         },
>         'logfile': {
>             'level':'DEBUG',
>             'class':'logging.handlers.RotatingFileHandler',
>             'filename': LOG_DIR + "/ipdb.log",
>             'maxBytes': 50000,
>             'backupCount': 2,
>             'formatter': 'standard',
>         },
>         'console':{
>             'level':'DEBUG',
>             'class':'logging.StreamHandler',
>             'formatter': 'standard'
>         },
>     },
>     'loggers': {
>         'django': {
>             'handlers':['console'],
>             'propagate': True,
>             'level':'DEBUG',
>         },
>         'django.db.backends': {
>             'handlers': ['console'],
>             'level': 'DEBUG',
>             'propagate': False,
>         }#from django.conf.urls.defaults import patterns, include, url
> from django.conf import *
> from django.conf.urls.static import static
> from django.views.static import serve
> from django.conf.urls import *
> #from ip_db.views import ipdb_input_add, ipdb_input_start,
> ipdb_input_delete, ipdb_input_save, ipdb_api_add, ipdb_api_search
> from asset.views import api_add, api_search,  gui_search, gui_add,
> ipdb_overview, api_file
> from asset.utils.elastic_func import country_tally, grid,
> newest_to_oldest, country_tally_web_top10, country_tally_web, asset_tally
> from django.http import HttpResponsePermanentRedirect
> from django.shortcuts import render_to_response
> from django.contrib import admin
> admin.autodiscover()
>
> import os
>
> PROJECT_PATH = os.path.realpath(os.path.dirname(__file__))
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('asset.views',
>     # Examples:
>     # url(r'^$', 'ipdb.views.home', name='home'),
>     # url(r'^ipdb/', include('ipdb.foo.urls')),
>
>     # Uncomment the admin/doc line below to enable admin documentation:
>
>     # Uncomment the next line to enable the admin:
>     url(r'^admin/', include(admin.site.urls)),
>     #(r'^accounts/', include('registration.urls')),
>     (r'^$', lambda request:
> HttpResponsePermanentRedirect('/asset/overview')),
>     (r'^heatmap/', country_tally),
>     (r'^grid/',grid),
>     (r'^nto/',newest_to_oldest),
>     (r'^ctwtt/',country_tally_web_top10),
>     (r'^ctw/',country_tally_web),
>     (r'^at/',asset_tally),
>
>      #(r'^/$', ipdb_overview), #Start
>      #(r'^$', ipdb_overview), #Start
>     (r'^asset/overview/$', ipdb_overview), #Start
>     (r'^input/$', gui_add),
>     (r'^search/$', gui_search),
>     (r'^search$', gui_search),
>     # (r'^delete/$', ipdb_input_delete),
>     (r'^api/add/$', api_add), #check sensornet urls.py and
> views/sensors.py for cool tricks.
>     (r'^api/search/$', api_search), #check sensornet urls.py and
> views/sensors.py for cool tricks.
>     (r'^api/file/$', api_file),
>
>     #(r'^asset/media/(?P<path>.*)$', 'django.views.static.serve',
> {'document_root':  os.path.join(PROJECT_PATH, '../asset/media')}),
>
>     #(r'^ip_db/media/(?P<path>.*)$', 'django.views.static.serve',
> {'document_root':  os.path.join(PROJECT_PATH, 'ip_db/media')}),
>     #(r'^media/(?P<path>.*)$', 'django.views.static.serve',
> {'document_root':  os.path.join(PROJECT_PATH, 'media')}),
>     #(r'^static/(?P<path>.*)$', 'django.views.static.serve',
> {'document_root':  '/home/sensornet/static'}),
>
>     # extjs4 stuff
>     #(r'^asset/overview/extjs/(?P<path>.*)$', 'serve', {'document_root':
> os.path.join(PROJECT_PATH, '../asset/extjs')}),
>     #(r'^extjs/(?P<path>.*)$', 'django.views.static.serve',
> {'document_root':  os.path.join(PROJECT_PATH, '../ip_db/extjs')}),
>     #(r'^extjs/(?P<path>.*)$', 'django.views.static.serve',
> {'document_root':  '/home/totis/tree/ipdb/django/ipdb/asset/static/extjs'}),
> ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT),
>         'ipdb.asset': {
>             'handlers': ['console', 'logfile'],
>             'level': 'DEBUG',
>         },
>     }
> }
>
> ===========
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Ryan Stuart, B.Eng
Software Engineer

ABN: 81-206-082-133
W: http://www.textisbeautiful.net/
M: +61-431-299-036

[toc] | [prev] | [next] | [standalone]


#87930

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2015-03-25 15:59 +1100
Message-ID<5512409a$0$12916$c3e8da3$5496439d@news.astraweb.com>
In reply to#87920
On Wednesday 25 March 2015 14:11, Tiglath Suriol wrote:

> # Make this unique, and don't share it with anybody.
> SECRET_KEY = '42=kv!a-il*!4j&amp;7v+0(@a@vq_3j-+ysatta@l6-h63odj2)75'

You'll need to change the comment to say

"don't share it with anybody unless they have an internet connection."



-- 
Steven

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web