2015-02-23 35 views
2

我想覆盖django-oscar中的客户应用程序。为此,我在项目中的应用程序文件夹中创建了客户应用程序。当我运行该项目,我遇到了在Django 1.7.4错误如下:从Django-Oscar扩展客户的观点

django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: customer 

我通过文档就在Django https://docs.djangoproject.com/en/1.7/ref/applications/#django.apps.AppConfig,但它不工作了。那么是否有其他方式来扩展任何django-oscar的应用程序并根据需求修改代码。

这是我的客户应用程序的views.py:

from oscar.apps.customer.views import ProfileView as CoreProfileView 

class ProfileView(CoreProfileView): 
    template_name = 'new_account.html' 

及以下项目的settings.py代码片断:

INSTALLED_APPS = [ 
    'apps.customer', 
] 

在此先感谢。

回答

4

运行此命令从Django的奥斯卡在此改变应用

./manage.py oscar_fork_app appname yourprojectname 

为yourprojectname,你的文件夹路径到应用程序应创建

一旦运行此命令一个新的应用程序将与overided模型来创建,admin files.now添加应用程序路径

get_core_apps(['yourproject.order'])在settings.py文件中。

欲了解更多信息,请参阅您的帮助

http://django-oscar.readthedocs.org/en/latest/topics/customisation.html

+0

感谢。它像魅力一样工作..! – Jay 2015-02-24 09:32:38