Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Sistem Informasi Zakat
Sizakat 5.0 (Refactoring)
Sizakat Backend
Commits
a7529d0a
Commit
a7529d0a
authored
Aug 03, 2020
by
addffa
Browse files
[CHORES] menambahkan konfigurasi media file
parent
92fe44ba
Pipeline
#51261
passed with stage
in 10 minutes and 2 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
sizakat/settings.py
View file @
a7529d0a
...
...
@@ -139,4 +139,6 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL
=
'/static/'
STATIC_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
"staticfiles"
)
STATIC_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'staticfiles'
)
MEDIA_URL
=
'/img/'
MEDIA_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'images'
)
sizakat/urls.py
View file @
a7529d0a
...
...
@@ -13,6 +13,8 @@ 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.conf
import
settings
from
django.conf.urls.static
import
static
from
django.contrib
import
admin
from
django.urls
import
path
from
django.views.decorators.csrf
import
csrf_exempt
...
...
@@ -22,3 +24,8 @@ urlpatterns = [
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'graphql/'
,
csrf_exempt
(
GraphQLView
.
as_view
(
graphiql
=
True
))),
]
if
settings
.
DEBUG
:
urlpatterns
+=
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
Write
Preview
Supports
Markdown
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