TYPO3 v 7.6.13 新闻5.3.1 realurl 2.1.5
我已将ext:news的stock realurl配置添加到我的站点(手动realurl.conf)。
我的网址读作:
www.example.com/news/story/news/detail/News/thisismystorytitle
我的页面树:
Root
-News (News - List)
--Story (News - Detail)
我的真实配置
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array (
'www.mysite.com' =>
array (
'init' =>
array (
'appendMissingSlash' => 'ifNotFile,redirect',
'emptyUrlReturnValue' => '/',
),
'pagePath' =>
array (
'rootpage_id' => '1',
),
'fileName' =>
array (
'defaultToHTMLsuffixOnPrev' => 0,
'acceptHTMLsuffix' => 1,
'index' =>
array (
'print' =>
array (
'keyValues' =>
array (
'type' => 98,
),
),
),
),
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array('en'=>0, 'cy'=>1),
'noMatch' => 'bypass',
),
), // end preVars
'postVarSets' =>
array (
'_DEFAULT' =>
array (
// EXT:news start
'news' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
),
array(
'GETvar' => 'tx_news_pi1[controller]',
),
array(
'GETvar' => 'tx_news_pi1[news]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_news',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'autoUpdate' => 1,
'expireDays' => 180,
),
),
),
// EXT:news end
),
),
),
);
感激如果有人可以就我的设置丢失或错误提出建议。
答案 0 :(得分:0)
配置时
Traceback (most recent call last):
File "/home/user/projects/dev/error/manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/core/management/base.py", line 342, in execute
self.check()
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/core/management/base.py", line 374, in check
include_deployment_checks=include_deployment_checks,
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 62, in _run_checks
issues.extend(super(Command, self)._run_checks(**kwargs))
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/core/management/base.py", line 361, in _run_checks
return checks.run_checks(**kwargs)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 24, in check_resolver
for pattern in resolver.url_patterns:
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 313, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 306, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/user/projects/dev/error/error/urls.py", line 19, in <module>
from questions.views import *
File "/home/user/projects/dev/error/questions/views.py", line 3, in <module>
from forms import QuestionForm
File "/home/user/projects/dev/error/questions/forms.py", line 4, in <module>
class QuestionForm(forms.ModelForm):
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/forms/models.py", line 247, in __new__
opts.field_classes)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/forms/models.py", line 166, in fields_for_model
formfield = f.formfield(**kwargs)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/db/models/fields/related.py", line 1579, in formfield
'queryset': self.remote_field.model._default_manager.using(db),
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/user/projects/dev/error/questions/models.py", line 17, in get_queryset
config = Config.objects.first()
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/db/models/query.py", line 556, in first
objects = list((self if self.ordered else self.order_by('pk'))[:1])
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/db/models/query.py", line 256, in __iter__
self._fetch_all()
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/db/models/query.py", line 1087, in _fetch_all
self._result_cache = list(self.iterator())
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/db/models/query.py", line 54, in __iter__
results = compiler.execute_sql()
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 835, in execute_sql
cursor.execute(sql, params)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/home/user/.virtualenvs/ms1.10/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 337, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: questions_config
说,动作和控制器的变量将通过。
添加valueMap和noMatch可以删除它们:
array(
'GETvar' => 'tx_news_pi1[action]',
),
array(
'GETvar' => 'tx_news_pi1[controller]',
),
请注意,这将删除这些参数,在详细操作不是默认的页面上,无法显示新闻详细信息。