Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
magicfelix
AlekSIS-Core
Commits
f92ce074
Verified
Commit
f92ce074
authored
2 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Mount API URLs directly under app namespace and not under /django/
parent
039b944a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/urls.py
+14
-4
14 additions, 4 deletions
aleksis/core/urls.py
with
14 additions
and
4 deletions
aleksis/core/urls.py
+
14
−
4
View file @
f92ce074
from
importlib
import
import_module
from
django.apps
import
apps
from
django.apps
import
apps
from
django.conf
import
settings
from
django.conf
import
settings
from
django.contrib
import
admin
from
django.contrib
import
admin
...
@@ -410,10 +412,18 @@ for app_config in apps.app_configs.values():
...
@@ -410,10 +412,18 @@ for app_config in apps.app_configs.values():
continue
continue
try
:
try
:
urlpatterns
.
append
(
urls_module
=
import_module
(
f
"
{
app_config
.
name
}
.urls
"
)
path
(
f
"
django/app/
{
app_config
.
label
}
/
"
,
include
(
f
"
{
app_config
.
name
}
.urls
"
))
)
if
hasattr
(
urls_module
,
"
urlpatterns
"
):
except
ModuleNotFoundError
:
urlpatterns
.
append
(
path
(
f
"
django/app/
{
app_config
.
label
}
/
"
,
include
(
urls_module
.
urlpatterns
))
)
if
hasattr
(
urls_module
,
"
api_urlpatterns
"
):
urlpatterns
.
append
(
path
(
f
"
app/
{
app_config
.
label
}
/
"
,
include
(
urls_module
.
api_urlpatterns
))
)
except
ImportError
:
# Ignore exception as app just has no URLs
# Ignore exception as app just has no URLs
pass
# noqa
pass
# noqa
...
...
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