Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

models.py 1.2KB

1 year ago
1234567891011121314151617181920212223242526272829303132333435
  1. from django.contrib.sessions.base_session import AbstractBaseSession, BaseSessionManager
  2. class SessionManager(BaseSessionManager):
  3. use_in_migrations = True
  4. class Session(AbstractBaseSession):
  5. """
  6. Django provides full support for anonymous sessions. The session
  7. framework lets you store and retrieve arbitrary data on a
  8. per-site-visitor basis. It stores data on the server side and
  9. abstracts the sending and receiving of cookies. Cookies contain a
  10. session ID -- not the data itself.
  11. The Django sessions framework is entirely cookie-based. It does
  12. not fall back to putting session IDs in URLs. This is an intentional
  13. design decision. Not only does that behavior make URLs ugly, it makes
  14. your site vulnerable to session-ID theft via the "Referer" header.
  15. For complete documentation on using Sessions in your code, consult
  16. the sessions documentation that is shipped with Django (also available
  17. on the Django web site).
  18. """
  19. objects = SessionManager()
  20. @classmethod
  21. def get_session_store_class(cls):
  22. from django.contrib.sessions.backends.db import SessionStore
  23. return SessionStore
  24. class Meta(AbstractBaseSession.Meta):
  25. db_table = "django_session"