Django py manage.py makemigrate












0














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?












share|improve this question
























  • What is databse part of your setting.py? Share it!
    – Rarblack
    Nov 20 at 18:07










  • You don't have DB_NAME environment variable, that you probably use while settings your database connection.
    – vishes_shell
    Nov 20 at 18:07










  • Can you say the steps in order since startapp till makemigrations?
    – Rarblack
    Nov 20 at 19:17
















0














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?












share|improve this question
























  • What is databse part of your setting.py? Share it!
    – Rarblack
    Nov 20 at 18:07










  • You don't have DB_NAME environment variable, that you probably use while settings your database connection.
    – vishes_shell
    Nov 20 at 18:07










  • Can you say the steps in order since startapp till makemigrations?
    – Rarblack
    Nov 20 at 19:17














0












0








0







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?












share|improve this question















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?









python django makemigrations






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 at 18:15









Lemayzeur

5,1871833




5,1871833










asked Nov 20 at 18:04









Damian K

32




32












  • What is databse part of your setting.py? Share it!
    – Rarblack
    Nov 20 at 18:07










  • You don't have DB_NAME environment variable, that you probably use while settings your database connection.
    – vishes_shell
    Nov 20 at 18:07










  • Can you say the steps in order since startapp till makemigrations?
    – Rarblack
    Nov 20 at 19:17


















  • What is databse part of your setting.py? Share it!
    – Rarblack
    Nov 20 at 18:07










  • You don't have DB_NAME environment variable, that you probably use while settings your database connection.
    – vishes_shell
    Nov 20 at 18:07










  • Can you say the steps in order since startapp till makemigrations?
    – Rarblack
    Nov 20 at 19:17
















What is databse part of your setting.py? Share it!
– Rarblack
Nov 20 at 18:07




What is databse part of your setting.py? Share it!
– Rarblack
Nov 20 at 18:07












You don't have DB_NAME environment variable, that you probably use while settings your database connection.
– vishes_shell
Nov 20 at 18:07




You don't have DB_NAME environment variable, that you probably use while settings your database connection.
– vishes_shell
Nov 20 at 18:07












Can you say the steps in order since startapp till makemigrations?
– Rarblack
Nov 20 at 19:17




Can you say the steps in order since startapp till makemigrations?
– Rarblack
Nov 20 at 19:17












3 Answers
3






active

oldest

votes


















0














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.






share|improve this answer























  • what if i get next error? ;D "raise KeyError(key) from None KeyError: 'DB_USER' "
    – Damian K
    Nov 20 at 19:09












  • can you share your settings.py? Because when you create a new project this errors should not be raised if you havent touch the database configurations
    – Rarblack
    Nov 20 at 19:12










  • I would suggest you to delete all migrations and database and re run makemigrations and migrate
    – Rarblack
    Nov 20 at 19:14










  • imgur.com/mriZJ1v imgur.com/umgDTWj imgur.com/AluPbx4 imgur.com/ggVYSb8
    – Damian K
    Nov 20 at 19:23





















0














You need to supply all environment variables that are listed in your settings file. Such as DB_NAME that presented in your screenshot. Search for os.environ[<VARIABLE_NAME>], every VARIABLE_NAME should be defined.






share|improve this answer





























    0














    If you are a beginner it is better to stay with the documentation and do like https://docs.djangoproject.com/en/2.1/intro/tutorial01/



    If you could share the DB part of the settings.py it would help.



    Generally python manage.py startapp appname should create the necessary files for you.
    After which a python manage.py makemigrations and python manage.py migrate should work properly. And this should not come.






    share|improve this answer





















    • This is not a answer to the question, just a suggestion and doesn't mention any new approach.
      – Rarblack
      Nov 20 at 19:16






    • 1




      Well, the OP said they typed python manage.py makemigrate which isn't the correct command; this answer provides the correctly spelled command. Beyond that, it is solid advice for a beginner.
      – FlipperPA
      Nov 20 at 20:06











    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53398941%2fdjango-py-manage-py-makemigrate%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    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.






    share|improve this answer























    • what if i get next error? ;D "raise KeyError(key) from None KeyError: 'DB_USER' "
      – Damian K
      Nov 20 at 19:09












    • can you share your settings.py? Because when you create a new project this errors should not be raised if you havent touch the database configurations
      – Rarblack
      Nov 20 at 19:12










    • I would suggest you to delete all migrations and database and re run makemigrations and migrate
      – Rarblack
      Nov 20 at 19:14










    • imgur.com/mriZJ1v imgur.com/umgDTWj imgur.com/AluPbx4 imgur.com/ggVYSb8
      – Damian K
      Nov 20 at 19:23


















    0














    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.






    share|improve this answer























    • what if i get next error? ;D "raise KeyError(key) from None KeyError: 'DB_USER' "
      – Damian K
      Nov 20 at 19:09












    • can you share your settings.py? Because when you create a new project this errors should not be raised if you havent touch the database configurations
      – Rarblack
      Nov 20 at 19:12










    • I would suggest you to delete all migrations and database and re run makemigrations and migrate
      – Rarblack
      Nov 20 at 19:14










    • imgur.com/mriZJ1v imgur.com/umgDTWj imgur.com/AluPbx4 imgur.com/ggVYSb8
      – Damian K
      Nov 20 at 19:23
















    0












    0








    0






    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.






    share|improve this answer














    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.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Nov 20 at 19:37

























    answered Nov 20 at 18:17









    Rarblack

    2,7163925




    2,7163925












    • what if i get next error? ;D "raise KeyError(key) from None KeyError: 'DB_USER' "
      – Damian K
      Nov 20 at 19:09












    • can you share your settings.py? Because when you create a new project this errors should not be raised if you havent touch the database configurations
      – Rarblack
      Nov 20 at 19:12










    • I would suggest you to delete all migrations and database and re run makemigrations and migrate
      – Rarblack
      Nov 20 at 19:14










    • imgur.com/mriZJ1v imgur.com/umgDTWj imgur.com/AluPbx4 imgur.com/ggVYSb8
      – Damian K
      Nov 20 at 19:23




















    • what if i get next error? ;D "raise KeyError(key) from None KeyError: 'DB_USER' "
      – Damian K
      Nov 20 at 19:09












    • can you share your settings.py? Because when you create a new project this errors should not be raised if you havent touch the database configurations
      – Rarblack
      Nov 20 at 19:12










    • I would suggest you to delete all migrations and database and re run makemigrations and migrate
      – Rarblack
      Nov 20 at 19:14










    • imgur.com/mriZJ1v imgur.com/umgDTWj imgur.com/AluPbx4 imgur.com/ggVYSb8
      – Damian K
      Nov 20 at 19:23


















    what if i get next error? ;D "raise KeyError(key) from None KeyError: 'DB_USER' "
    – Damian K
    Nov 20 at 19:09






    what if i get next error? ;D "raise KeyError(key) from None KeyError: 'DB_USER' "
    – Damian K
    Nov 20 at 19:09














    can you share your settings.py? Because when you create a new project this errors should not be raised if you havent touch the database configurations
    – Rarblack
    Nov 20 at 19:12




    can you share your settings.py? Because when you create a new project this errors should not be raised if you havent touch the database configurations
    – Rarblack
    Nov 20 at 19:12












    I would suggest you to delete all migrations and database and re run makemigrations and migrate
    – Rarblack
    Nov 20 at 19:14




    I would suggest you to delete all migrations and database and re run makemigrations and migrate
    – Rarblack
    Nov 20 at 19:14












    imgur.com/mriZJ1v imgur.com/umgDTWj imgur.com/AluPbx4 imgur.com/ggVYSb8
    – Damian K
    Nov 20 at 19:23






    imgur.com/mriZJ1v imgur.com/umgDTWj imgur.com/AluPbx4 imgur.com/ggVYSb8
    – Damian K
    Nov 20 at 19:23















    0














    You need to supply all environment variables that are listed in your settings file. Such as DB_NAME that presented in your screenshot. Search for os.environ[<VARIABLE_NAME>], every VARIABLE_NAME should be defined.






    share|improve this answer


























      0














      You need to supply all environment variables that are listed in your settings file. Such as DB_NAME that presented in your screenshot. Search for os.environ[<VARIABLE_NAME>], every VARIABLE_NAME should be defined.






      share|improve this answer
























        0












        0








        0






        You need to supply all environment variables that are listed in your settings file. Such as DB_NAME that presented in your screenshot. Search for os.environ[<VARIABLE_NAME>], every VARIABLE_NAME should be defined.






        share|improve this answer












        You need to supply all environment variables that are listed in your settings file. Such as DB_NAME that presented in your screenshot. Search for os.environ[<VARIABLE_NAME>], every VARIABLE_NAME should be defined.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 20 at 18:10









        vishes_shell

        10.1k33845




        10.1k33845























            0














            If you are a beginner it is better to stay with the documentation and do like https://docs.djangoproject.com/en/2.1/intro/tutorial01/



            If you could share the DB part of the settings.py it would help.



            Generally python manage.py startapp appname should create the necessary files for you.
            After which a python manage.py makemigrations and python manage.py migrate should work properly. And this should not come.






            share|improve this answer





















            • This is not a answer to the question, just a suggestion and doesn't mention any new approach.
              – Rarblack
              Nov 20 at 19:16






            • 1




              Well, the OP said they typed python manage.py makemigrate which isn't the correct command; this answer provides the correctly spelled command. Beyond that, it is solid advice for a beginner.
              – FlipperPA
              Nov 20 at 20:06
















            0














            If you are a beginner it is better to stay with the documentation and do like https://docs.djangoproject.com/en/2.1/intro/tutorial01/



            If you could share the DB part of the settings.py it would help.



            Generally python manage.py startapp appname should create the necessary files for you.
            After which a python manage.py makemigrations and python manage.py migrate should work properly. And this should not come.






            share|improve this answer





















            • This is not a answer to the question, just a suggestion and doesn't mention any new approach.
              – Rarblack
              Nov 20 at 19:16






            • 1




              Well, the OP said they typed python manage.py makemigrate which isn't the correct command; this answer provides the correctly spelled command. Beyond that, it is solid advice for a beginner.
              – FlipperPA
              Nov 20 at 20:06














            0












            0








            0






            If you are a beginner it is better to stay with the documentation and do like https://docs.djangoproject.com/en/2.1/intro/tutorial01/



            If you could share the DB part of the settings.py it would help.



            Generally python manage.py startapp appname should create the necessary files for you.
            After which a python manage.py makemigrations and python manage.py migrate should work properly. And this should not come.






            share|improve this answer












            If you are a beginner it is better to stay with the documentation and do like https://docs.djangoproject.com/en/2.1/intro/tutorial01/



            If you could share the DB part of the settings.py it would help.



            Generally python manage.py startapp appname should create the necessary files for you.
            After which a python manage.py makemigrations and python manage.py migrate should work properly. And this should not come.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 20 at 19:15









            Gautham Santhosh

            547




            547












            • This is not a answer to the question, just a suggestion and doesn't mention any new approach.
              – Rarblack
              Nov 20 at 19:16






            • 1




              Well, the OP said they typed python manage.py makemigrate which isn't the correct command; this answer provides the correctly spelled command. Beyond that, it is solid advice for a beginner.
              – FlipperPA
              Nov 20 at 20:06


















            • This is not a answer to the question, just a suggestion and doesn't mention any new approach.
              – Rarblack
              Nov 20 at 19:16






            • 1




              Well, the OP said they typed python manage.py makemigrate which isn't the correct command; this answer provides the correctly spelled command. Beyond that, it is solid advice for a beginner.
              – FlipperPA
              Nov 20 at 20:06
















            This is not a answer to the question, just a suggestion and doesn't mention any new approach.
            – Rarblack
            Nov 20 at 19:16




            This is not a answer to the question, just a suggestion and doesn't mention any new approach.
            – Rarblack
            Nov 20 at 19:16




            1




            1




            Well, the OP said they typed python manage.py makemigrate which isn't the correct command; this answer provides the correctly spelled command. Beyond that, it is solid advice for a beginner.
            – FlipperPA
            Nov 20 at 20:06




            Well, the OP said they typed python manage.py makemigrate which isn't the correct command; this answer provides the correctly spelled command. Beyond that, it is solid advice for a beginner.
            – FlipperPA
            Nov 20 at 20:06


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53398941%2fdjango-py-manage-py-makemigrate%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Ottavio Pratesi

            Tricia Helfer

            15 giugno