Skip to content

Commit

Permalink
Merge pull request #678 from anjali-dhanuka/port1.11
Browse files Browse the repository at this point in the history
Migrated to python3.6 and django 1.11
  • Loading branch information
May Burgos authored May 23, 2018
2 parents 3b60ce1 + 6674f89 commit 31ab575
Show file tree
Hide file tree
Showing 33 changed files with 83 additions and 72 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
python:
- "2.7"
- "3.6.5"
services: postgresql
install:
- pip install -r requirements.txt
Expand All @@ -13,7 +13,7 @@ before_script:
- export DJANGO_SECRET_KEY=foobarbaz
script:
- cd vms
- python manage.py syncdb --noinput
- python manage.py makemigrations auth volunteer administrator organization event job shift registration
- python manage.py migrate --noinput --traceback --settings=vms.settings
- coverage run --source='.' manage.py test
after_success:
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
coverage == 3.7.1
coveralls == 0.5
Django == 1.7.4
Django == 1.11.0
docopt == 0.6.2
flake8 == 3.4.1
psycopg2 == 2.7.3
PyYAML == 3.11
requests == 2.7.0
selenium == 2.53.1
phonenumbers == 7.2.6
phonenumbers == 8.8.8
django-cities-light == 3.2.0
Unidecode == 0.4.19
django-braces == 1.9.0

2 changes: 1 addition & 1 deletion vms/administrator/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib.auth.models import User
from django.core.validators import RegexValidator
from django.db import models

from django.conf import settings
from organization.models import Organization


Expand Down
7 changes: 3 additions & 4 deletions vms/administrator/urls.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Django
from django.conf.urls import patterns, url
from django.conf.urls import url

# local Django
from administrator import views
from administrator.views import GenerateReportView, AdminUpdateView, ProfileView

urlpatterns = patterns(
'',
urlpatterns = [
url(r'^report/$', GenerateReportView.as_view(), name='report'),
url(r'^settings/$', views.settings, name='settings'),
url(r'^edit/(?P<admin_id>\d+)$', AdminUpdateView.as_view(), name='edit'),
url(r'^profile/(?P<admin_id>\d+)$', ProfileView.as_view(), name='profile'),
]

)
8 changes: 4 additions & 4 deletions vms/authentication/urls.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Django
from django.conf.urls import patterns, url
from django.conf.urls import url
from django.contrib.auth import views as auth_views

# local Django
from authentication import views
from authentication.views import anonymous_required

urlpatterns = patterns(
'',
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^login/$',
anonymous_required(auth_views.login),
Expand All @@ -16,4 +15,5 @@
url(r'^logout/$',
auth_views.logout, {'template_name': 'home/home.html'},
name='logout_process'),
)
]

8 changes: 4 additions & 4 deletions vms/event/urls.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Django
from django.conf.urls import patterns, url
from django.conf.urls import url

# local Django
from event import views
from event.views import EventCreateView, EventDeleteView, EventUpdateView, EventListView

urlpatterns = patterns(
'',
urlpatterns = [
url(r'^create/$', EventCreateView.as_view(), name='create'),
url(r'^delete/(?P<event_id>\d+)$',
EventDeleteView.as_view(),
Expand All @@ -16,4 +15,5 @@
url(r'^list_sign_up/(?P<volunteer_id>\d+)$',
views.list_sign_up,
name='list_sign_up'),
)
]

8 changes: 4 additions & 4 deletions vms/home/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Django
from django.conf.urls import patterns, url
from django.conf.urls import url
from django.views.generic import TemplateView

urlpatterns = patterns(
'',
urlpatterns = [
url(r'^$',
TemplateView.as_view(template_name='home/home.html'),
name='index'),
)
]

8 changes: 4 additions & 4 deletions vms/job/urls.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Django
from django.conf.urls import patterns, url
from django.conf.urls import url

# local Django
from job import views
from job.views import CreateJobView, JobDeleteView, JobDetailView, JobUpdateView, JobListView

urlpatterns = patterns(
'',
urlpatterns = [
url(r'^create/$', CreateJobView.as_view(), name='create'),
url(r'^delete/(?P<job_id>\d+)$', JobDeleteView.as_view(), name='delete'),
url(r'^details/(?P<job_id>\d+)$', JobDetailView.as_view(), name='details'),
Expand All @@ -15,4 +14,5 @@
url(r'^list_sign_up/(?P<event_id>\d+)/(?P<volunteer_id>\d+)$',
views.list_sign_up,
name='list_sign_up'),
)
]

1 change: 1 addition & 0 deletions vms/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)

8 changes: 4 additions & 4 deletions vms/organization/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Django
from django.conf.urls import patterns, url
from django.conf.urls import url

# local Django
from organization.views import OrganizationCreateView, OrganizationDeleteView, OrganizationListView, OrganizationUpdateView

urlpatterns = patterns(
'',
urlpatterns = [
url(r'^create/$', OrganizationCreateView.as_view(), name='create'),
url(r'^delete/(?P<organization_id>\d+)$',
OrganizationDeleteView.as_view(),
Expand All @@ -14,4 +13,5 @@
OrganizationUpdateView.as_view(),
name='edit'),
url(r'^list/$', OrganizationListView.as_view(), name='list'),
)
]

2 changes: 1 addition & 1 deletion vms/pom/pages/adminRegistrationPage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# local Django
from basePage import BasePage
from pom.pages.basePage import BasePage
from pom.locators.adminRegistrationPageLocators import AdminRegistrationPageLocators
from pom.pageUrls import PageUrls

Expand Down
2 changes: 1 addition & 1 deletion vms/pom/pages/administratorReportPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from selenium.webdriver.support.ui import Select

# local Django
from basePage import BasePage
from pom.pages.basePage import BasePage
from pom.locators.administratorReportPageLocators import AdministratorReportPageLocators
from pom.pages.homePage import HomePage

Expand Down
2 changes: 1 addition & 1 deletion vms/pom/pages/authenticationPage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# local Django
from basePage import BasePage
from pom.pages.basePage import BasePage
from pom.locators.authenticationPageLocators import AuthenticationPageLocators
from pom.locators.homePageLocators import HomePageLocators
from pom.pageUrls import PageUrls
Expand Down
2 changes: 1 addition & 1 deletion vms/pom/pages/completedShiftsPage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# local Django
from basePage import BasePage
from pom.pages.basePage import BasePage
from pom.locators.completedShiftsPageLocators import CompletedShiftsPageLocators
from pom.pages.homePage import HomePage
from pom.pageUrls import PageUrls
Expand Down
2 changes: 1 addition & 1 deletion vms/pom/pages/eventSignUpPage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# local Django
from basePage import BasePage
from pom.pages.basePage import BasePage
from pom.locators.eventSignUpPageLocators import EventSignUpPageLocators
from pom.pages.homePage import HomePage

Expand Down
2 changes: 1 addition & 1 deletion vms/pom/pages/eventsPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from selenium.webdriver.support.ui import Select

# local Django
from basePage import BasePage
from pom.pages.basePage import BasePage
from pom.locators.eventsPageLocators import EventsPageLocators
from pom.pages.homePage import HomePage
from pom.pageUrls import PageUrls
Expand Down
2 changes: 1 addition & 1 deletion vms/pom/pages/homePage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# local Django
from basePage import BasePage
from pom.pages.basePage import BasePage
from pom.locators.homePageLocators import HomePageLocators


Expand Down
2 changes: 1 addition & 1 deletion vms/pom/pages/jobDetailsPage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# local Django
from basePage import BasePage
from pom.pages.basePage import BasePage
from pom.locators.jobDetailsPageLocators import JobDetailsPageLocators
from pom.pages.eventsPage import EventsPage

Expand Down
2 changes: 1 addition & 1 deletion vms/pom/pages/manageShiftPage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# local Django
from basePage import BasePage
from pom.pages.basePage import BasePage
from pom.locators.eventSignUpPageLocators import EventSignUpPageLocators
from pom.locators.manageShiftPageLocators import ManageShiftPageLocators
from pom.pages.homePage import HomePage
Expand Down
2 changes: 1 addition & 1 deletion vms/pom/pages/shiftDetailsPage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# local Django
from basePage import BasePage
from pom.pages.basePage import BasePage
from pom.locators.shiftDetailsPageLocators import ShiftDetailsPageLocators
from pom.pages.eventsPage import EventsPage
from pom.pageUrls import PageUrls
Expand Down
2 changes: 1 addition & 1 deletion vms/pom/pages/upcomingShiftsPage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# local Django
from basePage import BasePage
from pom.pages.basePage import BasePage
from pom.locators.upcomingShiftsPageLocators import UpcomingShiftsPageLocators
from pom.pages.completedShiftsPage import CompletedShiftsPage
from pom.pages.homePage import HomePage
Expand Down
2 changes: 1 addition & 1 deletion vms/pom/pages/volunteerProfilePage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# local Django
from basePage import BasePage
from pom.pages.basePage import BasePage
from pom.locators.volunteerProfilePageLocators import VolunteerProfilePageLocators
from pom.pages.homePage import HomePage

Expand Down
2 changes: 1 addition & 1 deletion vms/pom/pages/volunteerRegistrationPage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# local Django
from basePage import BasePage
from pom.pages.basePage import BasePage
from pom.locators.volunteerRegistrationPageLocators import VolunteerRegistrationPageLocators
from pom.pageUrls import PageUrls

Expand Down
2 changes: 1 addition & 1 deletion vms/pom/pages/volunteerReportPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from selenium.webdriver.support.ui import Select

# local Django
from basePage import BasePage
from pom.pages.basePage import BasePage
from pom.pages.authenticationPage import AuthenticationPage
from pom.locators.volunteerReportPageLocators import VolunteerReportPageLocators
from pom.pages.homePage import HomePage
Expand Down
2 changes: 1 addition & 1 deletion vms/pom/pages/volunteerSearchPage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Django
from basePage import BasePage
from pom.pages.basePage import BasePage

# local Django
from pom.locators.volunteerSearchPageLocators import VolunteerSearchPageLocators
Expand Down
1 change: 1 addition & 0 deletions vms/registration/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ class UserForm(forms.ModelForm):
class Meta:
model = User
fields = ('username', 'password')

8 changes: 4 additions & 4 deletions vms/registration/urls.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Django
from django.conf.urls import patterns, url
from django.conf.urls import url

# local Django
# from administrator.views import AdministratorSignUpView
# from registration import views
from registration.views import AdministratorSignupView, VolunteerSignupView

urlpatterns = patterns(
'',
urlpatterns = [
url(r'^signup_administrator/$',
AdministratorSignupView.as_view(),
name='signup_administrator'),
url(r'^signup_volunteer/$',
VolunteerSignupView.as_view(),
name='signup_volunteer'),
)
]

1 change: 1 addition & 0 deletions vms/registration/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,4 @@ def post(self, request):
})
else:
return render(request, 'home/home.html', {'error': True})

8 changes: 4 additions & 4 deletions vms/shift/urls.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Django
from django.conf.urls import patterns, url
from django.conf.urls import url

# local Django
from shift import views
from shift.views import AddHoursView, AddHoursManagerView, ShiftCreateView, ShiftDeleteView, ClearHoursView, EditHoursView, ShiftUpdateView, ClearHoursManager, EditHoursManagerView, JobListView, ShiftListView, ManageVolunteerShiftView, ViewHoursView, VolunteerSearchView

urlpatterns = patterns(
'',
urlpatterns = [
url(r'^add_hours/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$',
AddHoursView.as_view(),
name='add_hours'),
Expand Down Expand Up @@ -58,4 +57,5 @@
url(r'^volunteer_search/$',
VolunteerSearchView.as_view(),
name='volunteer_search'),
)
]

30 changes: 19 additions & 11 deletions vms/vms/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ['DJANGO_SECRET_KEY']

# SECURITY WARNING: run with debug turned off (DEBUG = False) in production!
DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = []

# Application definition
Expand Down Expand Up @@ -69,14 +67,24 @@
}
}

TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.core.context_processors.tz",
"django.contrib.messages.context_processors.messages")

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'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',
],
},
},
]


# Internationalization
LANGUAGE_CODE = 'en-us'

Expand Down
Loading

0 comments on commit 31ab575

Please sign in to comment.