I have the following structure (Django 1.4):
containing_dir/
myproject/
myapp1/
myapp2/
myapp3/
myproject, myapp1,
You must have a
__init__.py
file inside your "myproject" directory. When you say:
(r'^myapp1/', include('myproject.myapp1.urls'))
you are saying "myproject" (as well as myapp1) is a python packege.
Try:
urlpatterns = [
...
url(r'^app_name/', include('app_name.urls', namespace='project_name'))
...
]
In myproject.settings make following changes :
INSTALLED_APPS = (
[..]
'myapp1',
'myapp2',
'myapp3',
)
To solve this issue just select "myproject" directory in PyCharm and set this as a source root. Your project don't know from which root it has to search for given app. It fixed the issue for me. Thank you.
Does ROOT_URLCONF
need to point to myproject.urls
?
If you place your apps inside of myproject
you need to use the proper view prefix.
urlpatterns = patterns('myproject.myapp1',
...