Tag: django

  • How To Register Templates In Django

    How To Register Templates In Django

    It is entirely possible to send HTML to a web browser from a Django project right from the view.py Python file. A better way to handle serving HTML in Django is with Templates. In Django, a Template is simply an HTML file stored in a specific location that has the added ability to output dynamic […]

  • Render HTML In Django Without A Template

    Render HTML In Django Without A Template

    Is it possible to render HTML using Django if you are not using a templating system? Yes, it is possible to do this. In order to render HTML without a template in Django, we’ll need to manually build up a string of HTML and send that to the browser as an HttpResponse. It’s not really […]

  • Named URLs And The Reverse Function In Django

    Named URLs And The Reverse Function In Django

    Hard coding URLs, links, and redirects will get you a working application at the time you create it. It will also get you an application that will break as time goes on. On the web, URL structures sometimes change, and you need a way to make your application more flexible for these types of situations. […]

  • How To Use HttpResponseRedirect In Django

    How To Use HttpResponseRedirect In Django

    The HttpResponseRedirect function in Django is used for purposes of URL redirection or URL forwarding. Redirects can be used for many purposes like redirecting users during a maintenance window, providing more than one URL address to a web page on the internet, or for configuring permanent redirects in order to maintain links and bookmarks that […]

  • Django Dynamic URL Patterns

    Django Dynamic URL Patterns

    Being able to capture one or more values from a given URL during an HTTP request is an important feature Django offers developers. We already saw a little bit about how Django routing works, but those examples used hard-coded URL patterns. While this does work, it does not scale. Consider a website that has thousands […]

  • Django Routing Examples

    Django Routing Examples

    A website can have many pages and each page has its own unique Route. What do we man by Route? A Route can be thought of as the full URL that displays in the Web Browser URL field. For example, when you want to visit Apple on the internet, you would type https://www.apple.com/ into the […]

  • What Is A Django App

    What Is A Django App

    Django uses a modular structure of services to provide an overall solution. In other words, a Django project may have just a few, or in some cases a high number of different modules to provide the service that the project offers. In Django terminology, these modules are referred to as Apps. Each module, or App, […]