Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3765804
D2069.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D2069.diff
View Options
diff --git a/.gitignore b/.gitignore
new file mode 100644
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+__pycache__/
+db.sqlite3
diff --git a/README b/README
--- a/README
+++ b/README
@@ -5,7 +5,7 @@
This server allows you to run you own Tasacora web service.
- It relies on Python 3.4 and Django 1.8.
+ It relies on Python 3.5 and Django 2.2.
Support
=======
diff --git a/manage.py b/manage.py
--- a/manage.py
+++ b/manage.py
@@ -1,12 +1,21 @@
#!/usr/bin/env python3
-
+"""Django's command-line utility for administrative tasks."""
import os
import sys
-if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tasacora_server.settings")
+def main():
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tasacora_server.settings')
+ try:
+ from django.core.management import execute_from_command_line
+ except ImportError as exc:
+ raise ImportError(
+ "Couldn't import Django. Are you sure it's installed and "
+ "available on your PYTHONPATH environment variable? Did you "
+ "forget to activate a virtual environment?"
+ ) from exc
+ execute_from_command_line(sys.argv)
- from django.core.management import execute_from_command_line
- execute_from_command_line(sys.argv)
+if __name__ == '__main__':
+ main()
diff --git a/requirements.txt b/requirements.txt
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
-Django==1.8
+Django==2.2.1
django-extensions==1.5.2
six==1.9.0
diff --git a/tasacora_server/settings.py b/tasacora_server/settings.py
--- a/tasacora_server/settings.py
+++ b/tasacora_server/settings.py
@@ -1,60 +1,77 @@
"""
Django settings for tasacora_server project.
+Generated by 'django-admin startproject' using Django 2.2.1.
+
For more information on this file, see
-https://docs.djangoproject.com/en/1.7/topics/settings/
+https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
-https://docs.djangoproject.com/en/1.7/ref/settings/
+https://docs.djangoproject.com/en/2.2/ref/settings/
"""
-# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
-BASE_DIR = os.path.dirname(os.path.dirname(__file__))
+
+# 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.7/howto/deployment/checklist/
+# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
-SECRET_KEY = '7gcawy)wodyrey55fc56i^fsc50*5zzaz=yzn4ux&186#76s^z'
+SECRET_KEY = 'c(%(pkqf8^%db&cqc@9#&@n!w!!#8^rz+afv&ha6e7=nd_+d41'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
-TEMPLATE_DEBUG = True
-
ALLOWED_HOSTS = []
# Application definition
-INSTALLED_APPS = (
+INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
-)
+]
-MIDDLEWARE_CLASSES = (
+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.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
-)
+]
ROOT_URLCONF = 'tasacora_server.urls'
+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',
+ ],
+ },
+ },
+]
+
WSGI_APPLICATION = 'tasacora_server.wsgi.application'
# Database
-# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
+# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
DATABASES = {
'default': {
@@ -63,8 +80,28 @@
}
}
+
+# Password validation
+# https://docs.djangoproject.com/en/2.2/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',
+ },
+]
+
+
# Internationalization
-# https://docs.djangoproject.com/en/1.7/topics/i18n/
+# https://docs.djangoproject.com/en/2.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
@@ -78,6 +115,6 @@
# Static files (CSS, JavaScript, Images)
-# https://docs.djangoproject.com/en/1.7/howto/static-files/
+# https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL = '/static/'
diff --git a/tasacora_server/urls.py b/tasacora_server/urls.py
--- a/tasacora_server/urls.py
+++ b/tasacora_server/urls.py
@@ -1,10 +1,21 @@
-from django.conf.urls import patterns, include, url
-from django.contrib import admin
+"""tasacora_server URL Configuration
-urlpatterns = patterns('',
- # Examples:
- # url(r'^$', 'tasacora_server.views.home', name='home'),
- # url(r'^blog/', include('blog.urls')),
+The `urlpatterns` list routes URLs to views. For more information please see:
+ https://docs.djangoproject.com/en/2.2/topics/http/urls/
+Examples:
+Function views
+ 1. Add an import: from my_app import views
+ 2. Add a URL to urlpatterns: path('', views.home, name='home')
+Class-based views
+ 1. Add an import: from other_app.views import Home
+ 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
+Including another URLconf
+ 1. Import the include() function: from django.urls import include, path
+ 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
+"""
+from django.contrib import admin
+from django.urls import path
- url(r'^admin/', include(admin.site.urls)),
- )
+urlpatterns = [
+ path('admin/', admin.site.urls),
+]
diff --git a/tasacora_server/wsgi.py b/tasacora_server/wsgi.py
--- a/tasacora_server/wsgi.py
+++ b/tasacora_server/wsgi.py
@@ -4,11 +4,13 @@
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
-https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
+https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
-from django.core.wsgi import get_wsgi_application
import os
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tasacora_server.settings")
+
+from django.core.wsgi import get_wsgi_application
+
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tasacora_server.settings')
application = get_wsgi_application()
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 14:24 (19 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2258216
Default Alt Text
D2069.diff (7 KB)
Attached To
Mode
D2069: Upgrade Django to 2.2.
Attached
Detach File
Event Timeline
Log In to Comment