Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
pub
/
flynn-django-template
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
40ffe74e
authored
Dec 25, 2017
by
yothinix
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade project template based on Django 2.0
parent
d9df5c3c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
17 deletions
+23
-17
manage.py
+8
-3
project_name/settings.py
+6
-6
project_name/urls.py
+8
-7
project_name/wsgi.py
+1
-1
No files found.
manage.py
View file @
40ffe74e
...
...
@@ -4,7 +4,12 @@ import sys
if
__name__
==
"__main__"
:
os
.
environ
.
setdefault
(
"DJANGO_SETTINGS_MODULE"
,
"{{ project_name }}.settings"
)
from
django.core.management
import
execute_from_command_line
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
)
project_name/settings.py
View file @
40ffe74e
...
...
@@ -3,10 +3,10 @@ Django settings for {{ project_name }} project on Heroku. For more info, see:
https://github.com/heroku/heroku-django-template
For more information on this file, see
https://docs.djangoproject.com/en/
1.11
/topics/settings/
https://docs.djangoproject.com/en/
2.0
/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/
1.11
/ref/settings/
https://docs.djangoproject.com/en/
2.0
/ref/settings/
"""
import
os
...
...
@@ -18,7 +18,7 @@ PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/
1.11
/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/
2.0
/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY
=
"{{ secret_key }}"
...
...
@@ -75,7 +75,7 @@ WSGI_APPLICATION = '{{ project_name }}.wsgi.application'
# Database
# https://docs.djangoproject.com/en/
1.11
/ref/settings/#databases
# https://docs.djangoproject.com/en/
2.0
/ref/settings/#databases
DATABASES
=
{
'default'
:
{
...
...
@@ -100,7 +100,7 @@ AUTH_PASSWORD_VALIDATORS = [
]
# Internationalization
# https://docs.djangoproject.com/en/
1.11
/topics/i18n/
# https://docs.djangoproject.com/en/
2.0
/topics/i18n/
LANGUAGE_CODE
=
'en-us'
TIME_ZONE
=
'UTC'
...
...
@@ -118,7 +118,7 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
ALLOWED_HOSTS
=
[
'*'
]
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/
1.11
/howto/static-files/
# https://docs.djangoproject.com/en/
2.0
/howto/static-files/
STATIC_ROOT
=
os
.
path
.
join
(
PROJECT_ROOT
,
'staticfiles'
)
STATIC_URL
=
'/static/'
...
...
project_name/urls.py
View file @
40ffe74e
"""{{ project_name }} URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/
{{ docs_version }}
/topics/http/urls/
https://docs.djangoproject.com/en/
2.0
/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns:
url(r'^$
', views.home, name='home')
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:
url(r'^$
', Home.as_view(), name='home')
2. Add a URL to urlpatterns:
path('
', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.
conf.urls import url, include
2. Add a URL to urlpatterns:
url(r'^
blog/', include('blog.urls'))
1. Import the include() function: from django.
urls import include, path
2. Add a URL to urlpatterns:
path('
blog/', include('blog.urls'))
"""
from
django.conf.urls
import
url
from
django.contrib
import
admin
from
django.urls
import
path
urlpatterns
=
[
url
(
r'^
admin/'
,
admin
.
site
.
urls
),
path
(
'
admin/'
,
admin
.
site
.
urls
),
]
project_name/wsgi.py
View file @
40ffe74e
...
...
@@ -4,7 +4,7 @@ WSGI config for {{ project_name }} project.
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.11
/howto/deployment/wsgi/
https://docs.djangoproject.com/en/
2.0
/howto/deployment/wsgi/
"""
import
os
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment