Category: D jango
-
Django Views
Views Django views are Python functions that takes http requests and returns http response, like HTML documents. A web page that uses Django is full of views with different tasks and missions. Views are usually put in a file called views.py located on your app’s folder. There is a views.py in your members folder that looks like this: my_tennis_club/members/views.py: Find it…
-
Django Create App
What is an App? An app is a web application that has a specific meaning in your project, like a home page, a contact form, or a members database. In this tutorial we will create an app that allows us to list and register members in a database. But first, let’s just create a simple…
-
Django Create Project
My First Project Once you have come up with a suitable name for your Django project, like mine: my_tennis_club, navigate to where in the file system you want to store the code (in the virtual environment), I will navigate to the myworld folder, and run this command in the command prompt: Django creates a my_tennis_club folder on my computer, with…
-
Install Django
Install Django Now, that we have created a virtual environment, we are ready to install Django. Note: Remember to install Django while you are in the virtual environment! Django is installed using pip, with this command: Windows: (myworld) C:\Users\Your Name>py -m pip install Django Unix/MacOS: (myworld) … $ python -m pip install Django Which will give a…
-
Django – Create Virtual Environment
Virtual Environment It is suggested to have a dedicated virtual environment for each Django project, and one way to manage a virtual environment is venv, which is included in Python. The name of the virtual environment is your choice, in this tutorial we will call it myworld. Type the following in the command prompt, remember to navigate…
-
Django Getting Started
To install Django, you must have Python installed, and a package manager like PIP. Django Requires Python To check if your system has Python installed, run this command in the command prompt: If Python is installed, you will get a result with the version number, like this Python 3.9.2 If you find that you do not have Python…
-
Django Introduction
What is Django? Django is a Python framework that makes it easier to create web sites using Python. Django takes care of the difficult stuff so that you can concentrate on building your web applications. Django emphasizes reusability of components, also referred to as DRY (Don’t Repeat Yourself), and comes with ready-to-use features like login…