django -newsletter subscription

695 views Asked by At

as a newbie to python and django i set up a test project. I added the django-newsletter-subscription but i can't see it in the frontend.I am able to edit in the admin. I created an app named newsletters,added one extra field. In my newsletters file the urls.py looks like that.

from django.conf.urls import patterns, include, url
from newsletters.models import Subscription
from newsletter_subscription.backend import ModelBackend
from newsletter_subscription.urls import newsletter_subscriptions_urlpatterns

urlpatterns = patterns('',
    url(r'^newsletter/', include(newsletter_subscriptions_urlpatterns(
        backend=ModelBackend(Subscription),))
    ),
)

And in my projects file urls.py like this

from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns ('',
    # Examples:                   
    url(r'^$', 'hospital.views.home', name='home'),
    url(r'^blog/', include('blog.urls')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^intro/', include('intro.urls')),
    url(r'^newsletter/', include('newsletter.urls')),                   
)

Any help? Couldn't find a solution somehow. Thank's a lot.

1

There are 1 answers

10
chandu On

In django-newsletter-subscription the URLconf entry is something like this.

from .newsletter.models import Subscription

In your code

from newsletters.models import Subscription