To clarify my point - one app is not calling the other app, nor is it requesting data from that other app. There is no direct flow of control or passing of data between the two. The two views are not connected.
- Step 1: A view in App 1 delivers a page to the browser. At this point, the view is out of scope. It is a function that has returned and has no more state.
- Step 2: The browser renders the page.
- Step 3: The user does something on the page that causes the browser to issue a request for a URL.
- Step 4: Django calls the view associated with that URL. That view then returns a response to the browser. This would work exactly the same as if you were to issue that request directly in your browser’s address bar. There is no “reference”, “association”, “control” or “influence” relative to the first view. There is no connection between this and the earlier request.
It would be helpful to see the full error with traceback. Having both of these as you’re showing here is an indication of something else being wrong.
Again - to be clear, the apps are not connected. That these views exist in different apps is immaterial. You are only creating a potential point of confusion by trying assign any relevance to that aspect of your project’s structure.
Yes, because you’re trying to return a full page. With using HTMX, you only want to render and return the desired div.
In the common case, this involves either creating a custom view and template for that fragment, or using one of the available libraries or techniques to render the complete page and then extract the desired portion. (e.g. See Using HTMX and django-template-partials together)
Side note: This, by itself, would not be considered in many circles to be a sufficient reason to split this into separate apps. Do you have a known intent to split these and reuse them in separate projects? If so, then yes, absolutely split them out.
(The console_app does seem like a likely candidate for this)