Вообще-то всё должно быть банально просто: ./manage.py migrate myapp Но так как приложение уже было, то нужно было игнорировать первую миграцию, которая создает базу,а запустить вторую, которая делала обновления. В моем случае такое решение: ./manage.py migrate myapp 0001 —fake./manage.py migrate myapp 0002
Posts Tagged: Django
Djnago-CMS: Добавление nofollow ко всем внешним ссылкам
Задача: Сделать добавление nofollow ко всем внешним ссылкам. Решение: Сделаем через middleware class NofollowLinkMiddleware(object): »’ Adds nofolow to external links»’ def __init__(self): self.extlinks = re.compile(r»'<a (?P[^>]*http.?://)»’) def process_response(self, request, response): if («text» in response[‘Content-Type’]): response.content = self.extlinks.sub(‘<a rel=»nofollow» g’,response.content) return response else: return response
Django: 3 способа добавления robots.txt
Django: 3 способа добавления robots.txt Оригинал: http://fredericiana.com/2010/06/09/three-ways-to-add-a-robots-txt-to-your-django-project/ Кеш
Django: наследование блоков (block.super)
Полезная штука в Django шаблонах: Template A: {% block abc %}A{% endblock %} Template B: {% extends «A» %} {% block abc %}{{ block.super }}B{% endblock %} Template A will be rendered as «A», B as «AB»
Django-CMS: Какая разница между application, plugin, snippet?
Официальный ответ с группы Django-cms: A snippet is just any piece of text. You can define them in your Django admin. Plugins are pieces of django-cms code (that you can write yourself) that have a template and that can add any variables to the context for that template. You could for example create a cms… Read more »
Запуск консоли для работы с Django проектом
Запуск консоли для работы с Django проектом: python manage.py shell
Django: отображение сгенерированного sql из модели
Dajngo: отображение сгенерированного sql из модели: python manage.py sql myapp
AttributeError: ‘module’ object has no attribute ‘get_ancestors’
AttributeError: ‘module’ object has no attribute ‘get_ancestors’ Решение добыто здесь: http://dev.good-guy.me/archives/463 Суть: удалять django-mptt
Свежие комментарии