I'm trying to move the main view into a new main app (folder) inside speedy/mail. Currently the file urls.py is like this:
Now I want to move the main page url & view to speedy/mail/main/urls.py and views.py. Now the urls.py is like this:
from django.conf import settings
from django.conf.urls import url, include
from django.conf.urls.static import static
urlpatterns = [
url(r'^feedback/', include('speedy.net.feedback.urls', namespace='feedback')),
url(r'', include('speedy.mail.main.urls', namespace='main')),
]
if settings.DEBUG:
urlpatterns = static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + urlpatterns
try:
import debug_toolbar
urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
]
except ImportError:
pass
And speedy/mail/main/urls.py is like this:
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'', views.MainPageView.as_view(), name='main_page_view'),
]
But the problem is it doesn't work, I get this error message:
DoesNotExist at /
Site matching query does not exist.
I also tried with r'^' instead of r'' but it still doesn't work. What did I do wrong?
Thanks,
Uri.