Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Django Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Tobias Mieves
Django Core
Commits
f2cce29a
Commit
f2cce29a
authored
Sep 27, 2023
by
Tobias Mieves
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' into 'main'
Configure Django to serve static and media files itself See merge request
!19
parents
47a08b5d
5aab2242
Branches
Branches containing commit
Tags
v2.0.1
Tags containing commit
1 merge request
!19
Configure Django to serve static and media files itself
Pipeline
#191896
passed
Sep 27, 2023
Stage: test
Stage: docker
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/urls.py
+6
-5
6 additions, 5 deletions
core/urls.py
start.sh
+0
-1
0 additions, 1 deletion
start.sh
with
6 additions
and
6 deletions
core/urls.py
+
6
−
5
View file @
f2cce29a
...
...
@@ -13,14 +13,15 @@ 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.urls.static
import
static
from
django.contrib
import
admin
from
django.urls
import
path
,
include
from
core
import
settings
from
django.contrib
import
admin
from
django.urls
import
path
,
include
,
re_path
from
django.views.static
import
serve
urlpatterns
=
[
path
(
"
admin/
"
,
admin
.
site
.
urls
),
path
(
"
accounts/
"
,
include
(
"
django.contrib.auth.urls
"
)),
path
(
""
,
include
(
"
{{app_to_install}}.urls
"
)),
]
+
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
re_path
(
r
"
^media/(?P<path>.*)$
"
,
serve
,
{
"
document_root
"
:
settings
.
MEDIA_ROOT
}),
re_path
(
r
"
^static/(?P<path>.*)$
"
,
serve
,
{
"
document_root
"
:
settings
.
STATIC_ROOT
}),
]
This diff is collapsed.
Click to expand it.
start.sh
+
0
−
1
View file @
f2cce29a
#!/bin/bash
source
/venv/bin/activate
cd
/app
||
exit
echo
"----- Collect static files ------ "
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment