2013-08-02 3 views
0

그래서 나는이를 설치하려고 : https://zipfelchappe.readthedocs.org/en/latest/을 거기 단계FeinCMS에 타사 앱을 설치하는 방법은 무엇입니까?

나는 다음과 같이 설정 내 models.py이 URL이 예를 들어

거기에서 파일을 끌어 방법에 대한 매우 혼란 스러워요을 따랐다 :

django.db 수입 모델
from django.utils.translation import ugettext_lazy as _ 

from feincms.module.page.models import Page 
from feincms.content.richtext.models import RichTextContent 
from feincms.content.medialibrary.models import MediaFileContent 
from feincms.content.application.models import ApplicationContent 
from feincms.module.extensions import datepublisher 
from feincms.module.extensions import translations 

from zipfelchappe.models import Project 


Page.register_templates({ 
    'title': _('Standard template'), 
    'path': 'base.html', 
    'regions': (
     ('main', _('Main content area')), 
     ('sidebar', _('Sidebar'), 'inherited'), 
     ), 
    }) 

Page.create_content_type(RichTextContent) 
Page.create_content_type(MediaFileContent, TYPE_CHOICES=(
    ('default', _('default')), 
    ('lightbox', _('lightbox')), 
    )) 

Page.create_content_type(ApplicationContent, APPLICATIONS=(
    ('zipfelchappe.urls', _('Zipfelchappe projects')), 
)) 


Project.register_regions(
    ('main', _('Content')), 
) 

Project.register_extensions(
    'zipfelchappe.extensions.categories', 
    #'zipfelchappe.extensions.paypal_receivers', 
) 

Project.create_content_type(RichTextContent) 
Project.create_content_type(MediaFileContent, TYPE_CHOICES=(
    ('default', _('default')), 
    ('lightbox', _('lightbox')), 
    )) 

내가 드롭 다운에서 Zipfelchappe projects이 있음을보고 내 페이지에 추가 할 때와 경쟁 나의 새로운 페이지를 만들

에서

장고에서

: 페이지 승 나는 다른 콘텐츠 형식이 보여하지만 ... 내 zipfelchappe.urls에 문제가

이제 내 urls.py 파일이되어 있기 때문에 이것이 가정하고, 아무것도 볼 .conf.urls 수입 패턴, django.contrib 수입 관리자에서 URL 을 포함

admin.autodiscover() 

urlpatterns = patterns('', 
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')), 
    url(r'^admin/', include(admin.site.urls)), 
    url(r'', include('feincms.urls')), 
    url(r'^zipfelchappe/paypal/', include('zipfelchappe.paypal.urls')), 
) 

내가 http://www.feinheit.ch/media/labs/feincms/integration.html의 단계를 수행하려고하지만, 자신의 예를 들어 내 관련이 있는지 내가 확실히 이해하지 않습니다. 그가 모범적 인 타사 앱에서 특정 모델을 가져 오는 것 같습니다 .... 어떤 특정 모델을 가져올 지 모르겠습니다.

답변

0

어디에서나 타사 앱 URL을 포함하면 루트에서 해당 행을 제거하면 안됩니다 URL을, 대신 Project 모델이 추가 :

@app_models.permalink 
def get_absolute_url(self): 
    return ('project_detail', 'zipfelchappe.urls',(), { 
     'slug': self.slug, 
    }) 

또는 어떤 이름 당신의 상세보기를

이것은 feincms 시스템에 사용할 수있는 뷰를 만들 것입니다 (당신의 zipfelchappe의 URL을 모듈 참조)에 의해 반전 될 수 마치 현재 페이지는 앱의 루트입니다. 이것이 의도하지 않은 것이라면 cms 페이지 구조 내에서 앱을 통합하는 것을 방해해서는 안됩니다.

그러나 설명서에 설명 된대로 PagePretender을 사용하여 feincms 탐색 내에서 URL을 "주입"할 수 있습니다.

관련 문제