| 266 | | INSERT INTO packages (label, name) VALUES ('redirects', 'redirects'); |
| 267 | | UPDATE content_types SET package = 'redirects', python_module_name = 'redirects' WHERE package = 'core' AND python_module_name = 'redirects'; |
| 268 | | UPDATE auth_permissions SET package = 'redirects' WHERE package = 'core' AND codename IN ('add_redirect', 'change_redirect', 'delete_redirect'); |
| 269 | | }}} |
| 270 | | * If you're using PostgreSQL, execute this SQL: |
| 271 | | {{{ |
| 272 | | ALTER TABLE redirects_id_seq RENAME TO django_redirects_id_seq; |
| 273 | | ALTER TABLE django_redirects ALTER COLUMN id DROP DEFAULT; |
| 274 | | ALTER TABLE django_redirects ALTER COLUMN id SET DEFAULT nextval('public.django_redirects_id_seq'::text); |
| | 265 | }}} |
| | 266 | * If you're using PostgreSQL, execute this additional SQL: |
| | 267 | {{{ |
| | 276 | * Add {{{"django.contrib.flatpages"}}} to your {{{INSTALLED_APPS}}}. |
| | 277 | * Add {{{"django.contrib.flatpages.middleware.FlatpageFallbackMiddleware"}}} to your {{{MIDDLEWARE_CLASSES}}}. |
| | 278 | |
| | 279 | ==== If you want to use redirects ==== |
| | 280 | |
| | 281 | * Execute the following SQL: |
| | 282 | {{{ |
| | 283 | ALTER TABLE redirects RENAME TO django_redirects; |
| | 284 | INSERT INTO packages (label, name) VALUES ('redirects', 'redirects'); |
| | 285 | UPDATE content_types SET package = 'redirects', python_module_name = 'redirects' WHERE package = 'core' AND python_module_name = 'redirects'; |
| | 286 | UPDATE auth_permissions SET package = 'redirects' WHERE package = 'core' AND codename IN ('add_redirect', 'change_redirect', 'delete_redirect'); |
| | 287 | }}} |
| | 288 | * If you're using PostgreSQL, execute this additional SQL: |
| | 289 | {{{ |
| | 290 | ALTER TABLE redirects_id_seq RENAME TO django_redirects_id_seq; |
| | 291 | ALTER TABLE django_redirects ALTER COLUMN id DROP DEFAULT; |
| | 292 | ALTER TABLE django_redirects ALTER COLUMN id SET DEFAULT nextval('public.django_redirects_id_seq'::text); |
| | 293 | }}} |
| | 294 | * Add {{{"django.contrib.redirects"}}} to your {{{INSTALLED_APPS}}}. |
| | 295 | * Add {{{"django.contrib.redirects.middleware.RedirectFallbackMiddleware"}}} to your {{{MIDDLEWARE_CLASSES}}}. |