models.py contains classes needed for rendering things such as forms automatically when a user loads the webpage. The form is pieced together using django with each page reload instead of already existing as an .html webpage. Import then use Django’s…
Category: Django
Get Around the Django Error “ cannot be specified for model form as it is a non-editable field”
CreateView is a class in Django for creating views specifically for creating the form and saves entered data into the database. Make sure you have the following in views.py: (Note: <form class name> is generally <model name> + “Form”) class…
Get Around that Pesky Django Migration Error: “Column Does Not Exist” and Add New Columns in Your SQLite3 Database
1. Remove your updates from models.py, views.py and admin.py 2. ./manage.py makemigrations appname 3. ./manage.py migrate –fake appname 4. Re-add your updates to models.py, views.py and admin.py 5. ./manage.py makemigrations appname 6. ./manage.py migrate appname 7. python manage.py runserver