Search code examples
pythondjangomakemigrations

Django py manage.py makemigrate


What can I make with it? I'm beginner in python and django. I download it and I i wrote py manage.py makemigrate and I've get error. Can u help me?


Solution

  • Your issue is with your DB configuration in the setting.py. If you are using the default SQLite then copy/paste this:

    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
        }
    }
    

    and your project will work just fine. After this, run

    python manage.py makemigrations
    python manage.py migrate #copy all migrations to the database
    python manage.py createsuperuser #to have a admin user to login to adminpanel
    python manage.py runserver #starting the server
    

    Otherwise, take a look at the official documentation how to connect MySQL, PostgreSQL, Oracle databases and required configurations.

    Your error is in here:

    SQLite is not like MySQL or other databases. Actually, it is not a real database. You are using a port, username, password and etc. These are the cause of the error. SQLite is not running in the server or another place. It is just a single file contains data information. Update yours to mine above and it should start work again or change your database to MySQL or others.