Wednesday, February 16, 2022

Re: migrations: "no changes detected"

I have and solve this allot, after adding to ur model myapp run the following:

>> python manage.py makemigrations myapp

>> python manage.py migrate myapp num
where num is the new migrations made u can see this when u open myapp/migrations the new file 000(n) is the num


If this doesn't work try deleting the cache which is the pycache folder in myapp/pycache


If this still doesn't work delete your migrations folder and run again


If this still doesn't work delete all migrations in ur project.


No way it won't work, now your project run 💯


**Reason not makemigrations create new file**

Since u developing the project u can decide to switch between the new model u added and the old one without touching the models file by just >>python manage.py migrate 000(n) the one that contains model u wants.

On Wed, Feb 9, 2022, 14:51 frank maduka <frankmaduka2019@gmail.com> wrote:
Make sure that You have registered you App you created and used it's models. Py to create database tables as well as registering models to the admin.py

On Wed, Feb 9, 2022, 7:14 AM ramadhan ngallen <ngallen4@gmail.com> wrote:
Your apps should be below django default apps
I.e below static files


On users you can

from django.contrib.auth import get_user_model

Then initiate it as

User = get_user_model()

To use it
E.g

my_users = User.objects.all()
On 9 Feb 2022, 07:05 +0300, 'Delvin Alexander' via Django users <django-users@googlegroups.com>, wrote:
there is! but will this have something to do with it?
- "from django.contrib.auth.models import User"
Rite now the error is displaying this:
Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
On Tue, Feb 8, 2022 at 7:32 PM ramadhan ngallen <ngallen4@gmail.com> wrote:
On your app(blog) on the module(folder) migrations,   make sure there is a file named   __init__.py


You can share app structure too
On 9 Feb 2022, 06:26 +0300, 'Delvin Alexander' via Django users <django-users@googlegroups.com>, wrote:
here is a list of my installed apps:

i added the blog.apps but still nothing.


INSTALLED_APPS = [    'blog.apps.BlogConfig',    'django.contrib.admin',    'django.contrib.auth',    'django.contrib.contenttypes',    'django.contrib.sessions',    'django.contrib.messages',    'django.contrib.staticfiles',

On Mon, Feb 7, 2022 at 9:37 PM RANGA BHARATH JINKA <bharathjinka09@gmail.com> wrote:
Hi,

I think you forgot to add the app name in settings file. Please add the app names in installed apps. Then it will find out the models.

All the best


On Tue, 8 Feb 2022, 10:14 am 'Delvin Alexander' via Django users, <django-users@googlegroups.com> wrote:
I am trying to run migrations so that i can create a table, but when I type out, "python manage.py makemigrations"
it returns this: "no changes detected"

would anyone know the reason for this?
 --
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/639770ea-db24-469a-a123-6f4cb2af3036n%40googlegroups.com.
 --
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK5m314skg-HBhQx25mxzg4rHEp8-5jZEX8%2BT9Kr8uDHv-bR5A%40mail.gmail.com.
 --
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADq-sifxMbkc%3DyZdXOw_RUwBq8QiKLUU_TY9RaC9ZfSytSq1%2BA%40mail.gmail.com.
 --
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d8834a19-4ff1-48e2-b101-046f9b9f0814%40Spark.
 --
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADq-sicjbjRUs%3DrCpnf7xX79NZ55mEdEWTd8ixv%3D4%2BURoSuh%2Bg%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/dffe972f-9ab3-451e-99c4-90b3c5b1f406%40Spark.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHrOZRNB0NJ%3DQnu5CMmV0c8NOv0cFS4FTOTSdAE%2BQ-PWFu6Jg%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAD9bWYzwo%2B%2BFck5uQtMOvOGU6F4uvKZ0UgGmJQhodu1D5-8%3DWQ%40mail.gmail.com.

No comments:

Post a Comment