Search results for: django
83 results found.
Displaying Forms in Django
So far we have been using Django Shell to demonstrate how the forms work. In this lesson, we will learn how to display forms in our templates. Note: Before following along, if you have a running ins…
Read MoreDjango Form Basics
The syntax of creating forms in Django is almost similar to that of creating models, the only differences are: Django form inherits from forms.Form instead of models.Model. Each form fields inherit…
Read MoreRedirecting URLs in Django
Redirecting using HttpResponseRedirect # HttpResponseRedirect is a subclass of HttpResponse. As its name says, instead of returning a normal response, it redirects the user to a different URL using …
Read MoreShowing 404 errors In Django
Visit a category page which doesn't exist for example, http://127.0.0.1:8000/category/cat_not_exists/. You should see DoesNotExist exception like this: As there is no such category in the data…
Read MoreCreating URLs in Django
Up until now, we have been hardcoding URLs in our templates. At a later date, If we want to update the URL structure we would have to manually visit each and every template. This problem can be solve…
Read MoreDjango Admin App
These days Admin sites are integral part of any website. Administrators, author and staff members uses admin site to manage the content of the main site. Django provides an admin app right out of the…
Read MoreBuilding Blog The First Steps
We now know how to create Model, Templates, and Views in Django, lets put this knowledge to use and create some pages for our site - The Great Django Blog. In this lesson, we will create the followin…
Read MoreAccessing Related Data Using Django ORM
In the previous lesson, we have covered all the basic stuff needed to interact with the database using Django ORM. We have created, modified and deleted many objects. The type of the objects we handl…
Read MoreDjango ORM Basics
Having learned the art of creating models, lets now shift our attention on how to access the data stored in the database. Django ORM provides an elegant and powerful way to interact with the database…
Read MoreMigrations in Django
Migration is a way to create or alter tables in the database. In Django, the common workflow of working with models is as follows: Create or change models in models.py file. Create migration file. …
Read More