Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
db9da26
Change placeholder width
Sep 19, 2019
867743f
Update README.md
tomjmwang Sep 20, 2019
1566599
Update README.md
tomjmwang Sep 20, 2019
cf0341c
Add animation to the voting UI
Sep 20, 2019
a386297
Fixed a bug that the placeholder don't have enough width in method on…
Sep 21, 2019
41b95ac
Create a new app mentors
Oct 21, 2019
6563745
Add a new css file for form submission
Oct 21, 2019
242c5fc
Add a new column for mentor application
Oct 21, 2019
21d7369
Add matching simulation
Nov 10, 2019
b72e8c2
change css
Nov 10, 2019
f3ab2cc
Fix bugs in the simualtion round
Nov 11, 2019
8773fff
Fix bugs in the simualtion round
Nov 12, 2019
afe7e87
bug fixed
Nov 13, 2019
f665a64
bug fixed
Nov 13, 2019
8ef8037
fix bugs of form
Nov 13, 2019
c112c6b
Redirect the matching result to the HTML page
Nov 14, 2019
976c131
Add feature sliders that can be modified by the prof
Nov 16, 2019
c16058a
Change the student application form to multipage
Nov 16, 2019
2e54887
add new js for mentor system
Nov 19, 2019
3e462ce
add new css for mentor system
Nov 19, 2019
8024e84
Visual Changes & Time slots
Nov 21, 2019
76c0cf3
changes
Nov 21, 2019
ebd6d5f
changes
Nov 21, 2019
72e294b
Add new app crispy form
Nov 22, 2019
f9d832a
updated readme
starwarswii Nov 22, 2019
bee2379
Update README.md
starwarswii Nov 22, 2019
1d7f6cc
added a basic banner on the main page
starwarswii Nov 22, 2019
80b59e4
Merge branch 'master' of https://github.com/ReedyChen/opra
starwarswii Nov 22, 2019
30572e3
Link mentor app to each account
Nov 23, 2019
01f1ede
Link mentor app to each account
Nov 23, 2019
42803e2
Merge branch 'master' of https://github.com/ReedyChen/opra
Nov 23, 2019
71cd7c9
Reverse Changes
Nov 23, 2019
fb86c58
Visual Changes
Nov 23, 2019
7022a1a
change cache
Nov 23, 2019
daa8149
changes
Nov 23, 2019
d7ac80e
Add page lock to prevent form crash
Nov 24, 2019
9731b8d
Bugs fix
Nov 24, 2019
d7a0446
Change csv file update from local
Nov 25, 2019
c9a2973
Bug fixed
Nov 25, 2019
9d9c885
Finalize
Nov 25, 2019
894663d
Finalize
Nov 25, 2019
cd815fd
Add junming to admin
Nov 25, 2019
0841fe2
Merge branch 'master' into master
tomjmwang Nov 25, 2019
05d9268
Make new migrations
Nov 25, 2019
07ea198
Make new migrations
Nov 25, 2019
0aecd6e
Make another migrations
Nov 25, 2019
647f7c4
Migration change
Nov 25, 2019
bde3d4b
change admin
Nov 25, 2019
e79e603
updated match.py to fix bug
starwarswii Dec 18, 2019
ac0b29d
removed match_change.py
starwarswii Dec 18, 2019
c2841b6
Merge remote-tracking branch 'upstream/master'
starwarswii Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,15 +29,17 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:

5. Clone this project from Github

6. Copy settings.py from opra_dependencies to compsocsite/compsocsite. Copy opra_crypto.py from opra_dependencies to compsocsite/polls.
6. ~~Copy settings.py from opra_dependencies to compsocsite/compsocsite.~~ (an updated settings.py is now included.) Copy opra_crypto.py from opra_dependencies to compsocsite/polls.

6.5. For testing locally, edit compsocsite/appauth/views.py and find-replace `https://opra.cs.rpi.edu` with `http://127.0.0.1:8000`

7. Open command line (terminal), change to OPRA's directory, and then enter the following commands:

<code>cd composcite</code>

<code>python manage.py migrate</code>

<code>python manage.py createcachetable</code>
```
cd composcite
python manage.py migrate
python manage.py createcachetable
```

Then run the server by entering:

Expand All@@ -58,6 +60,7 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:
* **scipy**:
* **numpy**:
* **networkx**:
* **django-crispy-forms**:
* **django-mathfilters**:
* **matplotlib**:

Expand Down
25 changes: 25 additions & 0 deletions compsocsite/appauth/migrations/0018_auto_20191125_0156.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
# Generated by Django 2.2 on 2019-11-25 06:56

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('mentors', '0001_initial'),
('appauth', '0017_userprofile_exp_data'),
]

operations = [
migrations.AddField(
model_name='userprofile',
name='mentor_applied',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='userprofile',
name='mentor_profile',
field=models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='mentors.Mentor'),
),
]
11 changes: 10 additions & 1 deletion compsocsite/appauth/models.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,8 @@

import datetime
import django

from mentors.models import Mentor
from django import forms
from django.db import models
from django.utils import timezone
Expand All@@ -10,7 +12,7 @@

class UserProfile(models.Model):
# This line is required. Links UserProfile to a User model instance.
user = models.OneToOneField(User,on_delete=models.CASCADE,)
user = models.OneToOneField(User,on_delete = models.CASCADE,)
time_creation = models.DateTimeField()
displayPref = models.IntegerField(default=1)
emailInvite = models.BooleanField(default=False)
Expand All@@ -27,6 +29,13 @@ class UserProfile(models.Model):
finished = models.BooleanField(default=False)
numq= models.IntegerField(default=0)
exp_data = models.TextField(default="{}")

# Mentor Applicaton Profile
mentor_applied = models.BooleanField(default = False)

# Set mentor reference to SET_NULL here to protect the deletion of the user profile
mentor_profile = models.OneToOneField(Mentor, on_delete = models.SET_NULL, default = None, null = True)

# Override the __unicode__() method to return out something meaningful!
def __unicode__(self):
return self.user.username
Expand Down
2 changes: 1 addition & 1 deletion compsocsite/appauth/templates/settings.html
100755 → 100644
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@
</fieldset>
<!-- <fieldset class="form-group">
<label for="email">Email</label>
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}">
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}" readonly>
</fieldset> -->
<input type="submit" class="btn btn-success" value="Save Changes">
</form>
Expand Down
192 changes: 192 additions & 0 deletions compsocsite/compsocsite/settings.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
"""
Django settings for compsocsite project.

Generated by 'django-admin startproject' using Django 1.9.5.

For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/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__)))


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '_'

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

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'crispy_forms',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'compsocsite',
'appauth',
'groups',
'multipolls',
'mentors',
'django_mobile',
'mathfilters',
'sessions_local',
'corsheaders',
'qr_code',
]

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',
'django_mobile.middleware.MobileDetectionMiddleware',
'django_mobile.middleware.SetFlavourMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
]

ROOT_URLCONF = 'compsocsite.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'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',
'django_mobile.context_processors.flavour',
],
'loaders':(
('django_mobile.loader.CachedLoader', (
'django_mobile.loader.Loader',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.app_directories.Loader',
)),
)
},
},
]

WSGI_APPLICATION = 'compsocsite.wsgi.application'


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

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

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'my_cache_table',
}
}


# Password validation
# https://docs.djangoproject.com/en/1.9/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',
},
]

#CAS
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
#'cas.backends.CASBackend',
]
CAS_GATEWAY = True

CAS_RESPONSE_CALLBACKS = (
'module.callbackfunction',
)

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

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'EST'

USE_I18N = True

USE_L10N = True

USE_TZ = True

#CAS
CAS_SERVER_URL = "https://cas-auth.rpi.edu/cas/"
CAS_LOGOUT_COMPLETELY = True
CAS_PROVIDE_URL_TO_LOGOUT = True
CAS_AUTO_CREATE_USERS = True
CAS_IGNORE_REFERER = True
CAS_REDIRECT_URL = '/polls/regular_polls'
#'https://opra.cs.rpi.edu'
# CAS_FORCE_SSL_SERVICE_URL = True

#################################################
# Email settings #
#################################################
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'oprahprogramtest@gmail.com'
EMAIL_HOST_PASSWORD = 'ThisIsJustATestProgram'
EMAIL_PORT = 587


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/

STATIC_URL = '/static/'
LOGIN_URL = '/auth/login/'

STATICFILES_DIRS = (
'/static/',
os.path.join(os.path.abspath(BASE_DIR), 'static'),
)


# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# SESSION_COOKIE_SECURE = True
# CSRF_COOKIE_SECURE = True
# SECURE_HSTS_SECONDS = 3600
# SECURE_SSL_REDIRECT = False
1 change: 1 addition & 0 deletions compsocsite/compsocsite/urls.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,6 +34,7 @@
url(r'^sessions/', include('sessions_local.urls')),
url(r'^static/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, 'show_indexes':True}),
url(r'^multipolls/', include('multipolls.urls')),
url(r'^mentors/', include('mentors.urls')),
url(r'^GM2017$', GMView.as_view(), name='voting_demo'),
url(r'^message$', sendMessage, name='message'),
url(r'^GM2017$', GMView.as_view(), name='GM_2017'),
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions compsocsite/mentors/admin.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
fromdjango.contribimportadmin

# Register your models here.
5 changes: 5 additions & 0 deletions compsocsite/mentors/apps.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class MentorsConfig(AppConfig):
name = 'mentors'
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
db9da26
Change placeholder width
Sep 19, 2019
867743f
Update README.md
tomjmwang Sep 20, 2019
1566599
Update README.md
tomjmwang Sep 20, 2019
cf0341c
Add animation to the voting UI
Sep 20, 2019
a386297
Fixed a bug that the placeholder don't have enough width in method on…
Sep 21, 2019
41b95ac
Create a new app mentors
Oct 21, 2019
6563745
Add a new css file for form submission
Oct 21, 2019
242c5fc
Add a new column for mentor application
Oct 21, 2019
21d7369
Add matching simulation
Nov 10, 2019
b72e8c2
change css
Nov 10, 2019
f3ab2cc
Fix bugs in the simualtion round
Nov 11, 2019
8773fff
Fix bugs in the simualtion round
Nov 12, 2019
afe7e87
bug fixed
Nov 13, 2019
f665a64
bug fixed
Nov 13, 2019
8ef8037
fix bugs of form
Nov 13, 2019
c112c6b
Redirect the matching result to the HTML page
Nov 14, 2019
976c131
Add feature sliders that can be modified by the prof
Nov 16, 2019
c16058a
Change the student application form to multipage
Nov 16, 2019
2e54887
add new js for mentor system
Nov 19, 2019
3e462ce
add new css for mentor system
Nov 19, 2019
8024e84
Visual Changes & Time slots
Nov 21, 2019
76c0cf3
changes
Nov 21, 2019
ebd6d5f
changes
Nov 21, 2019
72e294b
Add new app crispy form
Nov 22, 2019
f9d832a
updated readme
starwarswii Nov 22, 2019
bee2379
Update README.md
starwarswii Nov 22, 2019
1d7f6cc
added a basic banner on the main page
starwarswii Nov 22, 2019
80b59e4
Merge branch 'master' of https://github.com/ReedyChen/opra
starwarswii Nov 22, 2019
30572e3
Link mentor app to each account
Nov 23, 2019
01f1ede
Link mentor app to each account
Nov 23, 2019
42803e2
Merge branch 'master' of https://github.com/ReedyChen/opra
Nov 23, 2019
71cd7c9
Reverse Changes
Nov 23, 2019
fb86c58
Visual Changes
Nov 23, 2019
7022a1a
change cache
Nov 23, 2019
daa8149
changes
Nov 23, 2019
d7ac80e
Add page lock to prevent form crash
Nov 24, 2019
9731b8d
Bugs fix
Nov 24, 2019
d7a0446
Change csv file update from local
Nov 25, 2019
c9a2973
Bug fixed
Nov 25, 2019
9d9c885
Finalize
Nov 25, 2019
894663d
Finalize
Nov 25, 2019
cd815fd
Add junming to admin
Nov 25, 2019
0841fe2
Merge branch 'master' into master
tomjmwang Nov 25, 2019
05d9268
Make new migrations
Nov 25, 2019
07ea198
Make new migrations
Nov 25, 2019
0aecd6e
Make another migrations
Nov 25, 2019
647f7c4
Migration change
Nov 25, 2019
bde3d4b
change admin
Nov 25, 2019
e79e603
updated match.py to fix bug
starwarswii Dec 18, 2019
ac0b29d
removed match_change.py
starwarswii Dec 18, 2019
c2841b6
Merge remote-tracking branch 'upstream/master'
starwarswii Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,15 +29,17 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:

5. Clone this project from Github

6. Copy settings.py from opra_dependencies to compsocsite/compsocsite. Copy opra_crypto.py from opra_dependencies to compsocsite/polls.
6. ~~Copy settings.py from opra_dependencies to compsocsite/compsocsite.~~ (an updated settings.py is now included.) Copy opra_crypto.py from opra_dependencies to compsocsite/polls.

6.5. For testing locally, edit compsocsite/appauth/views.py and find-replace `https://opra.cs.rpi.edu` with `http://127.0.0.1:8000`

7. Open command line (terminal), change to OPRA's directory, and then enter the following commands:

<code>cd composcite</code>

<code>python manage.py migrate</code>

<code>python manage.py createcachetable</code>
```
cd composcite
python manage.py migrate
python manage.py createcachetable
```

Then run the server by entering:

Expand All@@ -58,6 +60,7 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:
* **scipy**:
* **numpy**:
* **networkx**:
* **django-crispy-forms**:
* **django-mathfilters**:
* **matplotlib**:

Expand Down
25 changes: 25 additions & 0 deletions compsocsite/appauth/migrations/0018_auto_20191125_0156.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
# Generated by Django 2.2 on 2019-11-25 06:56

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('mentors', '0001_initial'),
('appauth', '0017_userprofile_exp_data'),
]

operations = [
migrations.AddField(
model_name='userprofile',
name='mentor_applied',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='userprofile',
name='mentor_profile',
field=models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='mentors.Mentor'),
),
]
11 changes: 10 additions & 1 deletion compsocsite/appauth/models.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,8 @@

import datetime
import django

from mentors.models import Mentor
from django import forms
from django.db import models
from django.utils import timezone
Expand All@@ -10,7 +12,7 @@

class UserProfile(models.Model):
# This line is required. Links UserProfile to a User model instance.
user = models.OneToOneField(User,on_delete=models.CASCADE,)
user = models.OneToOneField(User,on_delete = models.CASCADE,)
time_creation = models.DateTimeField()
displayPref = models.IntegerField(default=1)
emailInvite = models.BooleanField(default=False)
Expand All@@ -27,6 +29,13 @@ class UserProfile(models.Model):
finished = models.BooleanField(default=False)
numq= models.IntegerField(default=0)
exp_data = models.TextField(default="{}")

# Mentor Applicaton Profile
mentor_applied = models.BooleanField(default = False)

# Set mentor reference to SET_NULL here to protect the deletion of the user profile
mentor_profile = models.OneToOneField(Mentor, on_delete = models.SET_NULL, default = None, null = True)

# Override the __unicode__() method to return out something meaningful!
def __unicode__(self):
return self.user.username
Expand Down
2 changes: 1 addition & 1 deletion compsocsite/appauth/templates/settings.html
100755 → 100644
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@
</fieldset>
<!-- <fieldset class="form-group">
<label for="email">Email</label>
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}">
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}" readonly>
</fieldset> -->
<input type="submit" class="btn btn-success" value="Save Changes">
</form>
Expand Down
192 changes: 192 additions & 0 deletions compsocsite/compsocsite/settings.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
"""
Django settings for compsocsite project.

Generated by 'django-admin startproject' using Django 1.9.5.

For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/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__)))


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '_'

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

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'crispy_forms',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'compsocsite',
'appauth',
'groups',
'multipolls',
'mentors',
'django_mobile',
'mathfilters',
'sessions_local',
'corsheaders',
'qr_code',
]

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',
'django_mobile.middleware.MobileDetectionMiddleware',
'django_mobile.middleware.SetFlavourMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
]

ROOT_URLCONF = 'compsocsite.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'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',
'django_mobile.context_processors.flavour',
],
'loaders':(
('django_mobile.loader.CachedLoader', (
'django_mobile.loader.Loader',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.app_directories.Loader',
)),
)
},
},
]

WSGI_APPLICATION = 'compsocsite.wsgi.application'


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

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

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'my_cache_table',
}
}


# Password validation
# https://docs.djangoproject.com/en/1.9/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',
},
]

#CAS
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
#'cas.backends.CASBackend',
]
CAS_GATEWAY = True

CAS_RESPONSE_CALLBACKS = (
'module.callbackfunction',
)

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

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'EST'

USE_I18N = True

USE_L10N = True

USE_TZ = True

#CAS
CAS_SERVER_URL = "https://cas-auth.rpi.edu/cas/"
CAS_LOGOUT_COMPLETELY = True
CAS_PROVIDE_URL_TO_LOGOUT = True
CAS_AUTO_CREATE_USERS = True
CAS_IGNORE_REFERER = True
CAS_REDIRECT_URL = '/polls/regular_polls'
#'https://opra.cs.rpi.edu'
# CAS_FORCE_SSL_SERVICE_URL = True

#################################################
# Email settings #
#################################################
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'oprahprogramtest@gmail.com'
EMAIL_HOST_PASSWORD = 'ThisIsJustATestProgram'
EMAIL_PORT = 587


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/

STATIC_URL = '/static/'
LOGIN_URL = '/auth/login/'

STATICFILES_DIRS = (
'/static/',
os.path.join(os.path.abspath(BASE_DIR), 'static'),
)


# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# SESSION_COOKIE_SECURE = True
# CSRF_COOKIE_SECURE = True
# SECURE_HSTS_SECONDS = 3600
# SECURE_SSL_REDIRECT = False
1 change: 1 addition & 0 deletions compsocsite/compsocsite/urls.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,6 +34,7 @@
url(r'^sessions/', include('sessions_local.urls')),
url(r'^static/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, 'show_indexes':True}),
url(r'^multipolls/', include('multipolls.urls')),
url(r'^mentors/', include('mentors.urls')),
url(r'^GM2017$', GMView.as_view(), name='voting_demo'),
url(r'^message$', sendMessage, name='message'),
url(r'^GM2017$', GMView.as_view(), name='GM_2017'),
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions compsocsite/mentors/admin.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
fromdjango.contribimportadmin

# Register your models here.
5 changes: 5 additions & 0 deletions compsocsite/mentors/apps.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class MentorsConfig(AppConfig):
name = 'mentors'
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
db9da26
Change placeholder width
Sep 19, 2019
867743f
Update README.md
tomjmwang Sep 20, 2019
1566599
Update README.md
tomjmwang Sep 20, 2019
cf0341c
Add animation to the voting UI
Sep 20, 2019
a386297
Fixed a bug that the placeholder don't have enough width in method on…
Sep 21, 2019
41b95ac
Create a new app mentors
Oct 21, 2019
6563745
Add a new css file for form submission
Oct 21, 2019
242c5fc
Add a new column for mentor application
Oct 21, 2019
21d7369
Add matching simulation
Nov 10, 2019
b72e8c2
change css
Nov 10, 2019
f3ab2cc
Fix bugs in the simualtion round
Nov 11, 2019
8773fff
Fix bugs in the simualtion round
Nov 12, 2019
afe7e87
bug fixed
Nov 13, 2019
f665a64
bug fixed
Nov 13, 2019
8ef8037
fix bugs of form
Nov 13, 2019
c112c6b
Redirect the matching result to the HTML page
Nov 14, 2019
976c131
Add feature sliders that can be modified by the prof
Nov 16, 2019
c16058a
Change the student application form to multipage
Nov 16, 2019
2e54887
add new js for mentor system
Nov 19, 2019
3e462ce
add new css for mentor system
Nov 19, 2019
8024e84
Visual Changes & Time slots
Nov 21, 2019
76c0cf3
changes
Nov 21, 2019
ebd6d5f
changes
Nov 21, 2019
72e294b
Add new app crispy form
Nov 22, 2019
f9d832a
updated readme
starwarswii Nov 22, 2019
bee2379
Update README.md
starwarswii Nov 22, 2019
1d7f6cc
added a basic banner on the main page
starwarswii Nov 22, 2019
80b59e4
Merge branch 'master' of https://github.com/ReedyChen/opra
starwarswii Nov 22, 2019
30572e3
Link mentor app to each account
Nov 23, 2019
01f1ede
Link mentor app to each account
Nov 23, 2019
42803e2
Merge branch 'master' of https://github.com/ReedyChen/opra
Nov 23, 2019
71cd7c9
Reverse Changes
Nov 23, 2019
fb86c58
Visual Changes
Nov 23, 2019
7022a1a
change cache
Nov 23, 2019
daa8149
changes
Nov 23, 2019
d7ac80e
Add page lock to prevent form crash
Nov 24, 2019
9731b8d
Bugs fix
Nov 24, 2019
d7a0446
Change csv file update from local
Nov 25, 2019
c9a2973
Bug fixed
Nov 25, 2019
9d9c885
Finalize
Nov 25, 2019
894663d
Finalize
Nov 25, 2019
cd815fd
Add junming to admin
Nov 25, 2019
0841fe2
Merge branch 'master' into master
tomjmwang Nov 25, 2019
05d9268
Make new migrations
Nov 25, 2019
07ea198
Make new migrations
Nov 25, 2019
0aecd6e
Make another migrations
Nov 25, 2019
647f7c4
Migration change
Nov 25, 2019
bde3d4b
change admin
Nov 25, 2019
e79e603
updated match.py to fix bug
starwarswii Dec 18, 2019
ac0b29d
removed match_change.py
starwarswii Dec 18, 2019
c2841b6
Merge remote-tracking branch 'upstream/master'
starwarswii Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,15 +29,17 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:

5. Clone this project from Github

6. Copy settings.py from opra_dependencies to compsocsite/compsocsite. Copy opra_crypto.py from opra_dependencies to compsocsite/polls.
6. ~~Copy settings.py from opra_dependencies to compsocsite/compsocsite.~~ (an updated settings.py is now included.) Copy opra_crypto.py from opra_dependencies to compsocsite/polls.

6.5. For testing locally, edit compsocsite/appauth/views.py and find-replace `https://opra.cs.rpi.edu` with `http://127.0.0.1:8000`

7. Open command line (terminal), change to OPRA's directory, and then enter the following commands:

<code>cd composcite</code>

<code>python manage.py migrate</code>

<code>python manage.py createcachetable</code>
```
cd composcite
python manage.py migrate
python manage.py createcachetable
```

Then run the server by entering:

Expand All@@ -58,6 +60,7 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:
* **scipy**:
* **numpy**:
* **networkx**:
* **django-crispy-forms**:
* **django-mathfilters**:
* **matplotlib**:

Expand Down
25 changes: 25 additions & 0 deletions compsocsite/appauth/migrations/0018_auto_20191125_0156.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
# Generated by Django 2.2 on 2019-11-25 06:56

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('mentors', '0001_initial'),
('appauth', '0017_userprofile_exp_data'),
]

operations = [
migrations.AddField(
model_name='userprofile',
name='mentor_applied',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='userprofile',
name='mentor_profile',
field=models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='mentors.Mentor'),
),
]
11 changes: 10 additions & 1 deletion compsocsite/appauth/models.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,8 @@

import datetime
import django

from mentors.models import Mentor
from django import forms
from django.db import models
from django.utils import timezone
Expand All@@ -10,7 +12,7 @@

class UserProfile(models.Model):
# This line is required. Links UserProfile to a User model instance.
user = models.OneToOneField(User,on_delete=models.CASCADE,)
user = models.OneToOneField(User,on_delete = models.CASCADE,)
time_creation = models.DateTimeField()
displayPref = models.IntegerField(default=1)
emailInvite = models.BooleanField(default=False)
Expand All@@ -27,6 +29,13 @@ class UserProfile(models.Model):
finished = models.BooleanField(default=False)
numq= models.IntegerField(default=0)
exp_data = models.TextField(default="{}")

# Mentor Applicaton Profile
mentor_applied = models.BooleanField(default = False)

# Set mentor reference to SET_NULL here to protect the deletion of the user profile
mentor_profile = models.OneToOneField(Mentor, on_delete = models.SET_NULL, default = None, null = True)

# Override the __unicode__() method to return out something meaningful!
def __unicode__(self):
return self.user.username
Expand Down
2 changes: 1 addition & 1 deletion compsocsite/appauth/templates/settings.html
100755 → 100644
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@
</fieldset>
<!-- <fieldset class="form-group">
<label for="email">Email</label>
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}">
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}" readonly>
</fieldset> -->
<input type="submit" class="btn btn-success" value="Save Changes">
</form>
Expand Down
192 changes: 192 additions & 0 deletions compsocsite/compsocsite/settings.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
"""
Django settings for compsocsite project.

Generated by 'django-admin startproject' using Django 1.9.5.

For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/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__)))


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '_'

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

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'crispy_forms',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'compsocsite',
'appauth',
'groups',
'multipolls',
'mentors',
'django_mobile',
'mathfilters',
'sessions_local',
'corsheaders',
'qr_code',
]

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',
'django_mobile.middleware.MobileDetectionMiddleware',
'django_mobile.middleware.SetFlavourMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
]

ROOT_URLCONF = 'compsocsite.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'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',
'django_mobile.context_processors.flavour',
],
'loaders':(
('django_mobile.loader.CachedLoader', (
'django_mobile.loader.Loader',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.app_directories.Loader',
)),
)
},
},
]

WSGI_APPLICATION = 'compsocsite.wsgi.application'


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

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

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'my_cache_table',
}
}


# Password validation
# https://docs.djangoproject.com/en/1.9/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',
},
]

#CAS
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
#'cas.backends.CASBackend',
]
CAS_GATEWAY = True

CAS_RESPONSE_CALLBACKS = (
'module.callbackfunction',
)

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

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'EST'

USE_I18N = True

USE_L10N = True

USE_TZ = True

#CAS
CAS_SERVER_URL = "https://cas-auth.rpi.edu/cas/"
CAS_LOGOUT_COMPLETELY = True
CAS_PROVIDE_URL_TO_LOGOUT = True
CAS_AUTO_CREATE_USERS = True
CAS_IGNORE_REFERER = True
CAS_REDIRECT_URL = '/polls/regular_polls'
#'https://opra.cs.rpi.edu'
# CAS_FORCE_SSL_SERVICE_URL = True

#################################################
# Email settings #
#################################################
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'oprahprogramtest@gmail.com'
EMAIL_HOST_PASSWORD = 'ThisIsJustATestProgram'
EMAIL_PORT = 587


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/

STATIC_URL = '/static/'
LOGIN_URL = '/auth/login/'

STATICFILES_DIRS = (
'/static/',
os.path.join(os.path.abspath(BASE_DIR), 'static'),
)


# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# SESSION_COOKIE_SECURE = True
# CSRF_COOKIE_SECURE = True
# SECURE_HSTS_SECONDS = 3600
# SECURE_SSL_REDIRECT = False
1 change: 1 addition & 0 deletions compsocsite/compsocsite/urls.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,6 +34,7 @@
url(r'^sessions/', include('sessions_local.urls')),
url(r'^static/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, 'show_indexes':True}),
url(r'^multipolls/', include('multipolls.urls')),
url(r'^mentors/', include('mentors.urls')),
url(r'^GM2017$', GMView.as_view(), name='voting_demo'),
url(r'^message$', sendMessage, name='message'),
url(r'^GM2017$', GMView.as_view(), name='GM_2017'),
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions compsocsite/mentors/admin.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
fromdjango.contribimportadmin

# Register your models here.
5 changes: 5 additions & 0 deletions compsocsite/mentors/apps.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class MentorsConfig(AppConfig):
name = 'mentors'
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
db9da26
Change placeholder width
Sep 19, 2019
867743f
Update README.md
tomjmwang Sep 20, 2019
1566599
Update README.md
tomjmwang Sep 20, 2019
cf0341c
Add animation to the voting UI
Sep 20, 2019
a386297
Fixed a bug that the placeholder don't have enough width in method on…
Sep 21, 2019
41b95ac
Create a new app mentors
Oct 21, 2019
6563745
Add a new css file for form submission
Oct 21, 2019
242c5fc
Add a new column for mentor application
Oct 21, 2019
21d7369
Add matching simulation
Nov 10, 2019
b72e8c2
change css
Nov 10, 2019
f3ab2cc
Fix bugs in the simualtion round
Nov 11, 2019
8773fff
Fix bugs in the simualtion round
Nov 12, 2019
afe7e87
bug fixed
Nov 13, 2019
f665a64
bug fixed
Nov 13, 2019
8ef8037
fix bugs of form
Nov 13, 2019
c112c6b
Redirect the matching result to the HTML page
Nov 14, 2019
976c131
Add feature sliders that can be modified by the prof
Nov 16, 2019
c16058a
Change the student application form to multipage
Nov 16, 2019
2e54887
add new js for mentor system
Nov 19, 2019
3e462ce
add new css for mentor system
Nov 19, 2019
8024e84
Visual Changes & Time slots
Nov 21, 2019
76c0cf3
changes
Nov 21, 2019
ebd6d5f
changes
Nov 21, 2019
72e294b
Add new app crispy form
Nov 22, 2019
f9d832a
updated readme
starwarswii Nov 22, 2019
bee2379
Update README.md
starwarswii Nov 22, 2019
1d7f6cc
added a basic banner on the main page
starwarswii Nov 22, 2019
80b59e4
Merge branch 'master' of https://github.com/ReedyChen/opra
starwarswii Nov 22, 2019
30572e3
Link mentor app to each account
Nov 23, 2019
01f1ede
Link mentor app to each account
Nov 23, 2019
42803e2
Merge branch 'master' of https://github.com/ReedyChen/opra
Nov 23, 2019
71cd7c9
Reverse Changes
Nov 23, 2019
fb86c58
Visual Changes
Nov 23, 2019
7022a1a
change cache
Nov 23, 2019
daa8149
changes
Nov 23, 2019
d7ac80e
Add page lock to prevent form crash
Nov 24, 2019
9731b8d
Bugs fix
Nov 24, 2019
d7a0446
Change csv file update from local
Nov 25, 2019
c9a2973
Bug fixed
Nov 25, 2019
9d9c885
Finalize
Nov 25, 2019
894663d
Finalize
Nov 25, 2019
cd815fd
Add junming to admin
Nov 25, 2019
0841fe2
Merge branch 'master' into master
tomjmwang Nov 25, 2019
05d9268
Make new migrations
Nov 25, 2019
07ea198
Make new migrations
Nov 25, 2019
0aecd6e
Make another migrations
Nov 25, 2019
647f7c4
Migration change
Nov 25, 2019
bde3d4b
change admin
Nov 25, 2019
e79e603
updated match.py to fix bug
starwarswii Dec 18, 2019
ac0b29d
removed match_change.py
starwarswii Dec 18, 2019
c2841b6
Merge remote-tracking branch 'upstream/master'
starwarswii Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,15 +29,17 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:

5. Clone this project from Github

6. Copy settings.py from opra_dependencies to compsocsite/compsocsite. Copy opra_crypto.py from opra_dependencies to compsocsite/polls.
6. ~~Copy settings.py from opra_dependencies to compsocsite/compsocsite.~~ (an updated settings.py is now included.) Copy opra_crypto.py from opra_dependencies to compsocsite/polls.

6.5. For testing locally, edit compsocsite/appauth/views.py and find-replace `https://opra.cs.rpi.edu` with `http://127.0.0.1:8000`

7. Open command line (terminal), change to OPRA's directory, and then enter the following commands:

<code>cd composcite</code>

<code>python manage.py migrate</code>

<code>python manage.py createcachetable</code>
```
cd composcite
python manage.py migrate
python manage.py createcachetable
```

Then run the server by entering:

Expand All@@ -58,6 +60,7 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:
* **scipy**:
* **numpy**:
* **networkx**:
* **django-crispy-forms**:
* **django-mathfilters**:
* **matplotlib**:

Expand Down
25 changes: 25 additions & 0 deletions compsocsite/appauth/migrations/0018_auto_20191125_0156.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
# Generated by Django 2.2 on 2019-11-25 06:56

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('mentors', '0001_initial'),
('appauth', '0017_userprofile_exp_data'),
]

operations = [
migrations.AddField(
model_name='userprofile',
name='mentor_applied',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='userprofile',
name='mentor_profile',
field=models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='mentors.Mentor'),
),
]
11 changes: 10 additions & 1 deletion compsocsite/appauth/models.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,8 @@

import datetime
import django

from mentors.models import Mentor
from django import forms
from django.db import models
from django.utils import timezone
Expand All@@ -10,7 +12,7 @@

class UserProfile(models.Model):
# This line is required. Links UserProfile to a User model instance.
user = models.OneToOneField(User,on_delete=models.CASCADE,)
user = models.OneToOneField(User,on_delete = models.CASCADE,)
time_creation = models.DateTimeField()
displayPref = models.IntegerField(default=1)
emailInvite = models.BooleanField(default=False)
Expand All@@ -27,6 +29,13 @@ class UserProfile(models.Model):
finished = models.BooleanField(default=False)
numq= models.IntegerField(default=0)
exp_data = models.TextField(default="{}")

# Mentor Applicaton Profile
mentor_applied = models.BooleanField(default = False)

# Set mentor reference to SET_NULL here to protect the deletion of the user profile
mentor_profile = models.OneToOneField(Mentor, on_delete = models.SET_NULL, default = None, null = True)

# Override the __unicode__() method to return out something meaningful!
def __unicode__(self):
return self.user.username
Expand Down
2 changes: 1 addition & 1 deletion compsocsite/appauth/templates/settings.html
100755 → 100644
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@
</fieldset>
<!-- <fieldset class="form-group">
<label for="email">Email</label>
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}">
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}" readonly>
</fieldset> -->
<input type="submit" class="btn btn-success" value="Save Changes">
</form>
Expand Down
192 changes: 192 additions & 0 deletions compsocsite/compsocsite/settings.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
"""
Django settings for compsocsite project.

Generated by 'django-admin startproject' using Django 1.9.5.

For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/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__)))


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '_'

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

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'crispy_forms',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'compsocsite',
'appauth',
'groups',
'multipolls',
'mentors',
'django_mobile',
'mathfilters',
'sessions_local',
'corsheaders',
'qr_code',
]

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',
'django_mobile.middleware.MobileDetectionMiddleware',
'django_mobile.middleware.SetFlavourMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
]

ROOT_URLCONF = 'compsocsite.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'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',
'django_mobile.context_processors.flavour',
],
'loaders':(
('django_mobile.loader.CachedLoader', (
'django_mobile.loader.Loader',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.app_directories.Loader',
)),
)
},
},
]

WSGI_APPLICATION = 'compsocsite.wsgi.application'


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

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

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'my_cache_table',
}
}


# Password validation
# https://docs.djangoproject.com/en/1.9/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',
},
]

#CAS
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
#'cas.backends.CASBackend',
]
CAS_GATEWAY = True

CAS_RESPONSE_CALLBACKS = (
'module.callbackfunction',
)

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

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'EST'

USE_I18N = True

USE_L10N = True

USE_TZ = True

#CAS
CAS_SERVER_URL = "https://cas-auth.rpi.edu/cas/"
CAS_LOGOUT_COMPLETELY = True
CAS_PROVIDE_URL_TO_LOGOUT = True
CAS_AUTO_CREATE_USERS = True
CAS_IGNORE_REFERER = True
CAS_REDIRECT_URL = '/polls/regular_polls'
#'https://opra.cs.rpi.edu'
# CAS_FORCE_SSL_SERVICE_URL = True

#################################################
# Email settings #
#################################################
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'oprahprogramtest@gmail.com'
EMAIL_HOST_PASSWORD = 'ThisIsJustATestProgram'
EMAIL_PORT = 587


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/

STATIC_URL = '/static/'
LOGIN_URL = '/auth/login/'

STATICFILES_DIRS = (
'/static/',
os.path.join(os.path.abspath(BASE_DIR), 'static'),
)


# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# SESSION_COOKIE_SECURE = True
# CSRF_COOKIE_SECURE = True
# SECURE_HSTS_SECONDS = 3600
# SECURE_SSL_REDIRECT = False
1 change: 1 addition & 0 deletions compsocsite/compsocsite/urls.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,6 +34,7 @@
url(r'^sessions/', include('sessions_local.urls')),
url(r'^static/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, 'show_indexes':True}),
url(r'^multipolls/', include('multipolls.urls')),
url(r'^mentors/', include('mentors.urls')),
url(r'^GM2017$', GMView.as_view(), name='voting_demo'),
url(r'^message$', sendMessage, name='message'),
url(r'^GM2017$', GMView.as_view(), name='GM_2017'),
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions compsocsite/mentors/admin.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
fromdjango.contribimportadmin

# Register your models here.
5 changes: 5 additions & 0 deletions compsocsite/mentors/apps.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class MentorsConfig(AppConfig):
name = 'mentors'
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
db9da26
Change placeholder width
Sep 19, 2019
867743f
Update README.md
tomjmwang Sep 20, 2019
1566599
Update README.md
tomjmwang Sep 20, 2019
cf0341c
Add animation to the voting UI
Sep 20, 2019
a386297
Fixed a bug that the placeholder don't have enough width in method on…
Sep 21, 2019
41b95ac
Create a new app mentors
Oct 21, 2019
6563745
Add a new css file for form submission
Oct 21, 2019
242c5fc
Add a new column for mentor application
Oct 21, 2019
21d7369
Add matching simulation
Nov 10, 2019
b72e8c2
change css
Nov 10, 2019
f3ab2cc
Fix bugs in the simualtion round
Nov 11, 2019
8773fff
Fix bugs in the simualtion round
Nov 12, 2019
afe7e87
bug fixed
Nov 13, 2019
f665a64
bug fixed
Nov 13, 2019
8ef8037
fix bugs of form
Nov 13, 2019
c112c6b
Redirect the matching result to the HTML page
Nov 14, 2019
976c131
Add feature sliders that can be modified by the prof
Nov 16, 2019
c16058a
Change the student application form to multipage
Nov 16, 2019
2e54887
add new js for mentor system
Nov 19, 2019
3e462ce
add new css for mentor system
Nov 19, 2019
8024e84
Visual Changes & Time slots
Nov 21, 2019
76c0cf3
changes
Nov 21, 2019
ebd6d5f
changes
Nov 21, 2019
72e294b
Add new app crispy form
Nov 22, 2019
f9d832a
updated readme
starwarswii Nov 22, 2019
bee2379
Update README.md
starwarswii Nov 22, 2019
1d7f6cc
added a basic banner on the main page
starwarswii Nov 22, 2019
80b59e4
Merge branch 'master' of https://github.com/ReedyChen/opra
starwarswii Nov 22, 2019
30572e3
Link mentor app to each account
Nov 23, 2019
01f1ede
Link mentor app to each account
Nov 23, 2019
42803e2
Merge branch 'master' of https://github.com/ReedyChen/opra
Nov 23, 2019
71cd7c9
Reverse Changes
Nov 23, 2019
fb86c58
Visual Changes
Nov 23, 2019
7022a1a
change cache
Nov 23, 2019
daa8149
changes
Nov 23, 2019
d7ac80e
Add page lock to prevent form crash
Nov 24, 2019
9731b8d
Bugs fix
Nov 24, 2019
d7a0446
Change csv file update from local
Nov 25, 2019
c9a2973
Bug fixed
Nov 25, 2019
9d9c885
Finalize
Nov 25, 2019
894663d
Finalize
Nov 25, 2019
cd815fd
Add junming to admin
Nov 25, 2019
0841fe2
Merge branch 'master' into master
tomjmwang Nov 25, 2019
05d9268
Make new migrations
Nov 25, 2019
07ea198
Make new migrations
Nov 25, 2019
0aecd6e
Make another migrations
Nov 25, 2019
647f7c4
Migration change
Nov 25, 2019
bde3d4b
change admin
Nov 25, 2019
e79e603
updated match.py to fix bug
starwarswii Dec 18, 2019
ac0b29d
removed match_change.py
starwarswii Dec 18, 2019
c2841b6
Merge remote-tracking branch 'upstream/master'
starwarswii Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,15 +29,17 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:

5. Clone this project from Github

6. Copy settings.py from opra_dependencies to compsocsite/compsocsite. Copy opra_crypto.py from opra_dependencies to compsocsite/polls.
6. ~~Copy settings.py from opra_dependencies to compsocsite/compsocsite.~~ (an updated settings.py is now included.) Copy opra_crypto.py from opra_dependencies to compsocsite/polls.

6.5. For testing locally, edit compsocsite/appauth/views.py and find-replace `https://opra.cs.rpi.edu` with `http://127.0.0.1:8000`

7. Open command line (terminal), change to OPRA's directory, and then enter the following commands:

<code>cd composcite</code>

<code>python manage.py migrate</code>

<code>python manage.py createcachetable</code>
```
cd composcite
python manage.py migrate
python manage.py createcachetable
```

Then run the server by entering:

Expand All@@ -58,6 +60,7 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:
* **scipy**:
* **numpy**:
* **networkx**:
* **django-crispy-forms**:
* **django-mathfilters**:
* **matplotlib**:

Expand Down
25 changes: 25 additions & 0 deletions compsocsite/appauth/migrations/0018_auto_20191125_0156.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
# Generated by Django 2.2 on 2019-11-25 06:56

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('mentors', '0001_initial'),
('appauth', '0017_userprofile_exp_data'),
]

operations = [
migrations.AddField(
model_name='userprofile',
name='mentor_applied',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='userprofile',
name='mentor_profile',
field=models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='mentors.Mentor'),
),
]
11 changes: 10 additions & 1 deletion compsocsite/appauth/models.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,8 @@

import datetime
import django

from mentors.models import Mentor
from django import forms
from django.db import models
from django.utils import timezone
Expand All@@ -10,7 +12,7 @@

class UserProfile(models.Model):
# This line is required. Links UserProfile to a User model instance.
user = models.OneToOneField(User,on_delete=models.CASCADE,)
user = models.OneToOneField(User,on_delete = models.CASCADE,)
time_creation = models.DateTimeField()
displayPref = models.IntegerField(default=1)
emailInvite = models.BooleanField(default=False)
Expand All@@ -27,6 +29,13 @@ class UserProfile(models.Model):
finished = models.BooleanField(default=False)
numq= models.IntegerField(default=0)
exp_data = models.TextField(default="{}")

# Mentor Applicaton Profile
mentor_applied = models.BooleanField(default = False)

# Set mentor reference to SET_NULL here to protect the deletion of the user profile
mentor_profile = models.OneToOneField(Mentor, on_delete = models.SET_NULL, default = None, null = True)

# Override the __unicode__() method to return out something meaningful!
def __unicode__(self):
return self.user.username
Expand Down
2 changes: 1 addition & 1 deletion compsocsite/appauth/templates/settings.html
100755 → 100644
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@
</fieldset>
<!-- <fieldset class="form-group">
<label for="email">Email</label>
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}">
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}" readonly>
</fieldset> -->
<input type="submit" class="btn btn-success" value="Save Changes">
</form>
Expand Down
192 changes: 192 additions & 0 deletions compsocsite/compsocsite/settings.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
"""
Django settings for compsocsite project.

Generated by 'django-admin startproject' using Django 1.9.5.

For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/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__)))


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '_'

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

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'crispy_forms',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'compsocsite',
'appauth',
'groups',
'multipolls',
'mentors',
'django_mobile',
'mathfilters',
'sessions_local',
'corsheaders',
'qr_code',
]

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',
'django_mobile.middleware.MobileDetectionMiddleware',
'django_mobile.middleware.SetFlavourMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
]

ROOT_URLCONF = 'compsocsite.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'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',
'django_mobile.context_processors.flavour',
],
'loaders':(
('django_mobile.loader.CachedLoader', (
'django_mobile.loader.Loader',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.app_directories.Loader',
)),
)
},
},
]

WSGI_APPLICATION = 'compsocsite.wsgi.application'


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

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

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'my_cache_table',
}
}


# Password validation
# https://docs.djangoproject.com/en/1.9/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',
},
]

#CAS
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
#'cas.backends.CASBackend',
]
CAS_GATEWAY = True

CAS_RESPONSE_CALLBACKS = (
'module.callbackfunction',
)

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

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'EST'

USE_I18N = True

USE_L10N = True

USE_TZ = True

#CAS
CAS_SERVER_URL = "https://cas-auth.rpi.edu/cas/"
CAS_LOGOUT_COMPLETELY = True
CAS_PROVIDE_URL_TO_LOGOUT = True
CAS_AUTO_CREATE_USERS = True
CAS_IGNORE_REFERER = True
CAS_REDIRECT_URL = '/polls/regular_polls'
#'https://opra.cs.rpi.edu'
# CAS_FORCE_SSL_SERVICE_URL = True

#################################################
# Email settings #
#################################################
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'oprahprogramtest@gmail.com'
EMAIL_HOST_PASSWORD = 'ThisIsJustATestProgram'
EMAIL_PORT = 587


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/

STATIC_URL = '/static/'
LOGIN_URL = '/auth/login/'

STATICFILES_DIRS = (
'/static/',
os.path.join(os.path.abspath(BASE_DIR), 'static'),
)


# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# SESSION_COOKIE_SECURE = True
# CSRF_COOKIE_SECURE = True
# SECURE_HSTS_SECONDS = 3600
# SECURE_SSL_REDIRECT = False
1 change: 1 addition & 0 deletions compsocsite/compsocsite/urls.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,6 +34,7 @@
url(r'^sessions/', include('sessions_local.urls')),
url(r'^static/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, 'show_indexes':True}),
url(r'^multipolls/', include('multipolls.urls')),
url(r'^mentors/', include('mentors.urls')),
url(r'^GM2017$', GMView.as_view(), name='voting_demo'),
url(r'^message$', sendMessage, name='message'),
url(r'^GM2017$', GMView.as_view(), name='GM_2017'),
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions compsocsite/mentors/admin.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
fromdjango.contribimportadmin

# Register your models here.
5 changes: 5 additions & 0 deletions compsocsite/mentors/apps.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class MentorsConfig(AppConfig):
name = 'mentors'
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
db9da26
Change placeholder width
Sep 19, 2019
867743f
Update README.md
tomjmwang Sep 20, 2019
1566599
Update README.md
tomjmwang Sep 20, 2019
cf0341c
Add animation to the voting UI
Sep 20, 2019
a386297
Fixed a bug that the placeholder don't have enough width in method on…
Sep 21, 2019
41b95ac
Create a new app mentors
Oct 21, 2019
6563745
Add a new css file for form submission
Oct 21, 2019
242c5fc
Add a new column for mentor application
Oct 21, 2019
21d7369
Add matching simulation
Nov 10, 2019
b72e8c2
change css
Nov 10, 2019
f3ab2cc
Fix bugs in the simualtion round
Nov 11, 2019
8773fff
Fix bugs in the simualtion round
Nov 12, 2019
afe7e87
bug fixed
Nov 13, 2019
f665a64
bug fixed
Nov 13, 2019
8ef8037
fix bugs of form
Nov 13, 2019
c112c6b
Redirect the matching result to the HTML page
Nov 14, 2019
976c131
Add feature sliders that can be modified by the prof
Nov 16, 2019
c16058a
Change the student application form to multipage
Nov 16, 2019
2e54887
add new js for mentor system
Nov 19, 2019
3e462ce
add new css for mentor system
Nov 19, 2019
8024e84
Visual Changes & Time slots
Nov 21, 2019
76c0cf3
changes
Nov 21, 2019
ebd6d5f
changes
Nov 21, 2019
72e294b
Add new app crispy form
Nov 22, 2019
f9d832a
updated readme
starwarswii Nov 22, 2019
bee2379
Update README.md
starwarswii Nov 22, 2019
1d7f6cc
added a basic banner on the main page
starwarswii Nov 22, 2019
80b59e4
Merge branch 'master' of https://github.com/ReedyChen/opra
starwarswii Nov 22, 2019
30572e3
Link mentor app to each account
Nov 23, 2019
01f1ede
Link mentor app to each account
Nov 23, 2019
42803e2
Merge branch 'master' of https://github.com/ReedyChen/opra
Nov 23, 2019
71cd7c9
Reverse Changes
Nov 23, 2019
fb86c58
Visual Changes
Nov 23, 2019
7022a1a
change cache
Nov 23, 2019
daa8149
changes
Nov 23, 2019
d7ac80e
Add page lock to prevent form crash
Nov 24, 2019
9731b8d
Bugs fix
Nov 24, 2019
d7a0446
Change csv file update from local
Nov 25, 2019
c9a2973
Bug fixed
Nov 25, 2019
9d9c885
Finalize
Nov 25, 2019
894663d
Finalize
Nov 25, 2019
cd815fd
Add junming to admin
Nov 25, 2019
0841fe2
Merge branch 'master' into master
tomjmwang Nov 25, 2019
05d9268
Make new migrations
Nov 25, 2019
07ea198
Make new migrations
Nov 25, 2019
0aecd6e
Make another migrations
Nov 25, 2019
647f7c4
Migration change
Nov 25, 2019
bde3d4b
change admin
Nov 25, 2019
e79e603
updated match.py to fix bug
starwarswii Dec 18, 2019
ac0b29d
removed match_change.py
starwarswii Dec 18, 2019
c2841b6
Merge remote-tracking branch 'upstream/master'
starwarswii Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,15 +29,17 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:

5. Clone this project from Github

6. Copy settings.py from opra_dependencies to compsocsite/compsocsite. Copy opra_crypto.py from opra_dependencies to compsocsite/polls.
6. ~~Copy settings.py from opra_dependencies to compsocsite/compsocsite.~~ (an updated settings.py is now included.) Copy opra_crypto.py from opra_dependencies to compsocsite/polls.

6.5. For testing locally, edit compsocsite/appauth/views.py and find-replace `https://opra.cs.rpi.edu` with `http://127.0.0.1:8000`

7. Open command line (terminal), change to OPRA's directory, and then enter the following commands:

<code>cd composcite</code>

<code>python manage.py migrate</code>

<code>python manage.py createcachetable</code>
```
cd composcite
python manage.py migrate
python manage.py createcachetable
```

Then run the server by entering:

Expand All@@ -58,6 +60,7 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:
* **scipy**:
* **numpy**:
* **networkx**:
* **django-crispy-forms**:
* **django-mathfilters**:
* **matplotlib**:

Expand Down
25 changes: 25 additions & 0 deletions compsocsite/appauth/migrations/0018_auto_20191125_0156.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
# Generated by Django 2.2 on 2019-11-25 06:56

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('mentors', '0001_initial'),
('appauth', '0017_userprofile_exp_data'),
]

operations = [
migrations.AddField(
model_name='userprofile',
name='mentor_applied',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='userprofile',
name='mentor_profile',
field=models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='mentors.Mentor'),
),
]
11 changes: 10 additions & 1 deletion compsocsite/appauth/models.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,8 @@

import datetime
import django

from mentors.models import Mentor
from django import forms
from django.db import models
from django.utils import timezone
Expand All@@ -10,7 +12,7 @@

class UserProfile(models.Model):
# This line is required. Links UserProfile to a User model instance.
user = models.OneToOneField(User,on_delete=models.CASCADE,)
user = models.OneToOneField(User,on_delete = models.CASCADE,)
time_creation = models.DateTimeField()
displayPref = models.IntegerField(default=1)
emailInvite = models.BooleanField(default=False)
Expand All@@ -27,6 +29,13 @@ class UserProfile(models.Model):
finished = models.BooleanField(default=False)
numq= models.IntegerField(default=0)
exp_data = models.TextField(default="{}")

# Mentor Applicaton Profile
mentor_applied = models.BooleanField(default = False)

# Set mentor reference to SET_NULL here to protect the deletion of the user profile
mentor_profile = models.OneToOneField(Mentor, on_delete = models.SET_NULL, default = None, null = True)

# Override the __unicode__() method to return out something meaningful!
def __unicode__(self):
return self.user.username
Expand Down
2 changes: 1 addition & 1 deletion compsocsite/appauth/templates/settings.html
100755 → 100644
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@
</fieldset>
<!-- <fieldset class="form-group">
<label for="email">Email</label>
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}">
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}" readonly>
</fieldset> -->
<input type="submit" class="btn btn-success" value="Save Changes">
</form>
Expand Down
192 changes: 192 additions & 0 deletions compsocsite/compsocsite/settings.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
"""
Django settings for compsocsite project.

Generated by 'django-admin startproject' using Django 1.9.5.

For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/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__)))


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '_'

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

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'crispy_forms',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'compsocsite',
'appauth',
'groups',
'multipolls',
'mentors',
'django_mobile',
'mathfilters',
'sessions_local',
'corsheaders',
'qr_code',
]

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',
'django_mobile.middleware.MobileDetectionMiddleware',
'django_mobile.middleware.SetFlavourMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
]

ROOT_URLCONF = 'compsocsite.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'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',
'django_mobile.context_processors.flavour',
],
'loaders':(
('django_mobile.loader.CachedLoader', (
'django_mobile.loader.Loader',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.app_directories.Loader',
)),
)
},
},
]

WSGI_APPLICATION = 'compsocsite.wsgi.application'


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

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

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'my_cache_table',
}
}


# Password validation
# https://docs.djangoproject.com/en/1.9/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',
},
]

#CAS
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
#'cas.backends.CASBackend',
]
CAS_GATEWAY = True

CAS_RESPONSE_CALLBACKS = (
'module.callbackfunction',
)

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

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'EST'

USE_I18N = True

USE_L10N = True

USE_TZ = True

#CAS
CAS_SERVER_URL = "https://cas-auth.rpi.edu/cas/"
CAS_LOGOUT_COMPLETELY = True
CAS_PROVIDE_URL_TO_LOGOUT = True
CAS_AUTO_CREATE_USERS = True
CAS_IGNORE_REFERER = True
CAS_REDIRECT_URL = '/polls/regular_polls'
#'https://opra.cs.rpi.edu'
# CAS_FORCE_SSL_SERVICE_URL = True

#################################################
# Email settings #
#################################################
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'oprahprogramtest@gmail.com'
EMAIL_HOST_PASSWORD = 'ThisIsJustATestProgram'
EMAIL_PORT = 587


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/

STATIC_URL = '/static/'
LOGIN_URL = '/auth/login/'

STATICFILES_DIRS = (
'/static/',
os.path.join(os.path.abspath(BASE_DIR), 'static'),
)


# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# SESSION_COOKIE_SECURE = True
# CSRF_COOKIE_SECURE = True
# SECURE_HSTS_SECONDS = 3600
# SECURE_SSL_REDIRECT = False
1 change: 1 addition & 0 deletions compsocsite/compsocsite/urls.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,6 +34,7 @@
url(r'^sessions/', include('sessions_local.urls')),
url(r'^static/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, 'show_indexes':True}),
url(r'^multipolls/', include('multipolls.urls')),
url(r'^mentors/', include('mentors.urls')),
url(r'^GM2017$', GMView.as_view(), name='voting_demo'),
url(r'^message$', sendMessage, name='message'),
url(r'^GM2017$', GMView.as_view(), name='GM_2017'),
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions compsocsite/mentors/admin.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
fromdjango.contribimportadmin

# Register your models here.
5 changes: 5 additions & 0 deletions compsocsite/mentors/apps.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class MentorsConfig(AppConfig):
name = 'mentors'
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
db9da26
Change placeholder width
Sep 19, 2019
867743f
Update README.md
tomjmwang Sep 20, 2019
1566599
Update README.md
tomjmwang Sep 20, 2019
cf0341c
Add animation to the voting UI
Sep 20, 2019
a386297
Fixed a bug that the placeholder don't have enough width in method on…
Sep 21, 2019
41b95ac
Create a new app mentors
Oct 21, 2019
6563745
Add a new css file for form submission
Oct 21, 2019
242c5fc
Add a new column for mentor application
Oct 21, 2019
21d7369
Add matching simulation
Nov 10, 2019
b72e8c2
change css
Nov 10, 2019
f3ab2cc
Fix bugs in the simualtion round
Nov 11, 2019
8773fff
Fix bugs in the simualtion round
Nov 12, 2019
afe7e87
bug fixed
Nov 13, 2019
f665a64
bug fixed
Nov 13, 2019
8ef8037
fix bugs of form
Nov 13, 2019
c112c6b
Redirect the matching result to the HTML page
Nov 14, 2019
976c131
Add feature sliders that can be modified by the prof
Nov 16, 2019
c16058a
Change the student application form to multipage
Nov 16, 2019
2e54887
add new js for mentor system
Nov 19, 2019
3e462ce
add new css for mentor system
Nov 19, 2019
8024e84
Visual Changes & Time slots
Nov 21, 2019
76c0cf3
changes
Nov 21, 2019
ebd6d5f
changes
Nov 21, 2019
72e294b
Add new app crispy form
Nov 22, 2019
f9d832a
updated readme
starwarswii Nov 22, 2019
bee2379
Update README.md
starwarswii Nov 22, 2019
1d7f6cc
added a basic banner on the main page
starwarswii Nov 22, 2019
80b59e4
Merge branch 'master' of https://github.com/ReedyChen/opra
starwarswii Nov 22, 2019
30572e3
Link mentor app to each account
Nov 23, 2019
01f1ede
Link mentor app to each account
Nov 23, 2019
42803e2
Merge branch 'master' of https://github.com/ReedyChen/opra
Nov 23, 2019
71cd7c9
Reverse Changes
Nov 23, 2019
fb86c58
Visual Changes
Nov 23, 2019
7022a1a
change cache
Nov 23, 2019
daa8149
changes
Nov 23, 2019
d7ac80e
Add page lock to prevent form crash
Nov 24, 2019
9731b8d
Bugs fix
Nov 24, 2019
d7a0446
Change csv file update from local
Nov 25, 2019
c9a2973
Bug fixed
Nov 25, 2019
9d9c885
Finalize
Nov 25, 2019
894663d
Finalize
Nov 25, 2019
cd815fd
Add junming to admin
Nov 25, 2019
0841fe2
Merge branch 'master' into master
tomjmwang Nov 25, 2019
05d9268
Make new migrations
Nov 25, 2019
07ea198
Make new migrations
Nov 25, 2019
0aecd6e
Make another migrations
Nov 25, 2019
647f7c4
Migration change
Nov 25, 2019
bde3d4b
change admin
Nov 25, 2019
e79e603
updated match.py to fix bug
starwarswii Dec 18, 2019
ac0b29d
removed match_change.py
starwarswii Dec 18, 2019
c2841b6
Merge remote-tracking branch 'upstream/master'
starwarswii Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,15 +29,17 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:

5. Clone this project from Github

6. Copy settings.py from opra_dependencies to compsocsite/compsocsite. Copy opra_crypto.py from opra_dependencies to compsocsite/polls.
6. ~~Copy settings.py from opra_dependencies to compsocsite/compsocsite.~~ (an updated settings.py is now included.) Copy opra_crypto.py from opra_dependencies to compsocsite/polls.

6.5. For testing locally, edit compsocsite/appauth/views.py and find-replace `https://opra.cs.rpi.edu` with `http://127.0.0.1:8000`

7. Open command line (terminal), change to OPRA's directory, and then enter the following commands:

<code>cd composcite</code>

<code>python manage.py migrate</code>

<code>python manage.py createcachetable</code>
```
cd composcite
python manage.py migrate
python manage.py createcachetable
```

Then run the server by entering:

Expand All@@ -58,6 +60,7 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:
* **scipy**:
* **numpy**:
* **networkx**:
* **django-crispy-forms**:
* **django-mathfilters**:
* **matplotlib**:

Expand Down
25 changes: 25 additions & 0 deletions compsocsite/appauth/migrations/0018_auto_20191125_0156.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
# Generated by Django 2.2 on 2019-11-25 06:56

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('mentors', '0001_initial'),
('appauth', '0017_userprofile_exp_data'),
]

operations = [
migrations.AddField(
model_name='userprofile',
name='mentor_applied',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='userprofile',
name='mentor_profile',
field=models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='mentors.Mentor'),
),
]
11 changes: 10 additions & 1 deletion compsocsite/appauth/models.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,8 @@

import datetime
import django

from mentors.models import Mentor
from django import forms
from django.db import models
from django.utils import timezone
Expand All@@ -10,7 +12,7 @@

class UserProfile(models.Model):
# This line is required. Links UserProfile to a User model instance.
user = models.OneToOneField(User,on_delete=models.CASCADE,)
user = models.OneToOneField(User,on_delete = models.CASCADE,)
time_creation = models.DateTimeField()
displayPref = models.IntegerField(default=1)
emailInvite = models.BooleanField(default=False)
Expand All@@ -27,6 +29,13 @@ class UserProfile(models.Model):
finished = models.BooleanField(default=False)
numq= models.IntegerField(default=0)
exp_data = models.TextField(default="{}")

# Mentor Applicaton Profile
mentor_applied = models.BooleanField(default = False)

# Set mentor reference to SET_NULL here to protect the deletion of the user profile
mentor_profile = models.OneToOneField(Mentor, on_delete = models.SET_NULL, default = None, null = True)

# Override the __unicode__() method to return out something meaningful!
def __unicode__(self):
return self.user.username
Expand Down
2 changes: 1 addition & 1 deletion compsocsite/appauth/templates/settings.html
100755 → 100644
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@
</fieldset>
<!-- <fieldset class="form-group">
<label for="email">Email</label>
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}">
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}" readonly>
</fieldset> -->
<input type="submit" class="btn btn-success" value="Save Changes">
</form>
Expand Down
192 changes: 192 additions & 0 deletions compsocsite/compsocsite/settings.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
"""
Django settings for compsocsite project.

Generated by 'django-admin startproject' using Django 1.9.5.

For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/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__)))


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '_'

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

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'crispy_forms',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'compsocsite',
'appauth',
'groups',
'multipolls',
'mentors',
'django_mobile',
'mathfilters',
'sessions_local',
'corsheaders',
'qr_code',
]

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',
'django_mobile.middleware.MobileDetectionMiddleware',
'django_mobile.middleware.SetFlavourMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
]

ROOT_URLCONF = 'compsocsite.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'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',
'django_mobile.context_processors.flavour',
],
'loaders':(
('django_mobile.loader.CachedLoader', (
'django_mobile.loader.Loader',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.app_directories.Loader',
)),
)
},
},
]

WSGI_APPLICATION = 'compsocsite.wsgi.application'


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

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

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'my_cache_table',
}
}


# Password validation
# https://docs.djangoproject.com/en/1.9/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',
},
]

#CAS
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
#'cas.backends.CASBackend',
]
CAS_GATEWAY = True

CAS_RESPONSE_CALLBACKS = (
'module.callbackfunction',
)

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

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'EST'

USE_I18N = True

USE_L10N = True

USE_TZ = True

#CAS
CAS_SERVER_URL = "https://cas-auth.rpi.edu/cas/"
CAS_LOGOUT_COMPLETELY = True
CAS_PROVIDE_URL_TO_LOGOUT = True
CAS_AUTO_CREATE_USERS = True
CAS_IGNORE_REFERER = True
CAS_REDIRECT_URL = '/polls/regular_polls'
#'https://opra.cs.rpi.edu'
# CAS_FORCE_SSL_SERVICE_URL = True

#################################################
# Email settings #
#################################################
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'oprahprogramtest@gmail.com'
EMAIL_HOST_PASSWORD = 'ThisIsJustATestProgram'
EMAIL_PORT = 587


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/

STATIC_URL = '/static/'
LOGIN_URL = '/auth/login/'

STATICFILES_DIRS = (
'/static/',
os.path.join(os.path.abspath(BASE_DIR), 'static'),
)


# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# SESSION_COOKIE_SECURE = True
# CSRF_COOKIE_SECURE = True
# SECURE_HSTS_SECONDS = 3600
# SECURE_SSL_REDIRECT = False
1 change: 1 addition & 0 deletions compsocsite/compsocsite/urls.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,6 +34,7 @@
url(r'^sessions/', include('sessions_local.urls')),
url(r'^static/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, 'show_indexes':True}),
url(r'^multipolls/', include('multipolls.urls')),
url(r'^mentors/', include('mentors.urls')),
url(r'^GM2017$', GMView.as_view(), name='voting_demo'),
url(r'^message$', sendMessage, name='message'),
url(r'^GM2017$', GMView.as_view(), name='GM_2017'),
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions compsocsite/mentors/admin.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
fromdjango.contribimportadmin

# Register your models here.
5 changes: 5 additions & 0 deletions compsocsite/mentors/apps.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class MentorsConfig(AppConfig):
name = 'mentors'
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
db9da26
Change placeholder width
Sep 19, 2019
867743f
Update README.md
tomjmwang Sep 20, 2019
1566599
Update README.md
tomjmwang Sep 20, 2019
cf0341c
Add animation to the voting UI
Sep 20, 2019
a386297
Fixed a bug that the placeholder don't have enough width in method on…
Sep 21, 2019
41b95ac
Create a new app mentors
Oct 21, 2019
6563745
Add a new css file for form submission
Oct 21, 2019
242c5fc
Add a new column for mentor application
Oct 21, 2019
21d7369
Add matching simulation
Nov 10, 2019
b72e8c2
change css
Nov 10, 2019
f3ab2cc
Fix bugs in the simualtion round
Nov 11, 2019
8773fff
Fix bugs in the simualtion round
Nov 12, 2019
afe7e87
bug fixed
Nov 13, 2019
f665a64
bug fixed
Nov 13, 2019
8ef8037
fix bugs of form
Nov 13, 2019
c112c6b
Redirect the matching result to the HTML page
Nov 14, 2019
976c131
Add feature sliders that can be modified by the prof
Nov 16, 2019
c16058a
Change the student application form to multipage
Nov 16, 2019
2e54887
add new js for mentor system
Nov 19, 2019
3e462ce
add new css for mentor system
Nov 19, 2019
8024e84
Visual Changes & Time slots
Nov 21, 2019
76c0cf3
changes
Nov 21, 2019
ebd6d5f
changes
Nov 21, 2019
72e294b
Add new app crispy form
Nov 22, 2019
f9d832a
updated readme
starwarswii Nov 22, 2019
bee2379
Update README.md
starwarswii Nov 22, 2019
1d7f6cc
added a basic banner on the main page
starwarswii Nov 22, 2019
80b59e4
Merge branch 'master' of https://github.com/ReedyChen/opra
starwarswii Nov 22, 2019
30572e3
Link mentor app to each account
Nov 23, 2019
01f1ede
Link mentor app to each account
Nov 23, 2019
42803e2
Merge branch 'master' of https://github.com/ReedyChen/opra
Nov 23, 2019
71cd7c9
Reverse Changes
Nov 23, 2019
fb86c58
Visual Changes
Nov 23, 2019
7022a1a
change cache
Nov 23, 2019
daa8149
changes
Nov 23, 2019
d7ac80e
Add page lock to prevent form crash
Nov 24, 2019
9731b8d
Bugs fix
Nov 24, 2019
d7a0446
Change csv file update from local
Nov 25, 2019
c9a2973
Bug fixed
Nov 25, 2019
9d9c885
Finalize
Nov 25, 2019
894663d
Finalize
Nov 25, 2019
cd815fd
Add junming to admin
Nov 25, 2019
0841fe2
Merge branch 'master' into master
tomjmwang Nov 25, 2019
05d9268
Make new migrations
Nov 25, 2019
07ea198
Make new migrations
Nov 25, 2019
0aecd6e
Make another migrations
Nov 25, 2019
647f7c4
Migration change
Nov 25, 2019
bde3d4b
change admin
Nov 25, 2019
e79e603
updated match.py to fix bug
starwarswii Dec 18, 2019
ac0b29d
removed match_change.py
starwarswii Dec 18, 2019
c2841b6
Merge remote-tracking branch 'upstream/master'
starwarswii Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,15 +29,17 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:

5. Clone this project from Github

6. Copy settings.py from opra_dependencies to compsocsite/compsocsite. Copy opra_crypto.py from opra_dependencies to compsocsite/polls.
6. ~~Copy settings.py from opra_dependencies to compsocsite/compsocsite.~~ (an updated settings.py is now included.) Copy opra_crypto.py from opra_dependencies to compsocsite/polls.

6.5. For testing locally, edit compsocsite/appauth/views.py and find-replace `https://opra.cs.rpi.edu` with `http://127.0.0.1:8000`

7. Open command line (terminal), change to OPRA's directory, and then enter the following commands:

<code>cd composcite</code>

<code>python manage.py migrate</code>

<code>python manage.py createcachetable</code>
```
cd composcite
python manage.py migrate
python manage.py createcachetable
```

Then run the server by entering:

Expand All@@ -58,6 +60,7 @@ The web app is built on Django, and uses an SQLite database. [Click here](https:
* **scipy**:
* **numpy**:
* **networkx**:
* **django-crispy-forms**:
* **django-mathfilters**:
* **matplotlib**:

Expand Down
25 changes: 25 additions & 0 deletions compsocsite/appauth/migrations/0018_auto_20191125_0156.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
# Generated by Django 2.2 on 2019-11-25 06:56

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('mentors', '0001_initial'),
('appauth', '0017_userprofile_exp_data'),
]

operations = [
migrations.AddField(
model_name='userprofile',
name='mentor_applied',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='userprofile',
name='mentor_profile',
field=models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='mentors.Mentor'),
),
]
11 changes: 10 additions & 1 deletion compsocsite/appauth/models.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,8 @@

import datetime
import django

from mentors.models import Mentor
from django import forms
from django.db import models
from django.utils import timezone
Expand All@@ -10,7 +12,7 @@

class UserProfile(models.Model):
# This line is required. Links UserProfile to a User model instance.
user = models.OneToOneField(User,on_delete=models.CASCADE,)
user = models.OneToOneField(User,on_delete = models.CASCADE,)
time_creation = models.DateTimeField()
displayPref = models.IntegerField(default=1)
emailInvite = models.BooleanField(default=False)
Expand All@@ -27,6 +29,13 @@ class UserProfile(models.Model):
finished = models.BooleanField(default=False)
numq= models.IntegerField(default=0)
exp_data = models.TextField(default="{}")

# Mentor Applicaton Profile
mentor_applied = models.BooleanField(default = False)

# Set mentor reference to SET_NULL here to protect the deletion of the user profile
mentor_profile = models.OneToOneField(Mentor, on_delete = models.SET_NULL, default = None, null = True)

# Override the __unicode__() method to return out something meaningful!
def __unicode__(self):
return self.user.username
Expand Down
2 changes: 1 addition & 1 deletion compsocsite/appauth/templates/settings.html
100755 → 100644
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@
</fieldset>
<!-- <fieldset class="form-group">
<label for="email">Email</label>
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}">
<input type="text" class="form-control" id="email" name="email" value="{{ request.user.email }}" readonly>
</fieldset> -->
<input type="submit" class="btn btn-success" value="Save Changes">
</form>
Expand Down
192 changes: 192 additions & 0 deletions compsocsite/compsocsite/settings.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
"""
Django settings for compsocsite project.

Generated by 'django-admin startproject' using Django 1.9.5.

For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/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__)))


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '_'

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

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'crispy_forms',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'compsocsite',
'appauth',
'groups',
'multipolls',
'mentors',
'django_mobile',
'mathfilters',
'sessions_local',
'corsheaders',
'qr_code',
]

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',
'django_mobile.middleware.MobileDetectionMiddleware',
'django_mobile.middleware.SetFlavourMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
]

ROOT_URLCONF = 'compsocsite.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'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',
'django_mobile.context_processors.flavour',
],
'loaders':(
('django_mobile.loader.CachedLoader', (
'django_mobile.loader.Loader',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.app_directories.Loader',
)),
)
},
},
]

WSGI_APPLICATION = 'compsocsite.wsgi.application'


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

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

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'my_cache_table',
}
}


# Password validation
# https://docs.djangoproject.com/en/1.9/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',
},
]

#CAS
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
#'cas.backends.CASBackend',
]
CAS_GATEWAY = True

CAS_RESPONSE_CALLBACKS = (
'module.callbackfunction',
)

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

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'EST'

USE_I18N = True

USE_L10N = True

USE_TZ = True

#CAS
CAS_SERVER_URL = "https://cas-auth.rpi.edu/cas/"
CAS_LOGOUT_COMPLETELY = True
CAS_PROVIDE_URL_TO_LOGOUT = True
CAS_AUTO_CREATE_USERS = True
CAS_IGNORE_REFERER = True
CAS_REDIRECT_URL = '/polls/regular_polls'
#'https://opra.cs.rpi.edu'
# CAS_FORCE_SSL_SERVICE_URL = True

#################################################
# Email settings #
#################################################
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'oprahprogramtest@gmail.com'
EMAIL_HOST_PASSWORD = 'ThisIsJustATestProgram'
EMAIL_PORT = 587


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/

STATIC_URL = '/static/'
LOGIN_URL = '/auth/login/'

STATICFILES_DIRS = (
'/static/',
os.path.join(os.path.abspath(BASE_DIR), 'static'),
)


# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# SESSION_COOKIE_SECURE = True
# CSRF_COOKIE_SECURE = True
# SECURE_HSTS_SECONDS = 3600
# SECURE_SSL_REDIRECT = False
1 change: 1 addition & 0 deletions compsocsite/compsocsite/urls.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,6 +34,7 @@
url(r'^sessions/', include('sessions_local.urls')),
url(r'^static/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, 'show_indexes':True}),
url(r'^multipolls/', include('multipolls.urls')),
url(r'^mentors/', include('mentors.urls')),
url(r'^GM2017$', GMView.as_view(), name='voting_demo'),
url(r'^message$', sendMessage, name='message'),
url(r'^GM2017$', GMView.as_view(), name='GM_2017'),
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions compsocsite/mentors/admin.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
fromdjango.contribimportadmin

# Register your models here.
5 changes: 5 additions & 0 deletions compsocsite/mentors/apps.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class MentorsConfig(AppConfig):
name = 'mentors'
Loading