Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit
12 | amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper
13 | congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl
14 | sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque
15 | congue.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit
12 | amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a,
13 | semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum
14 | diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim.
15 | Pellentesque congue.
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/myapp/myapp/urls.py:
--------------------------------------------------------------------------------
1 | """
2 | URL configuration for myapp project.
3 |
4 | The `urlpatterns` list routes URLs to views. For more information please see:
5 | https://docs.djangoproject.com/en/4.2/topics/http/urls/
6 | Examples:
7 | Function views
8 | 1. Add an import: from my_app import views
9 | 2. Add a URL to urlpatterns: path('', views.home, name='home')
10 | Class-based views
11 | 1. Add an import: from other_app.views import Home
12 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
13 | Including another URLconf
14 | 1. Import the include() function: from django.urls import include, path
15 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
16 | """
17 | from django.contrib import admin
18 | from django.urls import path
19 | from .views import *
20 | urlpatterns = [
21 | path('admin/', admin.site.urls),
22 | path('home/',home),
23 | path('about/',about),
24 | path('service/',service),
25 | path('',home)
26 | ]
27 |
--------------------------------------------------------------------------------
/myapp/myapp/views.py:
--------------------------------------------------------------------------------
1 | from django.http import HttpResponse
2 | from django.shortcuts import render
3 | import datetime
4 | def home(request):
5 | # return HttpResponse("
This is index page
")
6 | j = request.POST['lopa'] # Retrieve the value of 'lopa' from the POST data
7 | print(j) # Print the value of 'lopa'
8 | isActive=True
9 | name="Learning django"
10 | list_of_functions= [
11 | "WAF TO CHECK EVEN OR ODD",
12 | "WAF TO CHECK PRIME NUMBER",
13 | "WAF TO PRINT NUMBER FROM 1 TO 100",
14 | "WAF TO PRINT TRIANGLE"
15 | ]
16 | data={
17 | 'isActive':isActive,
18 | 'name':name,
19 | 'list_of_functions':list_of_functions
20 | }
21 | return render(request,"home.html",data)
22 |
23 | def about(request):
24 | # return HttpResponse("
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit
22 | amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a,
23 | semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum
24 | diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim.
25 | Pellentesque congue.
26 |
27 |
28 |
{{name}}
29 |
{{isActive}}
30 |
{{list_of_functions}}
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Learning Django with myapp 🐍
3 |
4 | Welcome to the Learning Django project with "myapp"! This repository is my journey in learning Django, a powerful Python web framework. 🚀
5 |
6 | 
7 |
8 |
9 | ## Project Structure 📂
10 |
11 | - **myapp**: This directory contains your Django application. Inside this directory, you'll find files related to your Django models, views, and templates.
12 |
13 | - **templates**: This directory stores HTML templates used to render web pages in your Django application.
14 |
15 | - **website**: This directory may contain additional components, apps, or configurations specific to your project's website.
16 |
17 | - **db.sqlite3**: This is the SQLite database file for your Django project. Django uses this database by default for local development. 🗃️
18 |
19 | - **manage.py**: This is the Django management script. You use it to perform various tasks, such as running the development server, creating database tables, and more. 🛠️
20 |
21 | ## Tools Used 🛠️
22 |
23 |
24 |
25 |
26 |
27 | django
28 |
29 |
30 |
31 | Python
32 |
33 |
34 |
35 | PyCharm
36 |
37 |
38 |
39 | Github
40 |
41 |
42 |
43 |
44 |
45 | ## Getting Started 🏁
46 |
47 | To get started with this project, follow these steps:
48 |
49 | 1. Clone this repository to your local machine: ``git clone https://github.com/Shubh2-0/Learning_django.git``
50 |
51 | 2. Navigate to the project directory: ``cd myapp``
52 |
53 | 3. Install the project's dependencies: ``pip install -r requirements.txt``
54 |
55 | 4. Run the Django development server: ``python manage.py runserver``
56 |
57 | 🌐 Access the project in your web browser at http://localhost:8000. 🌐
58 |
59 | # Usage 🚧
60 | Feel free to explore the project's code and structure to learn more about Django development. You can also contribute to this project by opening issues or submitting pull requests. 🤝
61 |
62 | # Contributing 🙌
63 | Contributions are welcome! If you have ideas for improvements or would like to report issues, please create a GitHub issue or submit a pull request following our contribution guidelines. 🎉
64 |
65 | ## 📬 Contact
66 |
67 | If you want to contact me, you can reach me through below handles.
68 |
69 |