ここに私の問題があります: OSQA に PyBBM を統合しましたが、パッケージの管理セクションのすべてのリンクが「壊れています」
たとえば、「追加」をクリックすると、
http://localhost:8080/osqa/nimda/
なりました
http://localhost:8080/osqa/nimda/(.*)pybb/category/add/
ページを変更せずに。
これは私のプロジェクトのメインの urls.py ファイルです
from django.conf.urls.defaults import *
from django.utils.translation import ugettext as _
from django.conf import settings
urlpatterns = patterns('',
(r'', include('forum.urls')),
(r'^groups/', include('pybb.urls', namespace='pybb')), # PYBBM
)
if 'rosetta' in settings.INSTALLED_APPS:
urlpatterns = patterns('',
url(r'^rosetta/', include('rosetta.urls')),
) + urlpatterns
handler404 = 'forum.views.meta.page'
handler500 = 'forum.views.meta.error_handler'
OSQAのアプリ「forum」のurls.pyの一部です
import startup
import os.path
from forum import settings
from django.conf.urls.defaults import *
from django.conf import settings as djsettings
from django.contrib import admin
from forum import views as app
from forum.sitemap import OsqaSitemap
from django.utils.translation import ugettext as _
import logging
admin.autodiscover()
sitemaps = {
'questions': OsqaSitemap
}
APP_PATH = os.path.dirname(__file__)
try:
admin_url = url(r'^%s(.*)' % _('nimda/'), admin.site.root)
except AttributeError:
admin_url = url(r'^%s(.*)' % _('nimda/'), admin.site.urls)
# Choose the user urls pattern
if bool(settings.INCLUDE_ID_IN_USER_URLS.value):
core_user_urls_prefix = r'^%s(?P<id>\d+)/(?P<slug>.*)'
else:
core_user_urls_prefix = r'^%s(?P<slug>.*)'
core_urls = (
url(r'^$', app.readers.index, name='index'), admin_url,
[...]
url(r'^%s$' % _('admin/'), app.admin.dashboard, name='admin_index'),
url(r'^%s%s$' % (_('admin/'), _('switch_interface/')), app.admin.interface_switch, name='admin_switch_interface'),
url(r'^%s%s$' % (_('admin/'), _('statistics/')), app.admin.statistics, name='admin_statistics'),
url(r'^%s%s$' % (_('admin/'), _('denormalize/')), app.admin.recalculate_denormalized, name='admin_denormalize'),
url(r'^%s%s$' % (_('admin/'), _('go_bootstrap/')), app.admin.go_bootstrap, name='admin_go_bootstrap'),
url(r'^%s%s$' % (_('admin/'), _('go_defaults/')), app.admin.go_defaults, name='admin_go_defaults'),
url(r'^%s%s(?P<set_name>\w+)/(?P<var_name>\w+)/$' % (_('admin/'), _('settings/')), app.admin.get_default, name='admin_default'),
url(r'^%s%s$' % (_('admin/'), _('maintenance/')), app.admin.maintenance, name='admin_maintenance'),
url(r'^%s%s$' % (_('admin/'), _('flagged_posts/')), app.admin.flagged_posts, name='admin_flagged_posts'),
url(r'^%s%s$' % (_('admin/'), _('static_pages/')), app.admin.static_pages, name='admin_static_pages'),
url(r'^%s%s%s$' % (_('admin/'), _('static_pages/'), _('new/')), app.admin.edit_page, name='admin_new_page'),
url(r'^%s%s%s(?P<id>\d+)/$' % (_('admin/'), _('static_pages/'), _('edit/')), app.admin.edit_page, name='admin_edit_page'),
url(r'^%s%s%s(?P<id>\d+)/$' % (_('admin/'), _('static_pages/'), _('delete/')), app.admin.delete_page, name='admin_delete_page'),
url(r'^%s%s(?P<name>\w+)/$' % (_('admin/'), _('tools/')), app.admin.tools_page, name='admin_tools'),
url(r'^%s%s(?P<set_name>\w+)/$' % (_('admin/'), _('settings/')), app.admin.settings_set, name='admin_set'),
url(r'%s%s' % (_('admin/'), _('test_email_settings/')), app.admin.test_email_settings, name='test_email_settings'),
ご覧のとおり、2 つの管理セクションがあり、2 つの異なる URL でアクセスできます。
1) OSQA のメイン管理ページの場合:http://localhost:8080/osqa/admin/
2) パッケージ PyBBM の管理ページ (投稿の冒頭)http://localhost:8080/osqa/nimda/
壊れたリンクの問題は何ですか?