Hi! It looks like the problem is with Site query, not urlconf. Do you use 
django.contrib.sites? If so, check SITE_ID variable in your django settings, it 
probably contains non-existant Site id.
> On 14 Dec 2016, at 17:31, Uri Even-Chen <[email protected]> wrote:
> 
> Dear Django Users,
> 
> 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:
> 
> from django.conf import settings
> from django.conf.urls import url, include
> 
> from . import views
> from django.conf.urls.static import static
> 
> urlpatterns = [
>     url(r'^feedback/', include('speedy.net.feedback.urls', 
> namespace='feedback')),
>     url(r'^', views.MainPageView.as_view(), name='main_page_view'),
> ]
> 
> 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
> 
> 
> 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.
> 
> Uri Even-Chen  
>       Phone: +972-54-3995700 <tel:+972-54-3995700>
> Email: [email protected] <mailto:[email protected]>
> Website: http://www.speedysoftware.com/uri/en/ 
> <http://www.speedysoftware.com/uri/en/>
>  <http://www.facebook.com/urievenchen>  <http://plus.google.com/+urievenchen> 
>  <http://www.linkedin.com/in/urievenchen>  <http://github.com/urievenchen>  
> <http://twitter.com/urievenchen>
> 
> -- 
> 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] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/django-users 
> <https://groups.google.com/group/django-users>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAMQ2MsGcTG1%3D%3D7z1z1Y1F9r-d6PggJeYJD63%3DzQe%3DDU%3DhSNW9A%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/django-users/CAMQ2MsGcTG1%3D%3D7z1z1Y1F9r-d6PggJeYJD63%3DzQe%3DDU%3DhSNW9A%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/95DF3477-9626-4F82-9828-F585A4D1E17C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to