From a4ab7e6f3e9e3f4924e3f1fdb85519de0557f370 Mon Sep 17 00:00:00 2001 From: Ray Slakinski Date: Tue, 12 Nov 2013 14:47:51 -0800 Subject: [PATCH] adding a sample project --- manage.py | 10 +++++ nasa/__init__.py | 0 nasa/settings.py | 83 ++++++++++++++++++++++++++++++++++++++++ nasa/urls.py | 12 ++++++ nasa/wsgi.py | 14 +++++++ viz/__init__.py | 0 viz/admin.py | 3 ++ viz/models.py | 3 ++ viz/templates/index.html | 1 + viz/tests.py | 3 ++ viz/views.py | 6 +++ 11 files changed, 135 insertions(+) create mode 100755 manage.py create mode 100644 nasa/__init__.py create mode 100644 nasa/settings.py create mode 100644 nasa/urls.py create mode 100644 nasa/wsgi.py create mode 100644 viz/__init__.py create mode 100644 viz/admin.py create mode 100644 viz/models.py create mode 100644 viz/templates/index.html create mode 100644 viz/tests.py create mode 100644 viz/views.py diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..40afe5c --- /dev/null +++ b/manage.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "nasa.settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/nasa/__init__.py b/nasa/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/nasa/settings.py b/nasa/settings.py new file mode 100644 index 0000000..92db1cc --- /dev/null +++ b/nasa/settings.py @@ -0,0 +1,83 @@ +""" +Django settings for nasa project. + +For more information on this file, see +https://docs.djangoproject.com/en/1.6/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.6/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/1.6/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'fkz^jwf6c)zq!)h(*@_$yh#qc3n+3cr)mta)1z)1(jr*$#e&&6' + +# 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', + 'viz' +) + +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 = 'nasa.urls' + +WSGI_APPLICATION = 'nasa.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/1.6/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + +# Internationalization +# https://docs.djangoproject.com/en/1.6/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/1.6/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/nasa/urls.py b/nasa/urls.py new file mode 100644 index 0000000..4795c8b --- /dev/null +++ b/nasa/urls.py @@ -0,0 +1,12 @@ +from django.conf.urls import patterns, include, url + +from django.contrib import admin +admin.autodiscover() + +from viz import views + + +urlpatterns = patterns('', + url(r'^$', views.index, name='index'), + url(r'^admin/', include(admin.site.urls)), +) diff --git a/nasa/wsgi.py b/nasa/wsgi.py new file mode 100644 index 0000000..e60a824 --- /dev/null +++ b/nasa/wsgi.py @@ -0,0 +1,14 @@ +""" +WSGI config for nasa 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/1.6/howto/deployment/wsgi/ +""" + +import os +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "nasa.settings") + +from django.core.wsgi import get_wsgi_application +application = get_wsgi_application() diff --git a/viz/__init__.py b/viz/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/viz/admin.py b/viz/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/viz/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/viz/models.py b/viz/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/viz/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/viz/templates/index.html b/viz/templates/index.html new file mode 100644 index 0000000..43904b6 --- /dev/null +++ b/viz/templates/index.html @@ -0,0 +1 @@ +Hello, world. You're at the viz index. diff --git a/viz/tests.py b/viz/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/viz/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/viz/views.py b/viz/views.py new file mode 100644 index 0000000..fea0e47 --- /dev/null +++ b/viz/views.py @@ -0,0 +1,6 @@ +from django.shortcuts import render + + +def index(request): + context = {} + return render(request, 'index.html', context)