Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions FusionIIIT/Fusion/context_processors.py

This file was deleted.

62 changes: 0 additions & 62 deletions FusionIIIT/Fusion/middleware/custom_middleware.py

This file was deleted.

22 changes: 6 additions & 16 deletions FusionIIIT/Fusion/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

# email of sender

EMAIL_HOST_USER = 'fusion@iiitdmj.ac.in'
EMAIL_HOST_USER = 'fusionmailservice@iiitdmj.ac.in'

EMAIL_PORT = 587
ACCOUNT_EMAIL_REQUIRED = True
Expand All @@ -68,7 +68,7 @@

ACCOUNT_EMAIL_SUBJECT_PREFIX = 'Fusion: '

DEFAULT_FROM_EMAIL = 'Fusion IIIT <fusion@iiitdmj.ac.in>'
DEFAULT_FROM_EMAIL = 'Fusion IIIT <fusionmailservice@iiitdmj.ac.in>'

SERVER_EMAIL = 'fusionmailservice@iiitdmj.ac.in'

Expand Down Expand Up @@ -104,14 +104,13 @@
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.humanize',
'django_crontab',

'corsheaders',

'applications.eis',
'notification',
'notifications',
'applications.academic_procedures',
'applications.examination',
'applications.academic_information',
'applications.leave',
'applications.library',
Expand All @@ -128,7 +127,6 @@
'applications.ps1',
'applications.programme_curriculum',
'applications.placement_cell',
'applications.otheracademic',
'applications.recruitment',
'applications.scholarships',
'applications.visitor_hostel',
Expand Down Expand Up @@ -165,23 +163,21 @@
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'Fusion.middleware.custom_middleware.user_logged_in_middleware',
]

ROOT_URLCONF = 'Fusion.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, '..', 'templates'),],
'DIRS': [os.path.join(BASE_DIR, '..', 'templates/'),],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'Fusion.context_processors.global_vars',
],
},
},
Expand Down Expand Up @@ -258,9 +254,9 @@

# os.path.join(BASE_DIR, 'static/')
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, '..', 'static')
STATIC_ROOT = os.path.join(BASE_DIR, '..', 'static/')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
MEDIA_ROOT = os.path.join(BASE_DIR, '..', 'media')
MEDIA_ROOT = os.path.join(BASE_DIR, '..', 'media/')
MEDIA_URL = '/media/'

ACCOUNT_USERNAME_REQUIRED = False
Expand All @@ -281,11 +277,5 @@
YOUTUBE_DATA_API_KEY = 'api_key'



CORS_ORIGIN_ALLOW_ALL = True
ALLOW_PASS_RESET = True

# session settings
SESSION_COOKIE_AGE = 15 * 60
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
SESSION_SAVE_EVERY_REQUEST = True
14 changes: 1 addition & 13 deletions FusionIIIT/Fusion/settings/development.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from Fusion.settings.common import *

DEBUG = True
TEMPLATE_DEBUG = True

SECRET_KEY = '=&w9due426k@l^ju1=s1)fj1rnpf0ok8xvjwx+62_nc-f12-8('

ALLOWED_HOSTS = ['*']
Expand All @@ -16,11 +16,9 @@
}
}


REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
'rest_framework.authentication.SessionAuthentication',
),
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
Expand Down Expand Up @@ -55,13 +53,3 @@
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
}

CRONJOBS = [
# the below job will update the bill at every minute can be used for testing
# ('* * * * *', 'applications.central_mess.tasks.generate_bill'),

#the below job which we need to add in production server, to update the mess bill of student everyday at 10 pm in night
('0 22 * * *', 'applications.central_mess.tasks.generate_bill'),
]

CRONTAB_DJANGO_MANAGE_PATH = '/home/owlman/Desktop/Fuse/Fusion/FusionIIIT/manage.py'
2 changes: 1 addition & 1 deletion FusionIIIT/Fusion/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
)
}
}
50 changes: 50 additions & 0 deletions FusionIIIT/Fusion/settings/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from .common import *
import json

from django.db.backends.signals import connection_created


SECRET_KEY = "test-secret-key"

DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "test_db.sqlite3"),
"TEST": {
"SERIALIZE": False,
},
}
}

PASSWORD_HASHERS = [
"django.contrib.auth.hashers.MD5PasswordHasher",
]

EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
SILENCED_SYSTEM_CHECKS = [
"fields.E180",
"fields.W122",
"fields.W342",
]


def _sqlite_json_valid(value):
if value is None:
return 0
try:
json.loads(value)
return 1
except (TypeError, ValueError):
return 0


def _register_sqlite_json_functions(sender, connection, **kwargs):
if connection.vendor != "sqlite":
return
connection.connection.create_function("JSON_VALID", 1, _sqlite_json_valid)


connection_created.connect(
_register_sqlite_json_functions,
dispatch_uid="fusion_test_sqlite_json_valid",
)
36 changes: 1 addition & 35 deletions FusionIIIT/Fusion/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.urls import path

from applications.globals.views import RateLimitedPasswordResetView


urlpatterns = [
Expand All @@ -47,7 +44,7 @@
url(r'^complaint/', include('applications.complaint_system.urls')),
url(r'^healthcenter/', include('applications.health_center.urls')),
url(r'^leave/', include('applications.leave.urls')),
url(r'^placement/', include('applications.placement_cell.urls')),
url(r'^placement/', include('applications.placement_cell.api.urls')),
url(r'^filetracking/', include('applications.filetracking.urls')),
url(r'^spacs/', include('applications.scholarships.urls')),
url(r'^visitorhostel/', include('applications.visitor_hostel.urls')),
Expand All @@ -63,35 +60,4 @@
url(r'^income-expenditure/', include('applications.income_expenditure.urls')),
url(r'^hr2/', include('applications.hr2.urls')),
url(r'^recruitment/', include('applications.recruitment.urls')),
url(r'^examination/', include('applications.examination.urls')),
url(r'^otheracademic/', include('applications.otheracademic.urls')),

path(
'password-reset/',
RateLimitedPasswordResetView.as_view(
template_name='registration/password_reset_form.html',
),
name='reset_password',
),
path(
'password-reset/done/',
auth_views.PasswordResetDoneView.as_view(
template_name='registration/password_reset_done.html'
),
name='password_reset_done',
),
path(
'reset/<uidb64>/<token>/',
auth_views.PasswordResetConfirmView.as_view(
template_name='registration/password_reset_confirm.html',
),
name='password_reset_confirm',
),
path(
'reset/done/',
auth_views.PasswordResetCompleteView.as_view(
template_name='registration/password_reset_complete.html'
),
name='password_reset_complete',
),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
1 change: 1 addition & 0 deletions FusionIIIT/applications/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions FusionIIIT/applications/academic_information/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ class Curriculum_InstructorAdmin(admin.ModelAdmin):
admin.site.register(Holiday)
admin.site.register(Curriculum,CurriculumAdmin)

#Hello!
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Meta:

class CurriculumSerializer(serializers.ModelSerializer):
course_id = CourseSerializer()

class Meta:
model = Curriculum
fields = ('curriculum_id','course_code','course_id','credits','course_type',
Expand Down
20 changes: 2 additions & 18 deletions FusionIIIT/applications/academic_information/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,7 @@

# url(r'^meeting',views.meeting_api,name='meeting-get-api'),

# url(r'^calendar',views.ListCalendarView.as_view(),name='calendar-get-api'),
# url(r'^update-calendar',views.update_calendar,name='calendar-update-api'),
# url(r'^add-calendar',views.add_calendar,name='calendar-add-api'),
# url(r'^delete-calendar',views.delete_calendar,name='calendar-delete-api'),
url(r'^check-allocation$', views.check_allocation_api, name='check-allocation-api'),
url(r'^start-allocation$', views.start_allocation_api, name='start-allocation-api'),
url(r'^generatexlsheet$', views.generate_xlsheet_api, name='generate-xlsheet-api'),
url(r'^available-courses/$', views.available_courses, name='available_courses'),
url(r'^generate_preregistration_report',views.generate_preregistration_report, name = "generate_preregistration_report"),
url(r'^calendar/$', views.list_calendar, name='list_calendar'),
url(r'^calendar/add/$', views.add_calendar, name='add_calendar'),
url(r'^calendar/update/$', views.update_calendar, name='update_calendar'),
url(r'^calendar/delete/$', views.delete_calendar, name='delete_calendar'),
url(r'^calendar/clear/$', views.clear_calendar, name='clear_calendar'),
url(r'^calendar/export/$', views.export_calendar, name='export_calendar'),
url(r'^calendar/import/$', views.import_calendar, name='import_calendar'),

# url(r'^calendar',views.calendar_api,name='calendar-get-api'),

# url(r'^holiday',views.holiday_api,name='holiday-get-api'),

Expand All @@ -43,4 +27,4 @@
# url(r'^grades',views.grades_api,name='grades-get-api'),

# url(r'^spi',views.spi_api,name='spi-get-api')
]
]
Loading
Loading