hello, Still new to Django and I am using Django 5.0 and Python 3.11 to attempt a map sit (eventually with leaflet). I want the “mainmenu” to launch a page from the selection of the user. The “App” model has the “app.name” and the “app.pagelink”. I am unable to get out of the members app. Similar to this: Redirect to a different app
I have 3 apps inside the project, jobinfo, members and booking. The url.py in the project (maps_proj) is
from django.contrib import admin
from django.urls import path, include
admin.site.site_header = "Administration Page"
admin.site.site_title = "SSI Database"
admin.site.index_title = "SSI Map Admin"
urlpatterns = [
path("admin/", admin.site.urls),
path("signin/", include("members.urls")),
path("", include("members.urls")),
path('jobinfo/', include("jobinfo.urls"))
]
my signin page in the “members” app works fine and launches the
The members url.py
from django.urls import path
from . import views
urlpatterns = [
path("", views.signin, name="signin"),
path("mainmenu/", views.mainmenu, name="mainmenu"),
path("mainmenu/jobinfo/", views.jobinfo, name="mainjob"),
]
The jobinfo urls.py is:
from django.urls import path
from jobinfo.views import MarkersMapView
from . import views
urlpatterns = [
path("jobinfo/", views.jobinfo, name="jobinfo"),
path( "jobinfo/map/", MarkersMapView.as_view(), name='jobmap' ),
]
the html to make the jump/link is:
{% for app in all_apps %}
<!-- <li onclick="window.location = '{{app.pagelink}}'">{{app.name}}</li> -->
<li onclick="window.location = '{{app.pagelink}}'">{{app.name}}</li>
{% endfor %}
I have swapped out the text in the html > ‘{{app.pagelink}}’ to many things to try and not use the variable and hard code something here. What is the correct syntax to get to a view in the jobinfo app?
Any help is always appreciated.