Browse Source

Merged views and core apps.

Rafał Pitoń 11 years ago
parent
commit
1263d286cd

+ 2 - 2
misago/conf/defaults.py

@@ -52,8 +52,8 @@ MIDDLEWARE_CLASSES = (
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'django.middleware.clickjacking.XFrameOptionsMiddleware',
     'django.middleware.clickjacking.XFrameOptionsMiddleware',
-    'misago.core.middleware.ThreadStoreMiddleware',
-    'misago.views.middleware.ExceptionHandlerMiddleware',
+    'misago.core.middleware.threadstore.ThreadStoreMiddleware',
+    'misago.core.middleware.exceptionhandler.ExceptionHandlerMiddleware',
 )
 )
 
 
 # Register Misago directories
 # Register Misago directories

+ 1 - 1
misago/views/errorpages.py → misago/core/errorpages.py

@@ -3,7 +3,7 @@ from django.shortcuts import render
 
 
 def _error_page(request, code, message=None):
 def _error_page(request, code, message=None):
     response = render(request,
     response = render(request,
-                      'misago/front/%s.html' % code,
+                      'misago/%s.html' % code,
                       {'message': message})
                       {'message': message})
     response.status_code = code
     response.status_code = code
     return response
     return response

+ 0 - 0
misago/views/exceptionhandler.py → misago/core/exceptionhandler.py


+ 0 - 0
misago/views/exceptions.py → misago/core/exceptions.py


+ 0 - 0
misago/views/__init__.py → misago/core/middleware/__init__.py


+ 0 - 0
misago/views/middleware.py → misago/core/middleware/exceptionhandler.py


+ 0 - 0
misago/core/middleware.py → misago/core/middleware/threadstore.py


+ 1 - 1
misago/views/shortcuts.py → misago/core/shortcuts.py

@@ -1,5 +1,5 @@
 from django.shortcuts import *
 from django.shortcuts import *
-from misago.views.exceptions import OutdatedSlug
+from misago.core.exceptions import OutdatedSlug
 
 
 
 
 def check_object_slug(model, slug):
 def check_object_slug(model, slug):

+ 0 - 0
misago/views/tests/__init__.py → misago/core/tests/__init__.py


+ 1 - 1
misago/views/tests/test_errorpages.py → misago/core/tests/test_errorpages.py

@@ -1,6 +1,6 @@
 from django.core.urlresolvers import reverse
 from django.core.urlresolvers import reverse
 from django.test import TestCase
 from django.test import TestCase
-from misago.views import errorpages
+from misago.core import errorpages
 
 
 
 
 class ErrorPageViewsTests(TestCase):
 class ErrorPageViewsTests(TestCase):

+ 2 - 2
misago/views/tests/test_exceptionhandler.py → misago/core/tests/test_exceptionhandler.py

@@ -3,8 +3,8 @@ from django.core import exceptions as django_exceptions
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.test import TestCase
 from django.test import TestCase
 from django.test.client import RequestFactory
 from django.test.client import RequestFactory
-from misago.views.exceptions import OutdatedSlug
-from misago.views import exceptionhandler
+from misago.core.exceptions import OutdatedSlug
+from misago.core import exceptionhandler
 
 
 
 
 INVALID_EXCEPTIONS = (
 INVALID_EXCEPTIONS = (

+ 1 - 1
misago/views/tests/test_middleware.py → misago/core/tests/test_middleware.py

@@ -2,7 +2,7 @@ from django.core.urlresolvers import reverse
 from django.http import Http404
 from django.http import Http404
 from django.test import TestCase
 from django.test import TestCase
 from django.test.client import RequestFactory
 from django.test.client import RequestFactory
-from misago.views.middleware import ExceptionHandlerMiddleware
+from misago.core.middleware.exceptionhandler import ExceptionHandlerMiddleware
 
 
 
 
 class ExceptionHandlerMiddlewareTests(TestCase):
 class ExceptionHandlerMiddlewareTests(TestCase):

+ 1 - 1
misago/views/tests/test_shortcuts.py → misago/core/tests/test_shortcuts.py

@@ -1,5 +1,5 @@
 from django.test import TestCase
 from django.test import TestCase
-from misago.views.shortcuts import check_object_slug, OutdatedSlug
+from misago.core.shortcuts import check_object_slug, OutdatedSlug
 
 
 
 
 class MockModel(object):
 class MockModel(object):

+ 1 - 1
misago/views/tests/test_utils.py → misago/core/tests/test_utils.py

@@ -1,7 +1,7 @@
 from django.core.urlresolvers import reverse
 from django.core.urlresolvers import reverse
 from django.test import TestCase
 from django.test import TestCase
 from django.test.client import RequestFactory
 from django.test.client import RequestFactory
-from misago.views.utils import is_request_to_misago
+from misago.core.utils import is_request_to_misago
 
 
 
 
 VALID_PATHS = (
 VALID_PATHS = (

+ 0 - 0
misago/views/tests/test_views.py → misago/core/tests/test_views.py


+ 0 - 0
misago/views/utils.py → misago/core/utils.py


+ 1 - 1
misago/views/views.py → misago/core/views.py

@@ -2,4 +2,4 @@ from django.shortcuts import render
 
 
 
 
 def forum_index(request):
 def forum_index(request):
-    return render(request, 'misago/front/index.html')
+    return render(request, 'misago/index.html')

+ 0 - 6
misago/templates/misago/front/403.html

@@ -1,6 +0,0 @@
-<h1>Misago Error 403</h1>
-{% if message %}
-<p>{{ message }}</p>
-{% else %}
-<p>Request not allowed.</p>
-{% endif %}

+ 0 - 2
misago/templates/misago/front/404.html

@@ -1,2 +0,0 @@
-<h1>Misago Error 404</h1>
-<p>Page not found.</p>

+ 0 - 0
misago/templates/misago/front/base.html


+ 0 - 1
misago/templates/misago/front/index.html

@@ -1 +0,0 @@
-Hello world, I'm placeholder index template!