Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wocat-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
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
ISRIC
wocat
wocat-web
Commits
3ffa5644
Commit
3ffa5644
authored
2 years ago
by
Andreas Nüßlein
Browse files
Options
Downloads
Patches
Plain Diff
urls cleanup
parent
90fd78a6
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
config/urls.py
+15
-15
15 additions, 15 deletions
config/urls.py
wocat/medialibrary/urls.py
+0
-5
0 additions, 5 deletions
wocat/medialibrary/urls.py
wocat/search/apps.py
+0
-5
0 additions, 5 deletions
wocat/search/apps.py
wocat/search/urls.py
+0
-5
0 additions, 5 deletions
wocat/search/urls.py
with
15 additions
and
30 deletions
config/urls.py
+
15
−
15
View file @
3ffa5644
...
...
@@ -4,12 +4,13 @@ from django.contrib import admin
from
django.urls
import
path
,
re_path
,
include
from
django.views
import
defaults
as
default_views
from
django.views.generic
import
RedirectView
,
TemplateView
from
wagtail.admin
import
urls
as
wagtailadmin_urls
from
wagtail.contrib.sitemaps.views
import
sitemap
from
wagtail.documents
import
urls
as
wagtaildocs_urls
from
wocat.cms.views
import
AddLanguagePrefixRedirectView
from
wocat.core.views
import
SwitchLanguageView
from
wocat.medialibrary.views
import
MediaDetailView
from
wocat.search.views
import
SearchView
from
wocat.users.views
import
ReactivateAccountView
BACKEND_NAME
=
"
WOCAT backend
"
...
...
@@ -27,17 +28,28 @@ urlpatterns = [
name
=
"
reactivate_account
"
,
),
path
(
"
accounts/
"
,
include
(
"
allauth.urls
"
)),
path
(
"
library/media/
"
,
include
(
"
wocat.medialibrary.urls
"
)
),
path
(
"
library/media/
<int:pk>/
"
,
MediaDetailView
.
as_view
(),
name
=
"
media_detail
"
),
# Redirect requests to fileadmin/* (old document folder) to new media library
path
(
"
fileadmin/
"
,
RedirectView
.
as_view
(
url
=
"
/en/wocat-media-library
"
)),
path
(
"
glossary/
"
,
include
(
"
wocat.glossary.urls
"
)),
path
(
"
institutions/
"
,
include
(
"
wocat.institutions.urls
"
)),
path
(
"
countries/
"
,
include
(
"
wocat.countries.urls
"
)),
path
(
"
search/
"
,
include
(
"
wocat.search.urls
"
)
),
path
(
"
search/
"
,
SearchView
.
as_view
(),
name
=
"
search_index
"
),
path
(
"
cmsviews/
"
,
include
(
"
wocat.cms.urls
"
)),
path
(
"
newsletter/
"
,
include
(
"
wocat.newsletter.urls
"
)),
# Your stuff: custom urls includes go here
path
(
"
i18n/
"
,
SwitchLanguageView
.
as_view
(),
name
=
"
set_language
"
),
path
(
"
api/
"
,
include
(
"
wocat.api.urls
"
)),
# Users should not be deleted! Manually catching requests to delete users
# in the CMS and showing them a message.
path
(
"
cms/users/<int:pk>/delete/
"
,
view
=
TemplateView
.
as_view
(
template_name
=
"
users/confirm_delete.html
"
),
name
=
"
cms_user_delete
"
,
),
# CMS
path
(
"
cms/
"
,
include
(
"
wagtail.admin.urls
"
)),
path
(
"
documents/
"
,
include
(
wagtaildocs_urls
)),
]
# Static files
urlpatterns
+=
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
...
...
@@ -65,19 +77,7 @@ if settings.DEBUG:
path
(
"
styleguide/
"
,
include
(
"
wocat.styleguide.urls
"
)),
]
urlpatterns
+=
[
path
(
"
api/
"
,
include
(
"
wocat.api.urls
"
))]
urlpatterns
+=
[
# Users should not be deleted! Manually catching requests to delete users
# in the CMS and showing them a message.
path
(
"
cms/users/<int:pk>/delete/
"
,
view
=
TemplateView
.
as_view
(
template_name
=
"
users/confirm_delete.html
"
),
name
=
"
cms_user_delete
"
,
),
# CMS
path
(
"
cms/
"
,
include
(
wagtailadmin_urls
)),
path
(
"
documents/
"
,
include
(
wagtaildocs_urls
)),
re_path
(
r
"
^(?!({})|static|media)(.+)
"
.
format
(
"
|
"
.
join
([
l
[
0
]
for
l
in
settings
.
LANGUAGES
])
...
...
This diff is collapsed.
Click to expand it.
wocat/medialibrary/urls.py
deleted
100644 → 0
+
0
−
5
View file @
90fd78a6
from
django.urls
import
path
from
.views
import
MediaDetailView
urlpatterns
=
[
path
(
"
<int:pk>/
"
,
view
=
MediaDetailView
.
as_view
(),
name
=
"
media_detail
"
)]
This diff is collapsed.
Click to expand it.
wocat/search/apps.py
deleted
100644 → 0
+
0
−
5
View file @
90fd78a6
from
django.apps
import
AppConfig
class
SearchConfig
(
AppConfig
):
name
=
"
wocat.search
"
This diff is collapsed.
Click to expand it.
wocat/search/urls.py
deleted
100644 → 0
+
0
−
5
View file @
90fd78a6
from
django.urls
import
path
from
.views
import
SearchView
urlpatterns
=
[
path
(
""
,
view
=
SearchView
.
as_view
(),
name
=
"
search_index
"
)]
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