-
Notifications
You must be signed in to change notification settings - Fork 19
Upgrade to rapidsms2.2.0 #16
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
Open
sovello
wants to merge
6
commits into
rapidsms:develop
Choose a base branch
from
sovello:upgrade-to-rapidsms2.2.0
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1f3fb5a
Upgrade django and rapidsms requirements
sovello 6b41371
Change urls to use the newer re_path method
sovello fe0e180
Upgrade from MIDDLEWARE_CLASSES to MIDDLEWARE as for Django 5
sovello d73d52c
Replace TEMPLATE_DIRS with TEMPLATES
sovello 2b37270
Move CONTEXT_PROCESSORS to TEMPLATES entry
sovello bb5062f
Upgrade from os.path to using Path from Pathlib
sovello File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,17 @@ | ||
| # Django settings for {{ project_name }} project. | ||
|
|
||
| import os | ||
| from pathlib import Path | ||
|
|
||
| # The top directory for this project. Contains requirements/, manage.py, | ||
| # and README.rst, a {{ project_name }} directory with settings etc (see | ||
| # PROJECT_PATH), as well as a directory for each Django app added to this | ||
| # project. | ||
| PROJECT_ROOT = os.path.dirname(os.path.dirname(__file__)) | ||
| BASE_DIR = Path(__file__).resolve().parent.parent | ||
|
|
||
| # The directory with this project's templates, settings, urls, static dir, | ||
| # wsgi.py, fixtures, etc. | ||
| PROJECT_PATH = os.path.join(PROJECT_ROOT, '{{ project_name }}') | ||
| PROJECT_PATH = BASE_DIR / '{{ project_name }}' | ||
|
|
||
| DEBUG = True | ||
| TEMPLATE_DEBUG = DEBUG | ||
|
|
||
| ADMINS = ( | ||
| # ('Your Name', '[email protected]'), | ||
|
|
@@ -24,7 +22,7 @@ | |
| DATABASES = { | ||
| 'default': { | ||
| 'ENGINE': 'django.db.backends.sqlite3', | ||
| 'NAME': '{{ project_name }}.db', | ||
| 'NAME': BASE_DIR / '{{ project_name }}.db', | ||
| 'USER': '', | ||
| 'PASSWORD': '', | ||
| 'HOST': '', | ||
|
|
@@ -55,7 +53,7 @@ | |
|
|
||
| # Absolute filesystem path to the directory that will hold user-uploaded files. | ||
| # Example: "/home/media/media.lawrence.com/public/media/" | ||
| MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'public', 'media') | ||
| MEDIA_ROOT = BASE_DIR / 'public' / 'media' | ||
|
|
||
| # URL that handles the media served from MEDIA_ROOT. Make sure to use a | ||
| # trailing slash. | ||
|
|
@@ -66,15 +64,15 @@ | |
| # Don't put anything in this directory yourself; store your static files | ||
| # in apps' "static/" subdirectories and in STATICFILES_DIRS. | ||
| # Example: "/home/media/media.lawrence.com/public/static/" | ||
| STATIC_ROOT = os.path.join(PROJECT_ROOT, 'public', 'static') | ||
| STATIC_ROOT = BASE_DIR / 'public' / 'static' | ||
|
|
||
| # URL prefix for static files. | ||
| # Example: "http://media.lawrence.com/static/" | ||
| STATIC_URL = '/static/' | ||
|
|
||
| # Additional locations of static files to collect | ||
| STATICFILES_DIRS = ( | ||
| os.path.join(PROJECT_PATH, 'static'), | ||
| PROJECT_PATH / 'static', | ||
| ) | ||
|
|
||
| # List of finder classes that know how to find static files in | ||
|
|
@@ -87,29 +85,12 @@ | |
| # Make this unique, and don't share it with anybody. | ||
| SECRET_KEY = '{{ secret_key }}' | ||
|
|
||
| # List of callables that know how to import templates from various sources. | ||
| TEMPLATE_LOADERS = ( | ||
| 'django.template.loaders.filesystem.Loader', | ||
| 'django.template.loaders.app_directories.Loader', | ||
| ) | ||
|
|
||
| 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.core.context_processors.request', | ||
| 'django.contrib.messages.context_processors.messages', | ||
| ) | ||
|
|
||
| MIDDLEWARE_CLASSES = ( | ||
| 'django.middleware.common.CommonMiddleware', | ||
| 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', | ||
| ) | ||
|
|
@@ -119,12 +100,28 @@ | |
| # Python dotted path to the WSGI application used by Django's runserver. | ||
| WSGI_APPLICATION = '{{ project_name }}.wsgi.application' | ||
|
|
||
| TEMPLATE_DIRS = ( | ||
| os.path.join(PROJECT_PATH, 'templates'), | ||
| ) | ||
| TEMPLATES = [ | ||
| { | ||
| 'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
| 'DIRS': [PROJECT_PATH / 'templates'], | ||
| 'APP_DIRS': True, | ||
| 'OPTIONS': { | ||
| 'context_processors': [ | ||
| 'django.template.context_processors.debug', | ||
| 'django.template.context_processors.request', | ||
| 'django.template.context_processors.i18n', | ||
| 'django.template.context_processors.media', | ||
| 'django.template.context_processors.static', | ||
| 'django.template.context_processors.tz', | ||
| 'django.contrib.auth.context_processors.auth', | ||
| 'django.contrib.messages.context_processors.messages', | ||
| ], | ||
| }, | ||
| }, | ||
| ] | ||
|
|
||
| FIXTURE_DIRS = ( | ||
| os.path.join(PROJECT_PATH, 'fixtures'), | ||
| PROJECT_PATH / 'fixtures', | ||
| ) | ||
|
|
||
| # A sample logging configuration. | ||
|
|
@@ -161,7 +158,7 @@ | |
| 'level': 'DEBUG', | ||
| 'class': 'logging.FileHandler', | ||
| 'formatter': 'basic', | ||
| 'filename': os.path.join(PROJECT_PATH, 'rapidsms.log'), | ||
| 'filename': PROJECT_PATH / 'rapidsms.log', | ||
| }, | ||
| }, | ||
| 'loggers': { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,19 @@ | ||
| from django.conf import settings | ||
| from django.conf.urls import include, url | ||
| from django.conf.urls.static import static | ||
| from django.urls import include, re_path, path | ||
| from django.contrib import admin | ||
|
|
||
|
|
||
| urlpatterns = [ | ||
| url(r'^admin/', include(admin.site.urls)), | ||
| path(r'admin/', admin.site.urls), | ||
| # RapidSMS core URLs | ||
| url(r'^accounts/', include('rapidsms.urls.login_logout')), | ||
| url(r'^$', 'rapidsms.views.dashboard', name='rapidsms-dashboard'), | ||
| re_path(r'^accounts/', include('rapidsms.urls.login_logout')), | ||
| re_path(r'^$', rapidsms.views.dashboard, name='rapidsms-dashboard'), | ||
| # RapidSMS contrib app URLs | ||
| url(r'^httptester/', include('rapidsms.contrib.httptester.urls')), | ||
| url(r'^messagelog/', include('rapidsms.contrib.messagelog.urls')), | ||
| url(r'^messaging/', include('rapidsms.contrib.messaging.urls')), | ||
| url(r'^registration/', include('rapidsms.contrib.registration.urls')), | ||
| re_path(r'^httptester/', include('rapidsms.contrib.httptester.urls')), | ||
| re_path(r'^messagelog/', include('rapidsms.contrib.messagelog.urls')), | ||
| re_path(r'^messaging/', include('rapidsms.contrib.messaging.urls')), | ||
| re_path(r'^registration/', include('rapidsms.contrib.registration.urls')), | ||
|
|
||
| # Third party URLs | ||
| url(r'^selectable/', include('selectable.urls')), | ||
| re_path(r'^selectable/', include('selectable.urls')), | ||
| ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| Django>=1.8,<1.9 | ||
| RapidSMS==0.21.0 | ||
| Django>=5.2,<5.3 | ||
| RapidSMS==2.2.0 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing an
import rapidsms.Then it works for me.