Qujini icon indicating copy to clipboard operation
Qujini copied to clipboard

OperationalError at /admin/questions/question/add/ no such table: questions_topic

Open arushikhokhar opened this issue 4 years ago • 3 comments

arushikhokhar avatar Aug 02 '20 22:08 arushikhokhar

I see that the installation instructions miss the step python manage.py makemigrations, which creates db migration files. These files are used by python manage.py migrate to do the db migration and setup the db for us, so since the db migration files are missing, perhaps not created, your migrate won't show any errors but still no table shall be created (except auth & other models django has out of the box, that's why you can create user and login).

Try doing 'python manage.py makemigrations' and see if the problem is fixed :)

aswinshenoy avatar Aug 03 '20 05:08 aswinshenoy

Only site administration's path is given in URL patterns, not the user side

arushikhokhar avatar Aug 03 '20 10:08 arushikhokhar

Only site administration's path is given in URL patterns,

Yes. Adding path('admin/', admin.site.urls), in urls.py is actually adding all path & sub-paths (including /admin/questions/question/add/) that are required by `django.contrib.admin' module that is responsible for the admin site.

What is actually happening is admin module itself has a urls.py with all the paths defined for the admin views, and we are adding those to our project when we add path('admin/', admin.site.urls), prefixing with admin/. If you use anything else like path('dash/', admin.site.urls), your admin urls will be with /dash/questions etc.

not the user side

I didnt understand what you meant completely with this, but if you meant these urls only work for admins (with IDs), yes you are right. A user without ID's cannot access/view anything. Currently, the project is hardly implemented except for some ORM definitions, and there is no public user facing views at all. Only through admin will you be able to add the questions, see them etc.

aswinshenoy avatar Aug 03 '20 12:08 aswinshenoy