This is a simple Django app with two routes:
- A JSON response that returns
{"Message": "Hello World!"}. - An HTML page styled with a beige background that displays "Hello World!" in bold.
- JSON Response: Accessible at
http://127.0.0.1:8000/json/ - HTML Page: Accessible at
http://127.0.0.1:8000/html/ - Root URL (
/) redirects to the HTML page.
- Python 3.x
- Django 5.x
- Clone the repository: git clone cd django_helloworld 2.Create a virtual environment: python3 -m venv myenv source myenv/bin/activate 3.Install dependencies: pip install django 4.Run migrations: python manage.py migrate 5.Start the development server: python manage.py runserver 6.Access the app in your browser:
JSON Response: http://127.0.0.1:8000/json/ HTML Page: http://127.0.0.1:8000/html/ Root URL: http://127.0.0.1:8000/