On Apr 17, 2017 12:57 AM, alkhair...@mymail.vcu.edu wrote:
>
> I am not exactly sure how to do this, so any help would be great.
The shell is just a Python REPL, you can run any Python code in it. Consider:
>>> from yourapp import models
>>> models.YourModel.objects.first()
<YourModel: YourModel object>
>Further, am I missing any steps as far connecting the mysql database to my django project?
If you can do the above successfully I don't think so.
>Lastly, a rather huge disconnect I am having with all of this is simply understanding how exactly the models.py in my apps are actually connected to my database?
Short answer: they're not really.
Long answer: When you try to access a field of a model in Django, Django will query the table related to that model, get the row with the ID of your model, then give you the correct column.

--
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+unsubscr...@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/58f44f01.57e41c0a.fbbee.ad3bSMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to