Skip to content

Commit 04dfdcc

Browse files
author
Aishwarya
committed
analytics: initial commit
0 parents  commit 04dfdcc

File tree

11 files changed

+251
-0
lines changed

11 files changed

+251
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pyc

analytics/__init__.py

Whitespace-only changes.

analytics/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.db import models
2+
3+
# Create your models here.

analytics/tests.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
This file demonstrates writing tests using the unittest module. These will pass
3+
when you run "manage.py test".
4+
5+
Replace this with more appropriate tests for your application.
6+
"""
7+
8+
from django.test import TestCase
9+
10+
11+
class SimpleTest(TestCase):
12+
def test_basic_addition(self):
13+
"""
14+
Tests that 1 + 1 always equals 2.
15+
"""
16+
self.assertEqual(1 + 1, 2)

analytics/views.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.shortcuts import render_to_response
2+
3+
# Create your views here.
4+
def home(request):
5+
template = 'analytics/index.html'
6+
ctx = {}
7+
return render_to_response(template, ctx)

djangothon/__init__.py

Whitespace-only changes.

djangothon/settings.py

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
import os
2+
3+
SETTINGS_DIR = os.path.join(os.path.dirname(__file__), os.pardir)
4+
PROJECT_ROOT = os.path.abspath(os.path.join(SETTINGS_DIR))
5+
6+
print SETTINGS_DIR
7+
print PROJECT_ROOT
8+
9+
# Django settings for analytics project.
10+
11+
DEBUG = True
12+
TEMPLATE_DEBUG = DEBUG
13+
14+
ADMINS = (
15+
# ('Your Name', '[email protected]'),
16+
)
17+
18+
MANAGERS = ADMINS
19+
20+
DATABASES = {
21+
'default': {
22+
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
23+
'NAME': 'careerstack', # Or path to database file if using sqlite3.
24+
'USER': 'testuser', # Not used with sqlite3.
25+
'PASSWORD': 'test123', # Not used with sqlite3.
26+
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
27+
'PORT': '', # Set to empty string for default. Not used with sqlite3.
28+
}
29+
}
30+
31+
# Local time zone for this installation. Choices can be found here:
32+
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
33+
# although not all choices may be available on all operating systems.
34+
# In a Windows environment this must be set to your system time zone.
35+
TIME_ZONE = 'Asia/Kolkata'
36+
37+
# Language code for this installation. All choices can be found here:
38+
# http://www.i18nguy.com/unicode/language-identifiers.html
39+
LANGUAGE_CODE = 'en-us'
40+
41+
SITE_ID = 1
42+
43+
# If you set this to False, Django will make some optimizations so as not
44+
# to load the internationalization machinery.
45+
USE_I18N = True
46+
47+
# If you set this to False, Django will not format dates, numbers and
48+
# calendars according to the current locale.
49+
USE_L10N = True
50+
51+
# If you set this to False, Django will not use timezone-aware datetimes.
52+
USE_TZ = True
53+
54+
# Absolute filesystem path to the directory that will hold user-uploaded files.
55+
# Example: "/home/media/media.lawrence.com/media/"
56+
MEDIA_ROOT = ''
57+
58+
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
59+
# trailing slash.
60+
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
61+
MEDIA_URL = ''
62+
63+
# Absolute path to the directory static files should be collected to.
64+
# Don't put anything in this directory yourself; store your static files
65+
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
66+
# Example: "/home/media/media.lawrence.com/static/"
67+
STATIC_ROOT = ''
68+
69+
# URL prefix for static files.
70+
# Example: "http://media.lawrence.com/static/"
71+
STATIC_URL = '/static/'
72+
73+
# Additional locations of static files
74+
STATICFILES_DIRS = (
75+
# Put strings here, like "/home/html/static" or "C:/www/django/static".
76+
# Always use forward slashes, even on Windows.
77+
# Don't forget to use absolute paths, not relative paths.
78+
)
79+
80+
# List of finder classes that know how to find static files in
81+
# various locations.
82+
STATICFILES_FINDERS = (
83+
'django.contrib.staticfiles.finders.FileSystemFinder',
84+
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
85+
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
86+
)
87+
88+
# Make this unique, and don't share it with anybody.
89+
SECRET_KEY = '8gy*pc&7i%0r@fxn%bas1+hp1lpmc-vtycer_l=o)r(yp)9*h_'
90+
91+
# List of callables that know how to import templates from various sources.
92+
TEMPLATE_LOADERS = (
93+
'django.template.loaders.filesystem.Loader',
94+
'django.template.loaders.app_directories.Loader',
95+
# 'django.template.loaders.eggs.Loader',
96+
)
97+
98+
MIDDLEWARE_CLASSES = (
99+
'django.middleware.common.CommonMiddleware',
100+
'django.contrib.sessions.middleware.SessionMiddleware',
101+
'django.middleware.csrf.CsrfViewMiddleware',
102+
'django.contrib.auth.middleware.AuthenticationMiddleware',
103+
'django.contrib.messages.middleware.MessageMiddleware',
104+
# Uncomment the next line for simple clickjacking protection:
105+
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
106+
)
107+
108+
ROOT_URLCONF = 'djangothon.urls'
109+
110+
# Python dotted path to the WSGI application used by Django's runserver.
111+
WSGI_APPLICATION = 'djangothon.wsgi.application'
112+
113+
TEMPLATES_PATH = os.path.join(PROJECT_ROOT, "templates")
114+
TEMPLATE_DIRS = (
115+
TEMPLATES_PATH,
116+
)
117+
118+
INSTALLED_APPS = (
119+
'django.contrib.auth',
120+
'django.contrib.contenttypes',
121+
'django.contrib.sessions',
122+
'django.contrib.sites',
123+
'django.contrib.messages',
124+
'django.contrib.staticfiles',
125+
'analytics',
126+
# Uncomment the next line to enable the admin:
127+
# 'django.contrib.admin',
128+
# Uncomment the next line to enable admin documentation:
129+
# 'django.contrib.admindocs',
130+
)
131+
132+
# A sample logging configuration. The only tangible logging
133+
# performed by this configuration is to send an email to
134+
# the site admins on every HTTP 500 error when DEBUG=False.
135+
# See http://docs.djangoproject.com/en/dev/topics/logging for
136+
# more details on how to customize your logging configuration.
137+
LOGGING = {
138+
'version': 1,
139+
'disable_existing_loggers': False,
140+
'filters': {
141+
'require_debug_false': {
142+
'()': 'django.utils.log.RequireDebugFalse'
143+
}
144+
},
145+
'handlers': {
146+
'mail_admins': {
147+
'level': 'ERROR',
148+
'filters': ['require_debug_false'],
149+
'class': 'django.utils.log.AdminEmailHandler'
150+
}
151+
},
152+
'loggers': {
153+
'django.request': {
154+
'handlers': ['mail_admins'],
155+
'level': 'ERROR',
156+
'propagate': True,
157+
},
158+
}
159+
}

djangothon/urls.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from django.conf.urls import patterns, include, url
2+
3+
# Uncomment the next two lines to enable the admin:
4+
# from django.contrib import admin
5+
# admin.autodiscover()
6+
7+
urlpatterns = patterns('',
8+
# Examples:
9+
url(r'^$', 'analytics.views.home', name='home'),
10+
#url(r'^analytics/', include('analytics.foo.urls')),
11+
12+
# Uncomment the admin/doc line below to enable admin documentation:
13+
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
14+
15+
# Uncomment the next line to enable the admin:
16+
# url(r'^admin/', include(admin.site.urls)),
17+
)

djangothon/wsgi.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""
2+
WSGI config for analytics project.
3+
4+
This module contains the WSGI application used by Django's development server
5+
and any production WSGI deployments. It should expose a module-level variable
6+
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
7+
this application via the ``WSGI_APPLICATION`` setting.
8+
9+
Usually you will have the standard Django WSGI application here, but it also
10+
might make sense to replace the whole Django WSGI application with a custom one
11+
that later delegates to the Django one. For example, you could introduce WSGI
12+
middleware here, or combine a Django application with an application of another
13+
framework.
14+
15+
"""
16+
import os
17+
18+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangothon.settings")
19+
20+
# This application object is used by any WSGI server configured to use this
21+
# file. This includes Django's development server, if the WSGI_APPLICATION
22+
# setting points here.
23+
from django.core.wsgi import get_wsgi_application
24+
application = get_wsgi_application()
25+
26+
# Apply WSGI middleware here.
27+
# from helloworld.wsgi import HelloWorldApplication
28+
# application = HelloWorldApplication(application)

manage.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python
2+
import os
3+
import sys
4+
5+
if __name__ == "__main__":
6+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangothon.settings")
7+
8+
from django.core.management import execute_from_command_line
9+
10+
execute_from_command_line(sys.argv)

0 commit comments

Comments
 (0)