Skip to content

Commit

Permalink
intial work on updating the platform
Browse files Browse the repository at this point in the history
  • Loading branch information
SidneyNiccolson committed Jul 4, 2019
1 parent 1dd7329 commit 1113dd7
Show file tree
Hide file tree
Showing 12,455 changed files with 33,492 additions and 5,171,108 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
10 changes: 0 additions & 10 deletions .eslintrc

This file was deleted.

9 changes: 0 additions & 9 deletions .flowconfig

This file was deleted.

3 changes: 3 additions & 0 deletions CMLMasterProject/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .celery import app as celery_app

__all__ = ['celery_app']
Binary file modified CMLMasterProject/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file added CMLMasterProject/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file added CMLMasterProject/__pycache__/celery.cpython-35.pyc
Binary file not shown.
Binary file added CMLMasterProject/__pycache__/celery.cpython-37.pyc
Binary file not shown.
Binary file added CMLMasterProject/__pycache__/forms.cpython-37.pyc
Binary file not shown.
Binary file not shown.
Binary file modified CMLMasterProject/__pycache__/settings.cpython-35.pyc
Binary file not shown.
Binary file not shown.
Binary file modified CMLMasterProject/__pycache__/urls.cpython-35.pyc
Binary file not shown.
Binary file added CMLMasterProject/__pycache__/urls.cpython-37.pyc
Binary file not shown.
Binary file modified CMLMasterProject/__pycache__/views.cpython-35.pyc
Binary file not shown.
Binary file added CMLMasterProject/__pycache__/views.cpython-37.pyc
Binary file not shown.
Binary file added CMLMasterProject/__pycache__/wsgi.cpython-37.pyc
Binary file not shown.
9 changes: 9 additions & 0 deletions CMLMasterProject/celery.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os
from celery import Celery


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

app = Celery('CMLMasterProject')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions CMLMasterProject/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from django.db.models.signals import post_save
from django.dispatch import receiver

from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailadmin.edit_handlers import FieldPanel
from wagtail.core.models import Page
from wagtail.core.fields import RichTextField
from wagtail.admin.edit_handlers import FieldPanel
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
topics = models.TextField(max_length=254, blank=True)
Expand Down
74 changes: 48 additions & 26 deletions CMLMasterProject/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
TEMPLATE_PATH = os.path.join(PROJECT_PATH, 'templates')
#get the static directory for images etc
STATIC_PATH = os.path.join(PROJECT_PATH, 'static')

STATIC_ROOT = os.path.join(STATIC_PATH, 'collectStaticAssets' )
STATIC_URL = '/static/'

#onServer for collectstatic
#STATIC_ROOT = os.path.join(STATIC_PATH, 'collectStaticAssets' )
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
Expand All @@ -44,6 +45,7 @@
)


#Webpack for REACT (GUI library and more support for JS libraries dependency tracking) purposes
WEBPACK_LOADER = {
'DEFAULT': {
'BUNDLE_DIR_NAME': 'bundles/',
Expand All @@ -53,20 +55,34 @@
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/

#celery
CELERY_BROKER_URL = 'amqp://localhost'


# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = yamjam()['CMLMasterProject']['django-secret-key']
AUTHENTICATION_KEY_RESEARCH = yamjam()['CMLMasterProject']['cml-research-key']
AUTHENTICATION_KEY_STUDENT = yamjam()['CMLMasterProject']['cml-student-key']
#ON SERVER
#cfg = yamjam('/home/cml_platform/.yamjam/config.yaml')
#yam_config = cfg['CMLMasterProject']
#ON SERVER
#SECRET_KEY = yam_config['django-secret-key']
#AUTHENTICATION_KEY_RESEARCH = yam_config['cml-research-key']
#AUTHENTICATION_KEY_STUDENT = yam_config['cml-student-key']


# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
#on server
#DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1', 'localhost']
#DEBUG = yam_config['debug']


ALLOWED_HOSTS = ['127.0.0.1', 'localhost', '132.229.201.249']
#on server
#ALLOWED_HOSTS = []
#ALLOWED_HOSTS = ['*']

# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
Expand All @@ -81,29 +97,28 @@
'bootstrapform',
'CMLMasterProject',
#wigtail CMS apps
'wagtail.wagtailforms',
'wagtail.wagtailredirects',
'wagtail.wagtailembeds',
'wagtail.wagtailsites',
'wagtail.wagtailusers',
'wagtail.wagtailsnippets',
'wagtail.wagtaildocs',
'wagtail.wagtailimages',
'wagtail.wagtailsearch',
'wagtail.wagtailadmin',
'wagtail.wagtailcore',
'wagtail.contrib.forms',
'wagtail.contrib.redirects',
'wagtail.embeds',
'wagtail.sites',
'wagtail.users',
'wagtail.snippets',
'wagtail.documents',
'wagtail.images',
'wagtail.search',
'wagtail.admin',
'wagtail.core',


'modelcluster',
'taggit',
'CMS',
"wagtail.contrib.table_block",
'MicroVis',
'books',
'widget_tweaks',
'rest_framework',
'snippets.apps.SnippetsConfig',
'webpack_loader',
'ramascene'
'webpack_loader'

]

Expand All @@ -116,8 +131,8 @@
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
#wigtail CMS
'wagtail.wagtailcore.middleware.SiteMiddleware',
'wagtail.wagtailredirects.middleware.RedirectMiddleware',
'wagtail.core.middleware.SiteMiddleware',
'wagtail.contrib.redirects.middleware.RedirectMiddleware',

]

Expand Down Expand Up @@ -151,8 +166,15 @@
'NAME': os.path.join(BASE_DIR, yamjam()['CMLMasterProject']['database']['name']),
}
}


#ONSERVER
'''
DATABASES = {
'default': {
'ENGINE': yam_config['database']['engine'],
'NAME': os.path.join(BASE_DIR, yam_config['database']['name']),
}
}
'''
# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators

Expand Down Expand Up @@ -208,7 +230,7 @@
# Examples: "http://example.com/media/", "http://media.example.com/"
MEDIA_URL = '/media/'
#for server!!
#MEDIA_URL = '/platform/media/'
#MEDIA_URL = '/Core/media/' -> THIS MIGHT NOT BE NEEDED ANYMORE SO USE /media/ DIRECTLY
#exiovisuals
PATH_HDF5 = "/home/sidney/exiovis_db_original/exiovis/"
#temp on server
Expand All @@ -217,6 +239,6 @@
#login -> redirect to home
LOGIN_REDIRECT_URL = '/'
#for server !!
#LOGIN_REDIRECT_URL = '/platform/'
#LOGIN_REDIRECT_URL = '/platform/' -> THIS MIGHT NOT BE NEEDED ANYMORE SO USE '/' DIRECTLY
#wagtail site name of dashboard admin
WAGTAIL_SITE_NAME = 'CML\'s'
13 changes: 6 additions & 7 deletions CMLMasterProject/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,20 @@
from django.conf import settings
from django.views.static import serve
from django.contrib.auth import views as auth_views
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtaildocs import urls as wagtaildocs_urls
from wagtail.wagtailcore import urls as wagtail_urls
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.documents import urls as wagtaildocs_urls
from wagtail.core import urls as wagtail_urls
from django.conf.urls.static import static
urlpatterns = [
url(r'^$', views.homePage, name='homePage'),
url(r'^login/$', auth_views.login,{'template_name': 'CMLMasterProject/login.html'}, name='login'),
url(r'^logout/$', auth_views.logout, {'next_page': '/'}, name='logout'),
url(r'^login/$', auth_views.LoginView,{'template_name': 'CMLMasterProject/login.html'}, name='login'),
url(r'^logout/$', auth_views.LogoutView, {'next_page': '/'}, name='logout'),
url(r'^admin/', admin.site.urls),
url(r'^exploratory/', views.exploratory, name='exploratory'),
url(r'^', include('snippets.urls')),
url(r'^', include('ramascene.urls')),

url(r'^puma/', include('PUMA.urls')),
url(r'^books/', include('books.urls')),
url(r'^media/(?P<path>.*)$', serve, {
'document_root': settings.MEDIA_ROOT,
}),
Expand All @@ -44,4 +43,4 @@
url(r'^cms-admin/', include(wagtailadmin_urls)),
url(r'^documents/', include(wagtaildocs_urls)),
url(r'^research/', include(wagtail_urls)),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
14 changes: 11 additions & 3 deletions CMLMasterProject/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,31 @@
def homePage(request):
context_dict = {}
username = None
if request.user.is_authenticated():
if request.user.is_authenticated:
username = request.user.username
#special for cml researcher to get info to be used later
context_dict.update({'username': username})


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

def exploratory(request):
context_dict = {}
username = None
if request.user.is_authenticated:
username = request.user.username
#special for cml researcher to get info to be used later
context_dict.update({'username': username})
return render(request, 'CMLMasterProject/explore.html', context_dict)

def about(request):
context_dict = {}
username = None
if request.user.is_authenticated():
username = request.user.username
#special for cml researcher to get info to be used later
context_dict.update({'username': username})
return render(request, 'CMLMasterProject/visuals.html', context_dict)
return render(request, 'CMLMasterProject/about.html', context_dict)

#default signup method for decisionmakers and companies
def signup(request):
Expand Down
15 changes: 7 additions & 8 deletions CMS/models.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from __future__ import unicode_literals
from django.db import models
from wagtail.wagtailcore.models import Page, Orderable
from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailadmin.edit_handlers import FieldPanel
from wagtail.wagtailsearch import index
from wagtail.core.models import Page, Orderable
from wagtail.core.fields import RichTextField
from wagtail.admin.edit_handlers import FieldPanel
from wagtail.search import index
from django.contrib.auth.models import User
from modelcluster.fields import ParentalKey
from wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel, MultiFieldPanel,StreamFieldPanel
from wagtail.admin.edit_handlers import FieldPanel, InlinePanel, MultiFieldPanel,StreamFieldPanel
from taggit.models import TaggedItemBase
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
from wagtail.images.edit_handlers import ImageChooserPanel
from modelcluster.tags import ClusterTaggableManager
from wagtail.contrib.table_block.blocks import TableBlock
from wagtail.wagtailcore.fields import StreamField
from wagtail.core.fields import StreamField
class HomePage(Page):
#set a custom context for the usage as template tags in the html
def get_context(self, request):
Expand Down Expand Up @@ -166,4 +166,3 @@ def get_context(self, request):
StreamFieldPanel('content')
]


13 changes: 0 additions & 13 deletions DEADJOE

This file was deleted.

Binary file added ExioVisuals/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file added ExioVisuals/__pycache__/admin.cpython-37.pyc
Binary file not shown.
Binary file modified ExioVisuals/__pycache__/forms.cpython-35.pyc
Binary file not shown.
Binary file added ExioVisuals/__pycache__/forms.cpython-37.pyc
Binary file not shown.
Binary file added ExioVisuals/__pycache__/models.cpython-37.pyc
Binary file not shown.
Binary file modified ExioVisuals/__pycache__/urls.cpython-35.pyc
Binary file not shown.
Binary file added ExioVisuals/__pycache__/urls.cpython-37.pyc
Binary file not shown.
Binary file added ExioVisuals/__pycache__/widgets.cpython-37.pyc
Binary file not shown.
Loading

0 comments on commit 1113dd7

Please sign in to comment.