Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Django to more modern version #40

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Make usable intranet.
1. Install Python 3. Developed using version 3.5.2.
2. Install poetry
3. `git clone <repo_url>` and `cd` into the directory
5. Run `poetry install`
5. Run `poetry install` (if you do not have postgres installed on your local machine, you might have to edit the `pyproject.toml` file to replace `psycopg` with `psycopg-binary`
6. Run `poetry shell`

Follow the instructions on setting up a [postgres database](https://www.digitalocean.com/community/tutorials/how-to-use-postgresql-with-your-django-application-on-ubuntu-14-04) if you want to set up the database in the same way it is set up on Heroku. Set it up using the settings in `settings.py`.
Expand Down
2 changes: 1 addition & 1 deletion apply/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import List

from django.contrib import admin, messages
from django.db.models import Sum, QuerySet, Field
from django.db.models import Field, QuerySet, Sum
from django.http import HttpRequest, HttpResponse
from ordered_model.admin import OrderedTabularInline, OrderedInlineModelAdminMixin

Expand Down
1 change: 1 addition & 0 deletions eshcIntranet/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@

DATABASES = {}
DATABASES['default'] = dj_database_url.config()
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

PASSWORD_HASHERS = [
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
Expand Down
18 changes: 9 additions & 9 deletions eshcIntranet/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from django.conf.urls import include
from django.contrib import admin
from allauth.account import urls
from django.urls import path

import home

urlpatterns = [
url(r'', include('home.urls')),
url(r'^admin/', admin.site.urls),
path('', include('home.urls')),
path('admin/', admin.site.urls),
# url(r'^users/', include('users.urls', namespace='users')),
url(r'^leases/', include('leases.urls')),
url(r'^polls/', include('polls.urls')),
url(r'^hours/', include('hours.urls')),
url(r'^whiteboard/', include('whiteboard.urls')),
path('leases/', include('leases.urls')),
path('polls/', include('polls.urls')),
path('hours/', include('hours.urls')),
path('whiteboard/', include('whiteboard.urls')),
path('apply/', include('apply.urls')),
path('finance/', include('finance.urls')),

# allauth
url(r'^accounts/', include('allauth.urls')),
url(r'^accounts/profile/', home.views.profile, name='profile'),
path('accounts/', include('allauth.urls')),
path('accounts/profile/', home.views.profile, name='profile'),

path('notifications/', include('django_nyt.urls')),
path('wiki/', include('wiki.urls')),
Expand Down
39 changes: 19 additions & 20 deletions home/urls.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
"""Defines URL patterns for home"""

from django.conf.urls import url
from . import views
from django.urls import path

app_name = 'home'

urlpatterns = [
# Home page
url(r'^$', views.index, name='index'),
url(r'^mail/$', views.mail_test, name='mail_test'),
path('', views.index, name='index'),
path('mail/', views.mail_test, name='mail_test'),
# User profile editing
url(r'^accounts/edit_profile/$', views.edit_profile, name='edit_profile'),
url(r'^accounts/signup/$', views.MySignupView.as_view()),
path('accounts/edit_profile/', views.edit_profile, name='edit_profile'),
path('accounts/signup/', views.MySignupView.as_view()),

url(r'^map/$', views.map, name='map'),
url(r'^gms/$', views.gms, name='gms'),
url(r'^archive/$', views.archive, name='archive'),
url(r'^gms/(?P<pk>[0-9]+)/$', views.agenda, name='agenda'),
url(r'^gms/(?P<id>[0-9]+)/submit/$', views.submit, name='submit'),
url(r'^gms/(?P<id>[0-9]+)/submit_update/$', views.submit_update, name='submit_update'),
url(r'^gms/(?P<id>[0-9]+)/upload_minutes/$', views.upload_minutes, name='upload_minutes'),
url(r'^gms/(?P<pk>[0-9]+)/delete/$', views.delete, name='delete'),
url(r'^groups/$', views.groups, name='groups'),
url(r'^cash/$', views.cash, name='cash'),
url(r'^wsp/$', views.wsp, name='wsp'),
url(r'^wsp_subgroups/$', views.wsp_subgroups, name='wsp_subgroups'),
url(r'^laundry/$', views.laundry, name='laundry'),
url(r'^taskforces/$',views.taskforces,name='taskforces')
path('map/', views.map, name='map'),
path('gms/', views.gms, name='gms'),
path('archive/', views.archive, name='archive'),
path('gms/<int:pk>/', views.agenda, name='agenda'),
path('gms/<int:id>/submit/', views.submit, name='submit'),
path('gms/<int:id>/submit_update/', views.submit_update, name='submit_update'),
path('gms/<int:id>/upload_minutes/', views.upload_minutes, name='upload_minutes'),
path('gms/<int:pk>/delete/', views.delete, name='delete'),
path('groups/', views.groups, name='groups'),
path('cash/', views.cash, name='cash'),
path('wsp/', views.wsp, name='wsp'),
path('wsp_subgroups/', views.wsp_subgroups, name='wsp_subgroups'),
path('laundry/', views.laundry, name='laundry'),
path('taskforces/', views.taskforces,name='taskforces')
]
5 changes: 2 additions & 3 deletions hours/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""Defines URL patterns for hours"""

from django.conf.urls import url
from . import views
from django.urls import path

app_name = 'hours'

urlpatterns = [
url(r'^$', views.index, name='index'),
path('', views.index, name='index'),
]
5 changes: 3 additions & 2 deletions leases/urls.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"""Defines URL patters for leases"""

from django.conf.urls import url, include
from django.conf.urls import include

from . import views
from django.urls import path

app_name = 'leases'

urlpatterns = [
# Inventory page
url(r'^inventory/(?P<pk>[0-9]+)$', views.inventory, name='inventory'),
path('inventory/<int:pk>', views.inventory, name='inventory'),
]
124 changes: 81 additions & 43 deletions poetry.lock

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

2 changes: 1 addition & 1 deletion polls/forms.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from django import forms
from .models import Question
from django.contrib.admin.widgets import AdminDateWidget
from django.utils.translation import ugettext_lazy as _

import datetime
from django.utils import timezone
from django.utils.translation import gettext_lazy as _


class QuestionSubmitForm(forms.ModelForm):
Expand Down
10 changes: 5 additions & 5 deletions polls/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from django.conf.urls import url
from . import views
from django.urls import path

app_name = 'polls'

urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^submit/$', views.submit, name='submit'),
url(r'^(?P<pk>[0-9]+)/delete/$', views.delete, name='delete'),
url(r'^(?P<pk>[0-9]+)/$', views.detail, name='detail'),
path('', views.index, name='index'),
path('submit/', views.submit, name='submit'),
path('<int:pk>/delete/', views.delete, name='delete'),
path('<int:pk>/', views.detail, name='detail'),
]
Loading