Editing a file does not seem to refresh Django pycache -


i trying create own user auth model in django removing username field , replacing email field.

the model stored in it's own file in app.user.

i keep getting error:

app.user: (auth.e003) 'user.email' must unique because named 'username_field'.

now, changed line email field be:

email = models.emailfield(unique = true) 

but reason cannot seem bite, or edit in file. in fact can delete file , runserver, on full restart, same error.

as make edit settings.py or bites , works, without refreshing cache user model though (only updating cache detects edited).

this has led me believe edits file not correctly updating it's pycache.

how can file scanned , updated django?

move custom user model app.models , set auth_user_model='app.user'. django parses auth_user_model value 'app_name.model_name' , attempts from app_name.models import model_name, if model not in models.py not found.

here doc link reference: https://docs.djangoproject.com/en/1.8/topics/auth/customizing/#substituting-a-custom-user-model


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -