|
@@ -1,7 +1,10 @@
|
|
|
+from os.path import basename
|
|
|
+
|
|
|
import six
|
|
|
-import django
|
|
|
from django.apps import apps
|
|
|
-from os.path import basename
|
|
|
+
|
|
|
+from .utils import rstrip_str
|
|
|
+
|
|
|
|
|
|
class AppURLsMeta(type):
|
|
|
def __init__(cls, name, bases, data):
|
|
@@ -13,8 +16,8 @@ class AppURLsMeta(type):
|
|
|
else:
|
|
|
# Default : sets
|
|
|
# exported_urlpatterns = [(<app_name>, <app_url_module>)]
|
|
|
- current_path = basename(__file__).rstrip('.py')
|
|
|
- url_module = cls.__module__.rstrip(current_path) + '.urls'
|
|
|
+ current_path = '.' + rstrip_str(rstrip_str(basename(__file__), '.pyc'), '.py')
|
|
|
+ url_module = rstrip_str(cls.__module__, current_path) + '.urls'
|
|
|
cls.exported_urlpatterns = [(data['name'], url_module)]
|
|
|
|
|
|
cls.urlprefix = data.pop('urlprefix', None)
|