Login

Turn off django 1.7 migrations

Author:
denisviklov
Posted:
September 15, 2015
Language:
Python
Version:
1.7
Score:
0 (after 0 ratings)

Useful snippet for everyone who wants turn off django 1.7 migrations for example for unittesting or who wants create database with "syncdb" command.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#drop in your settings.py

class DisableMigrations(object):

    def __contains__(self, item):
        return True

    def __getitem__(self, item):
        return "notmigrations"

MIGRATION_MODULES = DisableMigrations()

More like this

  1. Browser-native date input field by kytta 1 month, 1 week ago
  2. Generate and render HTML Table by LLyaudet 1 month, 2 weeks ago
  3. My firs Snippets by GutemaG 1 month, 3 weeks ago
  4. FileField having auto upload_to path by junaidmgithub 2 months, 4 weeks ago
  5. LazyPrimaryKeyRelatedField by LLyaudet 3 months ago

Comments

Please login first before commenting.