This is a simple Django project that demonstrates the usage of Django views, models, and templates. It includes several pages such as the home page, about page, services page, and contact page.
- views.py: Contains the view functions for different pages.
- models.py: Defines the database models.
- base.html: The base template that other templates extend.
- about.html: The template for the about page.
- contact.html: The template for the contact page.
- index.html: The template for the home page.
- services.html: The template for the services page.
To run this project, follow these steps:
-
Clone the repository
git clone https://github.com/Hardvan/Learning-Django
-
Change to the project directory
cd Learning-Django
-
Create a virtual environment
python -m venv .venv
-
Activate the virtual environment
- On Windows, run:
.venv\Scripts\activate.bat
- On Linux or macOS, run:
source .venv/bin/activate
-
Install the dependencies
pip install -r requirements.txt
-
Apply the database migrations
python manage.py migrate
-
Run the development server
python manage.py runserver
-
Open your browser and navigate to http://localhost:8000 to see the application.
The project provides the following pages:
- Home: Displays a carousel of images and some information about the ice creams.
- About: Provides information about the company.
- Services: Shows a list of services offered.
- Contact: Allows users to submit a contact form that is stored in the database.
The website is deployed on PythonAnywhere.