CommandError: App 'accounts' does not have migrations

when i run python makemigrations accounts and python migrate accounts, it does not create a migrations folder and even when i run python migrate it migrates all apps except accounts. The app has a pycache folder though.

I expected it to create a migrations folder in the accounts app when it runs the command.

Is “accounts” in your INSTALLED_APPS setting?

Yes, makemigrations, when run with the name of the app, should create the migrations directory.

What operating system are you using?
What versions of Django and Python are involved?
What is the complete output of your makemigrations command?
I know in some cases, Python still expects to see an file. What happens if you create an empty file with that name in your accounts directory?

Yes accounts is in the settings file.
I am using windows, django 4.110, python 3.10.11

and when I run makemigrations the complete output is No changes detected in app ‘accounts’.

and when I create a migrations folder with an init file the output is Operations to perform:
Apply all migrations: (none)
Running migrations:
No migrations to apply. however it creates a pycache inside the migrations folder

What are the contents of the file in accounts?

Are there any contents within the migrations directory in accounts?

What is the output from showmigrations?

Please post your INSTALLED_APPS setting.

the has the models for my authentication system.
inside the migrations folder is a pycache folder and init.cpython-310.pyc file and from showmigrations it does not list the accounts app but lists all other apps.


Please post the actual contents of your file.
Note, when posting code here, enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted, which is critical with Python.

Also, post a directory listing of your accounts directory. (Between the lines of ``` as described above.)

sorry, before I proceed. Accounts does not in fact a file instead it references an app called core uses its models and then creates views in accounts.

Ok. So there are no models in that app to create any migrations. It’s working exactly the way it should.

Okay however the project was working perfectly before I deleted the db and run migrations again to create a new db. I noticed the fault from failing to work with the user model that is in the “core app” even though I can post users but can not login using them to like django admin.

That’s a different issue then, and not related to the lack of any migrations.

An app without models is not going to have any migrations.

If you are getting an error message from something, post the complete message with the traceback here, and we can track this down at the source.

When i run the project and try to login in as an admin I get this Please enter the correct email and password for a staff account. Note that both fields may be case-sensitive.

that is where the issue started from and there is no traceback on the terminal except for [29/Aug/2023 20:24:17] "POST /admin/login/?next=/admin/ HTTP/1.1" 200 2412

That means:

  • The email address doesn’t exist in the database.
  • The password doesn’t match the password stored in the database.
  • The account is not active.
  • The account is not marked as a staff account.

You have a couple different options here. Probably the easiest is to create a new superuser account, then use it to access the admiin to see what might be wrong with the original account.

  • the email exists the database
  • the password is the same
  • it is a staff account
  • the account is not active but I would previously log in immediately after creating a superuser from the terminal.

I can create users but can not log them in.

That would be yet a different issue.

To try and avoid confusing these different topics, please pick one issue and let’s work to resolve it. We can then address other problems later.

Okay should i continue here or start another issue

Here is fine, if we can focus on one item at a time.

I can create users but can not log them in. okay here it is then

Great. Show your model that you are using for your users, and the output of something (dumpdata, sql statement, whatever) that shows the contents of all the fields of a user that you have created.

Also specify the steps you took to create that user. If you used a script to create the user, post it.

from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.db import models
from django.utils.translation import gettext_lazy as _
from rest_framework_simplejwt.tokens import RefreshToken

from core.common import DateTimeStampMixin
from core.managers import UserManager
from utils.constants import (

from ministries.models import *

class User(AbstractBaseUser, PermissionsMixin):
    """User in the system."""

    class PermissionLevel(models.TextChoices):
        SUPER_ADMIN = SUPER_ADMIN, _("Super Admin")
        CONTACT_ADMIN = SUPER_ADMIN, _("Contact Admin")
        USER_ROLE = "USER", _("User")

    organization_category = models.ForeignKey(
    organization_name = models.ForeignKey(
    first_name = models.CharField(max_length=30, null=True, blank=True)
    last_name = models.CharField(max_length=30, null=True, blank=True)
    email = models.EmailField(max_length=30, unique=True, db_index=True)
    password = models.CharField(max_length=30)
    phone_number = models.CharField(max_length=12, null=True, blank=True)
    username = models.CharField(max_length=30, null=True, blank=True)
    identification = models.FileField(upload_to='ids/', null=True, blank=True)
    dob = models.DateField(null=True, blank=True)
    gender = models.CharField(max_length=30, null=True, blank=True)
    country = models.CharField(max_length=30, null=True, blank=True)
    district = models.CharField(max_length=30, null=True, blank=True)
    permission_level = models.CharField(

    is_active = models.BooleanField(default=False)
    is_staff = models.BooleanField(default=False)
    is_verified = models.BooleanField(default=False)

    objects = UserManager()

    USERNAME_FIELD = "email"
    REQUIRED_FIELDS = ["first_name", "last_name", "password"]

    def __str__(self):

    def full_name(self):
        return f"{self.first_name} {self.last_name}"

    def tokens(self):
        refresh = RefreshToken.for_user(self)
        return {
            "refresh": str(refresh),
            "access": str(refresh.access_token),

the dumps is

[{"model": "core.user", "pk": 1, "fields": {"last_login": null, "is_superuser": true, "organization_category": null, "organization_name": null, "first_name": "otim", "last_name": "admin", "email": "", "password": "pbkdf2_sha256$390000$SicGy5s2uvKs2gPwNxhtSG$5WEqpa7tuCs7EIMVT+YKPPw/RT5ip/VS6Bq+mjOlINY=", "phone_number": null, "username": null, "identification": "", "dob": null, "gender": null, "country": null, "district": null, "permission_level": "SUPER_ADMIN", "is_active": false, "is_staff": true, "is_verified": true, "groups": [], "user_permissions": []}}, {"model": "core.user", "pk": 2, "fields": {"last_login": null, "is_superuser": true, "organization_category": null, "organization_name": null, "first_name": "William", "last_name": "Otim", "email": "", "password": "pbkdf2_sha256$390000$ceAzxxsSif0nBbCQV6m63B$hqfvZiR0u9LCg8X6Z8yIZTd2VMjsDmOVy43/Zheodik=", "phone_number": null, "username": null, "identification": "", "dob": null, "gender": null, "country": null, "district": null, "permission_level": "SUPER_ADMIN", "is_active": false, "is_staff": true, "is_verified": true, "groups": [], "user_permissions": []}}, {"model": "core.user", "pk": 3, "fields": {"last_login": null, "is_superuser": true, "organization_category": null, "organization_name": null, "first_name": "gerison", "last_name": "otim", "email": "", "password": "pbkdf2_sha256$390000$2hVEbbAWQQ6FOo0yqfdgS8$iAI3hbrW5XdQmQigtgF3to1IvnN/0KHc8CmJA4tY5Hk=", "phone_number": null, "username": null, "identification": "", "dob": null, "gender": null, "country": null, "district": null, "permission_level": "SUPER_ADMIN", "is_active": false, "is_staff": true, "is_verified": true, "groups": [], "user_permissions": []}}]```
and I created them using createsuperuser

First name: gerison
Last name: otim
Password: gerison@otim
Superuser created successfully.