Skip to content

Commit 72003cc

Browse files
committed
Update use at root URL documentation
- Document importing view to avoid Django warning
1 parent 8b6f4b5 commit 72003cc

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,16 @@ INSTALLED_APPS = (
3939

4040
Put in a new URL path into `onisite/urls.py` above the `core.urls` line. You can put this plugin at whatever URL you prefer, but two examples are given below.
4141

42-
```
43-
# this path will overwrite / (home)
44-
re_path(r'^$', include("onisite.plugins.featured_content.urls")),
42+
```python
43+
# This path will overwrite / (the root URL of the site)
44+
# The view is imported because including a URLconf module at the root URL
45+
# generates a Django warning
46+
from onisite.plugins.featured_content import views as fc_views
47+
...
48+
re_path(r'^$', fc_views.featured, name="featured_home"),
49+
4550

46-
# this path will put the plugin at /featured_content
51+
# This path will put the plugin at /featured_content
4752
re_path(r'^featured_content/', include("onisite.plugins.featured_content.urls")),
4853

4954

0 commit comments

Comments
 (0)