Ошибка Django: нет модуля с именем apps.careers

Это ошибка, которую я получаю:

14:56:03 web.1  | ImportError: No module named apps.careers

Мой основной urlconf выглядит так:

from django.conf.urls import patterns, include, url

from pinpoint.views import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', home.as_view(), name='home'),
    url(r'^home/', home.as_view(), name='home'),

    #Top Menu
    url(r'^solutions/', solutions.as_view(), name='solutions'),
    url(r'^about/', about.as_view(), name='about'),
    url(r'^contact/', contact.as_view(), name='contact'),

    #Footer
    #url(r'^careers/', include('pinpoint.apps.careers.urls')),
    url(r'^privacy/', privacy.as_view(), name='privacy'),

]

Мой apps.careers.urls выглядит так:

from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()



urlpatterns = patterns('',

    url(r'^apply/$', 'pinpoint.careers.views.careers'),

)

Мой apps.careers.views выглядит так:

    #forms imports
from pinpoint.apps.careers.forms import applicantsForm

#models imports
from pinpoint.apps.careers.models import applicantsModel

def careers(request):
    errors = []
    if request.method == 'POST':
        form = applicantsForm(request.POST)
        if form.is_valid():
            clean_form =form.cleaned_data
            collect = applicantsModel(first_name=clean_form['first_name'], last_name=clean_form['last_name'],
                linkedin_profile=clean_form['linkedin_profile'], elevator_pitch=clean_form['elevator_pitch'],
                email=clean_form['email'], phone=clean_form['phone']) #dont't need the created field
            collect.save()
            return HttpResponseRedirect('/careers/apply') #the same page, change to thankyou page later
        else:
            #say whats not valid and return it
            if not request.POST.get('first_name', ''):
                errors.append('Enter a First Name.')
            if not request.POST.get('last_name', ''):
                errors.append('Enter a Last Name.')
            if not request.POST.get('linkedin_profile', ''):
                errors.append('Enter a LinkedIn Profile.')
            if not request.POST.get('elevator_pitch', ''):
                errors.append('Enter an Elevator Pitch.')
            if not request.POST.get('email', ''):
                errors.append('Enter an Email.')
            if not request.POST.get('phone', ''):
                errors.append('Enter a Phone Number.')

            return render(request, 'careers.html', {'errors':errors})

    else:
        return render(request, 'careers.html',)

Я использую Django 1.6 в virtualenv. Я не могу понять, в чем проблема здесь. Я могу предоставить больше информации по запросу.

Изменить: вот изображение моего каталога - https://app.box.com/s/iva9hkqby1ycqpz0zci5

0 ответов

Другие вопросы по тегам