Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fdw-forks
django-database-files
Commits
0df51117
Commit
0df51117
authored
Jun 18, 2018
by
Arthur Shevchenko
Browse files
Add initial Django 2.0 support.
parent
959cc441
Changes
3
Hide whitespace changes
Inline
Side-by-side
database_files/settings.py
View file @
0df51117
import
os
from
django.conf
import
settings
from
django.
core.urlresolver
s
import
reverse
from
django.
url
s
import
reverse
# If true, when file objects are created, they will be automatically copied
# to the local file system for faster serving.
...
...
database_files/storage.py
View file @
0df51117
...
...
@@ -7,7 +7,7 @@ from six import StringIO
from
django.conf
import
settings
from
django.core
import
files
from
django.core.files.storage
import
FileSystemStorage
from
django.
core.urlresolver
s
import
reverse
from
django.
url
s
import
reverse
from
database_files
import
models
from
database_files
import
utils
...
...
database_files/urls.py
View file @
0df51117
try
:
# Removed in Django 1.6
from
django.conf.urls.defaults
import
patterns
,
url
except
ImportError
:
from
django.conf.urls
import
patterns
,
url
from
django.urls
import
re_path
urlpatterns
=
patterns
(
''
,
from
database_files
import
views
urlpatterns
=
[
# url(r'^files/(?P<name>.+)$',
# 'database_files.views.serve',
# name='database_file'),
url
(
r
'^files/(?P<name>.+)$'
,
'database_files.
views.serve_mixed
'
,
re_path
(
r
'^files/(?P<name>.+)$'
,
views
.
serve_mixed
,
name
=
'database_file'
),
)
]
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