That answer is about reversing across apps, which I'm quite familiar with, 
and which still requires that the URL-owning app and its URLConfs be 
imported to the Django project where the reversing is being done.  The 
trouble is that the URLConf also has to import the views; which in turn 
won't import if all *their* dependencies are available.  

Thinking about it another way, I need to access a shared URLConf that 
doesn't need to import the view classes/functions that get called when a 
URL is actually accessed.  The information in the URLConf itself should be 
enough to reverse a URL, since the format and variables for each path are 
recorded in the URLConf.  But you can't create a URLConf without importing 
the views it calls; and Django will consider it invalid and refuse to 
parse/reverse those URLs for you if it doesn't have access to the views.

Is there any sensible way to work around that?
On Saturday, January 22, 2022 at 9:37:34 AM UTC-5 Jason wrote:

>
> yes, this is answered at https://stackoverflow.com/a/32171651
> On Saturday, January 22, 2022 at 8:07:09 AM UTC-5 Noemi Millman wrote:
>
>> Hi folks --
>>
>> Let's say you have two different services with different views and 
>> URLConfs; some shared modules/apps and some service-specific.  Is there a 
>> way for Service A to reverse URLs served by Service B without having to 
>> import all the dependencies that are necessary to execute Service B's views?
>>
>> thanks,
>> -Noemi
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2eb3dc31-b7d6-45b9-9e5e-59440a734675n%40googlegroups.com.

Reply via email to