It might be that the meta class should be removed (or at least, app_label should refer to the actual label of your app):
Does it work if you do that? Do you have the app in INSTALLED_APPS?
On Wednesday, May 18, 2016 at 8:39:48 AM UTC-4, Seti Volkylany wrote:
-- class Meta: app_label = 'mysessions'
Does it work if you do that? Do you have the app in INSTALLED_APPS?
On Wednesday, May 18, 2016 at 8:39:48 AM UTC-4, Seti Volkylany wrote:
https://docs.djangoproject.com/en/1.9/topics/http/ sessions/#example from django.contrib.sessions.backends.db import SessionStore as DBStore from django.contrib.sessions.base_session import AbstractBaseSession from django.db import models class CustomSession(AbstractBaseSession ): account_id = models.IntegerField(null=True, db_index=True) class Meta: app_label = 'mysessions' @classmethod def get_session_store_class(cls): return SessionStore class SessionStore(DBStore): @classmethod def get_model_class(cls): return CustomSession def create_model_instance(self, data): obj = super(SessionStore, self).create_model_instance(data ) try: account_id = int(data.get('_auth_user_id')) except (ValueError, TypeError): account_id = None obj.account_id = account_id return objIn settings registered as next:SESSION_ENGINE = 'apps.app_sessions.backends.extended_session_store' When I made attempt create migrations, Django - silentIn [6]: !./manage.py makemigrations No changes detected
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9bf971e9-c792-4e87-800c-7aac3a2407a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment