Posts

Showing posts from January 27, 2020

making your html templates be rendered in your django project.

Image
#2 making your html templates be rendered in your django project. After creating your django project you will need to insert html templates where your data will be displayed to the user. Before you proceed make sure you have the following files in your main project’s folder: First we must create an app that will handle all our requests and will render our html pages. We will write the *startapp* command to create our app. This will add another folder   named tutorial to our project folder. When you open the folder you will see the following files: We will then edit the settings.py file. Open the file in your preferred text editor and we will edit it as followed: Add the correct path to your templates folder. We will then edit the urls.py of the main folder which we created first in order to connect with our new app. Add the lines below to your file: As you can see we do not have a urls.py fi...

setting up django and running django server.

Image
#1 Setting up django and running the server. Django is a python project that enables you to write and make web apps in python. Python is probably the easiest programming language for writing web application. If you haven’t still learned python you can first search for a tutorial for python before you proceed to learn django    because django is written in python. First we will start by installing django. Make sure you have installed the latest python from python.org and pip. pip install django Run the pip install command. If you haven’t installed pip you can go to python’s official website and read on how to install pip in your machine. After the install is finished you can confirm that by using the version command. getting django version The version will be displayed if it is properly installed. Next we will create our django project. We will use the start project command to create our django project. In the *projectNa...