app new urls not working.

30 views
Skip to first unread message

Javier Marcon

unread,
Nov 8, 2023, 8:20:51 AM11/8/23
to django...@googlegroups.com
Hello,

I have forked the partner application (using oscar_fork_app manage command), added a view and customized the PartnerConfig class in apps.py but I can't make Django pick my changes, when I run manage.py show_urls the new url is never shown.

# apps.py
from django.urls import path

import oscar.apps.partner.apps as apps
from oscar.core.loading import get_class


class PartnerConfig(apps.PartnerConfig):
    name = 'market_verde.partner'

    def ready(self):
        super().ready()
        self.create_partner_view = get_class("partner.views", "PartnerCreateView")

    def get_urls(self):
        urls = [
            path("partners/add", self.create_partner_view.as_view(), name="partner_add"),
        ]
        default_urls = super().get_urls()
        return self.post_process_urls(urls) + default_urls

I will appreciate if you can give me a clue.

Thanks,

Javier.



Ben Stähli

unread,
Nov 8, 2023, 8:55:43 AM11/8/23
to django...@googlegroups.com
Have you updated INSTALLED_APPS, and put your custom catalogue there?
> --
> https://github.com/django-oscar/django-oscar
> http://django-oscar.readthedocs.org/en/latest/
> ---
> You received this message because you are subscribed to the Google
> Groups "django-oscar" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to django-oscar...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/django-oscar/e1b15af8-6269-43ab-950b-6b1adc9be5dd%40gmail.com
> .

--
Ben Stähli
bnzk GmbH | +41 22 575 25 77 | bnzk.ch
--

Javier Marcon

unread,
Nov 8, 2023, 9:30:12 AM11/8/23
to django...@googlegroups.com
Yes, thanks, I forgot to mention I added
"market_verde.partner.apps.PartnerConfig",
to installed apps, and removed
"oscar.apps.partner.apps.PartnerConfig",
from installed apps.



Thanks,

Javier.

El 8/11/23 a las 10:55, Ben Stähli escribió:

Ben Stähli

unread,
Nov 8, 2023, 9:36:41 AM11/8/23
to django...@googlegroups.com
sorry, no clue then as well!

AG

unread,
Nov 8, 2023, 10:17:53 AM11/8/23
to django...@googlegroups.com
Hey, hi, hello!
Add new urls to main urls.py

Regards, Alex

> 8 нояб. 2023 г., в 17:36, Ben Stähli <bn...@bnzk.ch> написал(а):
>
> sorry, no clue then as well!
> --
> https://github.com/django-oscar/django-oscar
> http://django-oscar.readthedocs.org/en/latest/
> ---
> You received this message because you are subscribed to the Google Groups "django-oscar" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/django-oscar/7c4190da1ab2b2e1e54b8a7d296f29fa293821c4.camel%40bnzk.ch.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages