As far as I know you also need to declare the app_label for each model
class Meta:
app_label = 'your_app_name_here'
On Mon, Aug 7, 2017 at 4:15 PM, Andréas Kühne <andreas.kuhne@hypercode.se> wrote:
Ok,Regarding point 2 there - have you added the models to the __init__.py file? Imported them as in:from .model1 import Model1As far as I have seen, this is needed to make sure the migrations can detect the models.Regards,Andréas2017-08-07 22:09 GMT+02:00 <jjanderson52000@gmail.com>:
Andreas,
The apps are included in the INSTALL_APPS in settings.py
With regard to the models file, I'm not sure what you are referring to. In my application there is a driectory 'models' and in that directory, there is a separate file for each model and inside each of those files there is a class for the model that is indirectly derived from models.Model.
Jim
On Monday, August 7, 2017 at 3:33:18 PM UTC-4, jjander...@gmail.com wrote:
I have been working on a django application for several months, learning as I go. I have run into a problem now and I'm not sure what I should be doing next.
Up until now my admin has worked, but I had a problem and a colleague told me he was pretty sure it was a pycharm bug. He suggested that I remove the database (db.sqlite3). I did that and I also removed all of the existing migration files in my development area.
When I run 'python manage.py makemigrations', I now get the followoing output:/home/jja/.virtualenvs/PivotalThen I run 'python manage.py migrate' and my output is:Base-2017.6.16/bin/python /home/jja/prog/newSiggy/manage .py makemigrations
setting.py: BASE_DIR = /home/jja/prog/newSiggy
FINISHED settings.py
No changes detected
Process finished with exit code 0I'm not sure what to do next. My models are in place, my 2 admin directories are in place. I have created an 'xxx_admin' file for each model and I have registered the admin classes. After running 'makemigrations' and 'migrate', a db.sqlite3 file exists, but only the django tables are to be found, not the tables for my models. I'm going through the documentation to try to figure out if I have missed a step in the process, but so far I have not found anything.
/home/jja/.virtualenvs/PivotalBase-2017.6.16/bin/python /home/jja/prog/newSiggy/manage .py migrate
setting.py: BASE_DIR = /home/jja/prog/newSiggy
FINISHED settings.py
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions, sites
Running migrations:
No migrations to apply.
Process finished with exit code 0
Any suggestions?
Jim A.To view this discussion on the web visit https://groups.google.com/d/ms--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users .gid/django-users/1a4cf7ba-2435 .-4635-add9-04780f44b6a6%40goog legroups.com To view this discussion on the web visit https://groups.google.com/d/--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users .msgid/django-users/ .CAK4qSCfYkCkMY9h%2B-J-- D9qdZ7Fy98me3Po6tX4WYNtKw9psPQ %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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei36NjSUg7quBKYhjXMMOFqS-LNMhRw1fW77vq74-VaWHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment