ImportError: No module named 'sitngo.app_site' (api class)

33 views
Skip to first unread message

Сергей Озеранский

unread,
Jun 22, 2016, 1:26:01 PM6/22/16
to Tastypie
from sitngo.app_site.models import CarsPropertiesClass, Cars
ImportError: No module named 'sitngo.app_site'
CarsPropertiesClass and Cars this is my Model class

The error occurs when any call python manage.py

my CarsResource.py
from tastypie.resources import ModelResource

from sitngo.app_site.models import Cars


class CarsResource(ModelResource):
class Meta:
queryset = Cars.objects.all()
resource_name = 'cars'

my urls.py
from django.conf.urls import url, include
from tastypie.api import Api

from sitngo.app_site.api import CarsResource

v1_api = Api(api_name='v1')
v1_api.register(CarsResource())

urlpatterns = [
url(r'^api/', include(v1_api.urls))
]

Stodge

unread,
Jul 27, 2016, 11:37:32 AM7/27/16
to Tastypie
What directory are these files located in?

sitngo/app_site

?

Cheers
Mike

Rene Zelaya

unread,
Mar 16, 2017, 11:15:48 AM3/16/17
to Tastypie
Usually, if your app folders are in the root directory, (and in the case, where the name of your app is 'app_site') you would just import them with something like
from app_site.models import Cars

Cheers,
Rene
Reply all
Reply to author
Forward
0 new messages