without launching the Webserver (without running python3 manage.py) I only want to use the OR mapping and migration capabilities of Django's database, but I'm stumbling.
There seems to be an order to define django.setup() and model class. Could you tell me how to solve this problem?
[Reference Site]: https://logixsquare.com/techblog/django_models_only/
】What I did <:
# Create/activate a virtual environment
python3-m venv venv
# Installing Django pip3 install django
# Create a Django Project
mkdir hello worldproject
# Create Django app (no need?)
django-admin startproject hello
# ./Application name/test.py contains the following code
When you change the INSTALLED_APPS and define a model class, the following error occurs:
'hello.tests' does not contain a'SampleModel' class.
You can now specify 'hello.apps.HelloConfig' for INSTALLED_APPS by adding:
The SampleModel class was listed on models.py, mademigrations, migrated.
© 2023 OneMinuteCode. All rights reserved.