On Fri, Jul 12, 2013 at 6:18 PM, Nkansah Rexford <[email protected]> wrote:
> My problem is the one in the question on the site. the Second answer is the
> solution.
>
> I'm using django 1.5.1
>
> My problem is the same as the one on the site
If you are copying your code from the question verbatim the problem
is in the mysite.urls.py file, it has this import::
from mysite.books import views
But there is no mysite.books Python module and that must be the cause
of the import error.
The parent mysite filesystem folder (the one with a manage.py file in it)
has nothing to do with this and isn't a Python module. It's simply
a container folder (you can rename to whe name you wish it if you can).
The books module is in the python module search
path so, to import a books app view you simply can use::
from books import views
The recommendation given in answer #2 to move the books app's Python
module under the mysite project python module is bogus because it takes
things back to where they were in Django <= 1.3.
All this is described in the documentation:
Introductory tutorial:
https://docs.djangoproject.com/en/1.5/intro/tutorial01/#creating-a-project
Other places:
starproject command documentation:
https://docs.djangoproject.com/en/1.5/ref/django-admin/#startproject-projectname-destination
Django 1.4 release notes:
https://docs.djangoproject.com/en/1.5/releases/1.4/#updated-default-project-layout-and-manage-py
--
Ramiro Morales
@ramiromorales
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.