Reputation:
I have a very simple website in Django for which I do not want to create an app separately for the purpose. So the models and admin.py file does not come while creating the django project. When we create an app, those files are automatically created which we have to register in Setting.py.
But my project is very short and I do not want to create an extra app for the purpose. Is there any way to create those database model in the project folder itself?
What I tried :
1. created a models.py file : wrote my database model in it
2. also created an admin.py file and registered the database model
3. In the setting.py file added the project folder itself
But that does not seem to work because when I am trying to create migration its displaying me no changes detected.
Upvotes: 1
Views: 586
Reputation: 126
Django project != Django app. You have to do it the django-way, create the Django project then create the django app that you register with the django project.
Upvotes: 1