Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
R
red-ci-cd
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
red-group-test
red-ci-cd
Commits
b1a6e858
Commit
b1a6e858
authored
Jan 16, 2020
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trial #1 to fix issue on serving of media files
parent
7809b717
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
config/settings/base.py
config/settings/base.py
+6
-1
config/urls.py
config/urls.py
+4
-1
No files found.
config/settings/base.py
View file @
b1a6e858
...
@@ -128,8 +128,13 @@ USE_TZ = False
...
@@ -128,8 +128,13 @@ USE_TZ = False
# Static files (CSS, JavaScript, Images)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
# https://docs.djangoproject.com/en/2.2/howto/static-files/
if
DEBUG
:
STATIC_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'/static'
)
else
:
STATIC_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'static'
)
STATIC_URL
=
'/static/'
STATIC_URL
=
'/static/'
STATIC_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
"static"
)
#
STATIC_ROOT = os.path.join(BASE_DIR, "static")
MEDIA_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'media'
)
MEDIA_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'media'
)
MEDIA_URL
=
'/media/'
MEDIA_URL
=
'/media/'
...
...
config/urls.py
View file @
b1a6e858
...
@@ -20,6 +20,7 @@ from app.applicationlayer.management.notification import views as notifview
...
@@ -20,6 +20,7 @@ from app.applicationlayer.management.notification import views as notifview
from
django.views.static
import
serve
from
django.views.static
import
serve
from
django.conf
import
settings
from
django.conf
import
settings
from
django.conf.urls.static
import
static
from
django.conf.urls.static
import
static
import
django.views.static
as
try_static
urlpatterns
=
[
urlpatterns
=
[
...
@@ -41,3 +42,5 @@ urlpatterns = [
...
@@ -41,3 +42,5 @@ urlpatterns = [
if
settings
.
DEBUG
:
if
settings
.
DEBUG
:
urlpatterns
+=
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
urlpatterns
+=
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
urlpatterns
+=
static
(
settings
.
STATIC_URL
,
document_root
=
settings
.
STATIC_ROOT
)
urlpatterns
+=
static
(
settings
.
STATIC_URL
,
document_root
=
settings
.
STATIC_ROOT
)
else
:
urlpatterns
+=
[
url
(
r'^static/(?P<path>.*)$'
,
django
.
views
.
static
.
serve
,
{
'document_root'
:
try_static
.
STATIC_ROOT
,
'show_indexes'
:
try_static
.
DEBUG
})]
\ No newline at end of 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