Recentemente ho installato Blogango, dove ho avuto il seguente errore:campo modulo non può creare per 'created_by' ancora, perché il suo modello 'users.User' collegate non è stato caricato ancora
CommandError: One or more models did not validate:
blogango.blogentry: 'created_by' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
Così ho aggiunto impostazioni .AUTH_USER_MODEL e ora ricevo il seguente messaggio:
ValueError: Cannot create form field for 'created_by' yet, because its related model 'users.User' has not been loaded yet
ho passato la mia settings.py cui chiede AUTH_USER_MODEL = 'users.User'
, e si è trasferito più in alto sulla settings.py per cercare di farlo caricare prima.
Come richiesto: created_by = models.ForeignKey(settings.AUTH_USER_MODEL, unique=False)
Cosa posso fare per risolvere questo problema?
Possiamo vedere il modello per 'created_by'? –
La domanda ora mostra 'created_by'. –
Cosa succede se metti 'settings.AUTH_USER_MODEL' tra virgolette? cioè, 'created_by = models.ForeignKey ('settings.AUTH_USER_MODEL', unique = False) –