Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SidneyNiccolson committed Jun 9, 2017
0 parents commit d2e443f
Show file tree
Hide file tree
Showing 229 changed files with 62,276 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .idea/CMLMasterProject.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

944 changes: 944 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Empty file added CMLMasterProject/__init__.py
Empty file.
Binary file added CMLMasterProject/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file not shown.
Binary file added CMLMasterProject/__pycache__/urls.cpython-35.pyc
Binary file not shown.
Binary file added CMLMasterProject/__pycache__/views.cpython-35.pyc
Binary file not shown.
Binary file added CMLMasterProject/__pycache__/wsgi.cpython-35.pyc
Binary file not shown.
168 changes: 168 additions & 0 deletions CMLMasterProject/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
"""
Django settings for CMLMasterProject project.
Generated by 'django-admin startproject' using Django 1.11.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_ROOT = os.path.abspath(
os.path.join(os.path.dirname(__file__), ".."),
)
#GET ALL THE PATHS NEEDED
#relative paths for telling the project where templates are house or other special directories
#-getting the location of the settings.py file minus the file itself offcourse
SETTINGS_DIR = os.path.dirname(__file__)
#Go one level up to retrieve the projects directory
PROJECT_PATH = os.path.join(SETTINGS_DIR, os.pardir)
PROJECT_PATH = os.path.abspath(PROJECT_PATH)
#create the actual template link to tell the project were the template is
TEMPLATE_PATH = os.path.join(PROJECT_PATH, 'templates')
#get the static directory for images etc
STATIC_PATH = os.path.join(PROJECT_PATH, '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.
STATIC_PATH,
)

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '&h-9wo-tlw5^3p4_1sk&2mjfqph2%@(d99kgr###^%p$ly!+f@'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['127.0.0.1']


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'PUMA',
'leaflet',
'djgeojson',
'ExioVisuals',
'bootstrapform',

]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'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 = 'CMLMasterProject.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [TEMPLATE_PATH],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'CMLMasterProject.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

#PUMA CONFIGURATIONS
LEAFLET_CONFIG = {

# 'SPATIAL_EXTENT': (4.9597, 52.4551, 4.9, 52.3372),


#'MINIMAP': True,
'ATTRIBUTION_PREFIX': 'Powered by django-leaflet & IE-SoftLab',

#'RESET_VIEW': False
}

#media stuff
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/var/www/example.com/media/"
MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
#above defines where media files uploaded should be stored

# 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 = '../../media/'

#exiovisuals
PATH_HDF5 = "/home/sidney/exiovis_db_original/exiovis/"
30 changes: 30 additions & 0 deletions CMLMasterProject/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""CMLMasterProject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from django.contrib import admin
import CMLMasterProject.views as views
from django.conf import settings
from django.views.static import serve
urlpatterns = [
url(r'^$', views.homePage, name='homePage'),
url(r'^admin/', admin.site.urls),
url(r'^visuals/', views.visuals, name='visuals'),
url(r'^puma/', include('PUMA.urls')),
url(r'^media/(?P<path>.*)$', serve, {
'document_root': settings.MEDIA_ROOT,
}),
url(r'^exiovisuals/', include('ExioVisuals.urls')),
]
10 changes: 10 additions & 0 deletions CMLMasterProject/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.shortcuts import render
#this is the first page of the Web-app
def homePage(request):


#return render_to_response('/IEMasterProject/HomePage.html', context_dict, context)
return render(request,'CMLMasterProject/HomePage.html')

def visuals(request):
return render(request, 'CMLMasterProject/visuals.html')
16 changes: 16 additions & 0 deletions CMLMasterProject/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for CMLMasterProject 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.11/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CMLMasterProject.settings")

application = get_wsgi_application()
Empty file added ExioVisuals/__init__.py
Empty file.
Binary file added ExioVisuals/__init__.pyc
Binary file not shown.
Binary file added ExioVisuals/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file added ExioVisuals/__pycache__/admin.cpython-35.pyc
Binary file not shown.
Binary file added ExioVisuals/__pycache__/forms.cpython-35.pyc
Binary file not shown.
Binary file added ExioVisuals/__pycache__/models.cpython-35.pyc
Binary file not shown.
Binary file added ExioVisuals/__pycache__/urls.cpython-35.pyc
Binary file not shown.
Binary file added ExioVisuals/__pycache__/widgets.cpython-35.pyc
Binary file not shown.
44 changes: 44 additions & 0 deletions ExioVisuals/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from django.contrib import admin
# Import the UserProfile model individually.

# Import the UserProfile model with Category and Page.
# If you choose this option, you'll want to modify the import statement you've already got to include UserProfile.
from ExioVisuals.models import GhgEmissions
# admin.py
from leaflet.admin import LeafletGeoAdmin
from django.contrib import admin
from ExioVisuals.models import Product, Country, years, Substance,YearF
#register the GHG emission table so we can see it in the administration

admin.site.register(GhgEmissions)


class ProductAdminOption(admin.ModelAdmin):
list_display = ("get_repr", "get_tree")
ordering = ("url",)
search_fields = ('name', )


class CountryAdminOption(admin.ModelAdmin):
list_display = ("get_repr", "get_tree")
ordering = ("url",)
search_fields = ('name', )


class SubstanceAdminOption(admin.ModelAdmin):
list_display = ("get_repr", "get_tree")
ordering = ("url",)
search_fields = ('name', )

class YearsAdminOption(admin.ModelAdmin):
list_display = ("get_repr", "get_tree")
ordering = ("url",)
search_fields = ('name', )



admin.site.register(Product, ProductAdminOption)
admin.site.register(Country, CountryAdminOption)
admin.site.register(Substance, SubstanceAdminOption)
admin.site.register(years)
admin.site.register(YearF, YearsAdminOption)
Binary file added ExioVisuals/admin.pyc
Binary file not shown.
7 changes: 7 additions & 0 deletions ExioVisuals/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from __future__ import unicode_literals

from django.apps import AppConfig


class ExiovisualsConfig(AppConfig):
name = 'ExioVisuals'
Loading

0 comments on commit d2e443f

Please sign in to comment.