PageRenderTime 18ms CodeModel.GetById 11ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/docs/migrations.rst

http://github.com/feincms/feincms
ReStructuredText | 36 lines | 24 code | 12 blank | 0 comment | 0 complexity | 22ccc95a79d48b89b5e69057fd3f75cb MD5 | raw file
 1.. _migrations:
 2
 3======================================
 4Database migration support for FeinCMS
 5======================================
 6
 7
 8FeinCMS itself does not come with any migrations. It is recommended that you
 9add migrations for FeinCMS models yourself inside your project.
10
11
12Django's builtin migrations
13===========================
14
15This guide assumes that you are using both the page and the medialibrary
16module from FeinCMS. Simply leave out medialibrary if unused.
17
18* Create a new folder named ``migrate`` in your app with an empty
19  ``__init__.py`` inside.
20* Add the following configuration to your ``settings.py``::
21
22    MIGRATION_MODULES = {
23        'page': 'yourapp.migrate.page',
24        'medialibrary': 'yourapp.migrate.medialibrary',
25    }
26
27.. warning::
28
29   You **must not** use ``migrations`` as folder name for the FeinCMS
30   migrations, otherwise Django **will** get confused.
31
32* Create initial migrations and apply them::
33
34    ./manage.py makemigrations medialibrary
35    ./manage.py makemigrations page
36    ./manage.py migrate