├── Hello ├── .vscode │ └── settings.json ├── Hello │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ ├── __init__.cpython-38.pyc │ │ ├── settings.cpython-37.pyc │ │ ├── settings.cpython-38.pyc │ │ ├── urls.cpython-37.pyc │ │ ├── urls.cpython-38.pyc │ │ ├── wsgi.cpython-37.pyc │ │ └── wsgi.cpython-38.pyc │ ├── asgi.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── db.sqlite3 ├── home │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ ├── __init__.cpython-38.pyc │ │ ├── admin.cpython-37.pyc │ │ ├── admin.cpython-38.pyc │ │ ├── apps.cpython-37.pyc │ │ ├── apps.cpython-38.pyc │ │ ├── models.cpython-37.pyc │ │ ├── models.cpython-38.pyc │ │ ├── urls.cpython-37.pyc │ │ ├── urls.cpython-38.pyc │ │ ├── views.cpython-37.pyc │ │ └── views.cpython-38.pyc │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── 0001_initial.cpython-37.pyc │ │ │ ├── 0001_initial.cpython-38.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ └── __init__.cpython-38.pyc │ ├── models.py │ ├── tests.py │ ├── urls.py │ └── views.py ├── manage.py ├── static │ ├── 1.jfif │ ├── 2.jfif │ ├── 3.jfif │ ├── img │ │ ├── 1580005.jpg │ │ ├── Thank_You_for_Visiting.gif │ │ └── co.gif │ └── test.txt └── templates │ ├── about.html │ ├── base.html │ ├── contact.html │ ├── index.html │ ├── login.html │ └── services.html ├── README.md ├── _config.yml └── userproject ├── .vscode └── settings.json ├── db.sqlite3 ├── home ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-37.pyc │ ├── admin.cpython-37.pyc │ ├── apps.cpython-37.pyc │ ├── models.cpython-37.pyc │ ├── urls.cpython-37.pyc │ └── views.cpython-37.pyc ├── admin.py ├── apps.py ├── migrations │ ├── __init__.py │ └── __pycache__ │ │ └── __init__.cpython-37.pyc ├── models.py ├── tests.py ├── urls.py └── views.py ├── manage.py ├── templates ├── index.html └── login.html └── userproject ├── __init__.py ├── __pycache__ ├── __init__.cpython-37.pyc ├── settings.cpython-37.pyc ├── urls.cpython-37.pyc └── wsgi.cpython-37.pyc ├── asgi.py ├── settings.py ├── urls.py └── wsgi.py /Hello/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.pythonPath": "/usr/bin/python3.9" 3 | } -------------------------------------------------------------------------------- /Hello/Hello/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/Hello/__init__.py -------------------------------------------------------------------------------- /Hello/Hello/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/Hello/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Hello/Hello/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/Hello/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /Hello/Hello/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/Hello/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /Hello/Hello/__pycache__/settings.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/Hello/__pycache__/settings.cpython-38.pyc -------------------------------------------------------------------------------- /Hello/Hello/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/Hello/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Hello/Hello/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/Hello/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /Hello/Hello/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/Hello/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /Hello/Hello/__pycache__/wsgi.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/Hello/__pycache__/wsgi.cpython-38.pyc -------------------------------------------------------------------------------- /Hello/Hello/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for Hello project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Hello.settings') 15 | 16 | application = get_asgi_application() 17 | 18 | -------------------------------------------------------------------------------- /Hello/Hello/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for Hello project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.0.4. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.0/ref/settings/ 11 | """ 12 | 13 | import os 14 | from django.contrib.messages import constants as messages 15 | 16 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 17 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 18 | 19 | 20 | # Quick-start development settings - unsuitable for production 21 | # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ 22 | 23 | # SECURITY WARNING: keep the secret key used in production secret! 24 | SECRET_KEY = 'e+e#vq+j1^$m+ipl$m6n$&fk!k!ewtkoqe$4--!#tfvx&j5w#&' 25 | 26 | # SECURITY WARNING: don't run with debug turned on in production! 27 | DEBUG = True 28 | 29 | ALLOWED_HOSTS = [] 30 | 31 | 32 | # Application definition 33 | 34 | INSTALLED_APPS = [ 35 | 'home.apps.HomeConfig', 36 | 'django.contrib.admin', 37 | 'django.contrib.auth', 38 | 'django.contrib.contenttypes', 39 | 'django.contrib.sessions', 40 | 'django.contrib.messages', 41 | 'django.contrib.staticfiles', 42 | ] 43 | 44 | MIDDLEWARE = [ 45 | 'django.middleware.security.SecurityMiddleware', 46 | 'django.contrib.sessions.middleware.SessionMiddleware', 47 | 'django.middleware.common.CommonMiddleware', 48 | 'django.middleware.csrf.CsrfViewMiddleware', 49 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 50 | 'django.contrib.messages.middleware.MessageMiddleware', 51 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 52 | ] 53 | 54 | ROOT_URLCONF = 'Hello.urls' 55 | 56 | TEMPLATES = [ 57 | { 58 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 59 | 'DIRS': [os.path.join(BASE_DIR, "templates") ], 60 | 'APP_DIRS': True, 61 | 'OPTIONS': { 62 | 'context_processors': [ 63 | 'django.template.context_processors.debug', 64 | 'django.template.context_processors.request', 65 | 'django.contrib.auth.context_processors.auth', 66 | 'django.contrib.messages.context_processors.messages', 67 | ], 68 | }, 69 | }, 70 | ] 71 | 72 | WSGI_APPLICATION = 'Hello.wsgi.application' 73 | 74 | 75 | # Database 76 | # https://docs.djangoproject.com/en/3.0/ref/settings/#databases 77 | 78 | DATABASES = { 79 | 'default': { 80 | 'ENGINE': 'django.db.backends.sqlite3', 81 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 82 | } 83 | } 84 | 85 | 86 | # Password validation 87 | # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators 88 | 89 | AUTH_PASSWORD_VALIDATORS = [ 90 | { 91 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 92 | }, 93 | { 94 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 95 | }, 96 | { 97 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 98 | }, 99 | { 100 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 101 | }, 102 | ] 103 | 104 | 105 | # Internationalization 106 | # https://docs.djangoproject.com/en/3.0/topics/i18n/ 107 | 108 | LANGUAGE_CODE = 'en-us' 109 | 110 | TIME_ZONE = 'UTC' 111 | 112 | USE_I18N = True 113 | 114 | USE_L10N = True 115 | 116 | USE_TZ = True 117 | 118 | 119 | # Static files (CSS, JavaScript, Images) 120 | # https://docs.djangoproject.com/en/3.0/howto/static-files/ 121 | 122 | STATIC_URL = '/static/' 123 | 124 | 125 | # Added manually 126 | STATICFILES_DIRS = [ 127 | os.path.join(BASE_DIR, "static") 128 | ] -------------------------------------------------------------------------------- /Hello/Hello/urls.py: -------------------------------------------------------------------------------- 1 | """Hello URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.0/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path, include 18 | 19 | admin.site.site_header = "Harry Ice Cream Admin" 20 | admin.site.site_title = "Harry Ice Cream Admin Portal" 21 | admin.site.index_title = "Welcome to Harry Ice Creams" 22 | 23 | urlpatterns = [ 24 | path('admin/', admin.site.urls), 25 | path('', include('home.urls')) 26 | 27 | ] 28 | -------------------------------------------------------------------------------- /Hello/Hello/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for Hello project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Hello.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Hello/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/db.sqlite3 -------------------------------------------------------------------------------- /Hello/home/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/__init__.py -------------------------------------------------------------------------------- /Hello/home/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Hello/home/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /Hello/home/__pycache__/admin.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/__pycache__/admin.cpython-37.pyc -------------------------------------------------------------------------------- /Hello/home/__pycache__/admin.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/__pycache__/admin.cpython-38.pyc -------------------------------------------------------------------------------- /Hello/home/__pycache__/apps.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/__pycache__/apps.cpython-37.pyc -------------------------------------------------------------------------------- /Hello/home/__pycache__/apps.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/__pycache__/apps.cpython-38.pyc -------------------------------------------------------------------------------- /Hello/home/__pycache__/models.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/__pycache__/models.cpython-37.pyc -------------------------------------------------------------------------------- /Hello/home/__pycache__/models.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/__pycache__/models.cpython-38.pyc -------------------------------------------------------------------------------- /Hello/home/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Hello/home/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /Hello/home/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /Hello/home/__pycache__/views.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/__pycache__/views.cpython-38.pyc -------------------------------------------------------------------------------- /Hello/home/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from home.models import Contact 3 | 4 | # Register your models here. 5 | admin.site.register(Contact) -------------------------------------------------------------------------------- /Hello/home/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class HomeConfig(AppConfig): 5 | name = 'home' 6 | -------------------------------------------------------------------------------- /Hello/home/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.4 on 2020-03-31 15:08 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='Contact', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('name', models.CharField(max_length=122)), 19 | ('email', models.CharField(max_length=122)), 20 | ('phone', models.CharField(max_length=12)), 21 | ('desc', models.TextField()), 22 | ('date', models.DateField()), 23 | ], 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /Hello/home/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/migrations/__init__.py -------------------------------------------------------------------------------- /Hello/home/migrations/__pycache__/0001_initial.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/migrations/__pycache__/0001_initial.cpython-37.pyc -------------------------------------------------------------------------------- /Hello/home/migrations/__pycache__/0001_initial.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/migrations/__pycache__/0001_initial.cpython-38.pyc -------------------------------------------------------------------------------- /Hello/home/migrations/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/migrations/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Hello/home/migrations/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/home/migrations/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /Hello/home/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # makemigrations - create changes and store in a file 4 | # migrate - apply the pending changes created by makemigrations 5 | 6 | # Create your models here. 7 | class Contact(models.Model): 8 | name = models.CharField(max_length=122) 9 | email = models.CharField(max_length=122) 10 | phone = models.CharField(max_length=12) 11 | desc = models.TextField() 12 | date = models.DateField() 13 | 14 | def __str__(self): 15 | return self.name 16 | -------------------------------------------------------------------------------- /Hello/home/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Hello/home/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.urls import path 3 | from home import views 4 | 5 | urlpatterns = [ 6 | path("", views.index, name='home'), 7 | path("about", views.about, name='about'), 8 | path("services", views.services, name='services'), 9 | path("contact", views.contact, name='contact'), 10 | path("login", views.login, name='login'), 11 | 12 | 13 | ] 14 | 15 | -------------------------------------------------------------------------------- /Hello/home/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render, HttpResponse 2 | from datetime import datetime 3 | from home.models import Contact 4 | from django.contrib import messages 5 | 6 | # Create your views here. 7 | def index(request): 8 | context = { 9 | "variable1":"Harry is great", 10 | "variable2":"Rohan is great" 11 | } 12 | return render(request, 'index.html', context) 13 | # return HttpResponse("this is homepage") 14 | 15 | def about(request): 16 | return render(request, 'about.html') 17 | 18 | def services(request): 19 | return render(request, 'services.html') 20 | 21 | def login(request): 22 | return render(request, 'login.html') 23 | 24 | def contact(request): 25 | if request.method == "POST": 26 | name = request.POST.get('name') 27 | email = request.POST.get('email') 28 | phone = request.POST.get('phone') 29 | desc = request.POST.get('desc') 30 | contact = Contact(name=name, email=email, phone=phone, desc=desc, date = datetime.today()) 31 | contact.save() 32 | messages.success(request, 'Your message has been sent!') 33 | return render(request, 'contact.html') 34 | 35 | -------------------------------------------------------------------------------- /Hello/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Hello.settings') 9 | try: 10 | from django.core.management import execute_from_command_line 11 | except ImportError as exc: 12 | raise ImportError( 13 | "Couldn't import Django. Are you sure it's installed and " 14 | "available on your PYTHONPATH environment variable? Did you " 15 | "forget to activate a virtual environment?" 16 | ) from exc 17 | execute_from_command_line(sys.argv) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /Hello/static/1.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/static/1.jfif -------------------------------------------------------------------------------- /Hello/static/2.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/static/2.jfif -------------------------------------------------------------------------------- /Hello/static/3.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/static/3.jfif -------------------------------------------------------------------------------- /Hello/static/img/1580005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/static/img/1580005.jpg -------------------------------------------------------------------------------- /Hello/static/img/Thank_You_for_Visiting.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/static/img/Thank_You_for_Visiting.gif -------------------------------------------------------------------------------- /Hello/static/img/co.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/Hello/static/img/co.gif -------------------------------------------------------------------------------- /Hello/static/test.txt: -------------------------------------------------------------------------------- 1 | this is a test and this is a static file -------------------------------------------------------------------------------- /Hello/templates/about.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %}About{% endblock title %} 4 | 5 | {% block body %} 6 | 7 | {% endblock body %} 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Hello/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | {% block title %}{% endblock title %} | Samir Paul's Enterprise 12 | 13 | 14 | 54 | 55 | {% if messages %} 56 | {% for message in messages %} 57 | 63 | {% endfor %} 64 | {% endif %} 65 | 66 | {% block body %} {% endblock body %} 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Hello/templates/contact.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %}Contact{% endblock title %} 4 | 5 | {% block body %} 6 |
7 | ... 8 |
9 |
10 |

Contact Us

11 |
12 | {% csrf_token %} 13 |
14 | 15 | 16 |
17 | 18 |
19 | 20 | 21 |
22 | 23 |
24 | 25 | 26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 |
34 | 35 |
36 | 37 | {% endblock body %} 38 | 39 | 40 | -------------------------------------------------------------------------------- /Hello/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %}Home{% endblock title %} 4 | 5 | {% block body %} 6 |
7 | 46 |
47 | 48 | 49 |
50 |

Select from our range of Samir Paul's Product:

51 |
52 |
53 |
54 | ... 55 | 56 |
57 |

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

58 |
59 |
60 | 61 | 62 |
63 | 9 mins 64 |
65 |
66 |
67 |
68 |
69 |
70 | ... 71 |
72 |

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

73 |
74 |
75 | 76 | 77 |
78 | 9 mins 79 |
80 |
81 |
82 |
83 |
84 |
85 | ... 86 |
87 |

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

88 |
89 |
90 | 91 | 92 |
93 | 9 mins 94 |
95 |
96 |
97 |
98 | 99 |
100 |
101 | ... 102 |
103 |

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

104 |
105 |
106 | 107 | 108 |
109 | 9 mins 110 |
111 |
112 |
113 |
114 | 115 |
116 |
117 | {% endblock body %} 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /Hello/templates/login.html: -------------------------------------------------------------------------------- 1 | {% load socialaccount %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Hello, world! 14 | 15 | 16 | 17 |
18 |
19 |
20 | 35 |
36 |
37 |
38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Hello/templates/services.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %}Services{% endblock title %} 4 | 5 | {% block body %} 6 | 7 | {% endblock body %} 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Welcome to GitHub Pages 2 | 3 | You can use the [editor on GitHub](https://github.com/SamirPaul1/SamirPaul1.django_project/edit/main/README.md) to maintain and preview the content for your website in Markdown files. 4 | 5 | Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files. 6 | 7 | ### Markdown 8 | 9 | Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for 10 | 11 | ```markdown 12 | Syntax highlighted code block 13 | 14 | # Header 1 15 | ## Header 2 16 | ### Header 3 17 | 18 | - Bulleted 19 | - List 20 | 21 | 1. Numbered 22 | 2. List 23 | 24 | **Bold** and _Italic_ and `Code` text 25 | 26 | [Link](url) and ![Image](src) 27 | ``` 28 | 29 | For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/). 30 | 31 | ### Jekyll Themes 32 | 33 | Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/SamirPaul1/SamirPaul1.django_project/settings/pages). The name of this theme is saved in the Jekyll `_config.yml` configuration file. 34 | 35 | ### Support or Contact 36 | 37 | Having trouble with Pages? Check out our [documentation](https://docs.github.com/categories/github-pages-basics/) or [contact support](https://support.github.com/contact) and we’ll help you sort it out. 38 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-time-machine -------------------------------------------------------------------------------- /userproject/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.pythonPath": "C:\\Python3\\python.exe" 3 | } -------------------------------------------------------------------------------- /userproject/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/db.sqlite3 -------------------------------------------------------------------------------- /userproject/home/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/home/__init__.py -------------------------------------------------------------------------------- /userproject/home/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/home/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /userproject/home/__pycache__/admin.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/home/__pycache__/admin.cpython-37.pyc -------------------------------------------------------------------------------- /userproject/home/__pycache__/apps.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/home/__pycache__/apps.cpython-37.pyc -------------------------------------------------------------------------------- /userproject/home/__pycache__/models.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/home/__pycache__/models.cpython-37.pyc -------------------------------------------------------------------------------- /userproject/home/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/home/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /userproject/home/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/home/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /userproject/home/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /userproject/home/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class HomeConfig(AppConfig): 5 | name = 'home' 6 | -------------------------------------------------------------------------------- /userproject/home/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/home/migrations/__init__.py -------------------------------------------------------------------------------- /userproject/home/migrations/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/home/migrations/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /userproject/home/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /userproject/home/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /userproject/home/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.urls import path, include 3 | from home import views 4 | 5 | urlpatterns = [ 6 | path('',views.index, name="home"), 7 | path('login',views.loginUser, name="login"), 8 | path('logout',views.logoutUser, name="logout"), 9 | ] 10 | -------------------------------------------------------------------------------- /userproject/home/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render, redirect 2 | from django.contrib.auth.models import User 3 | from django.contrib.auth import logout, authenticate, login 4 | 5 | # password for test user is Harry$$$***000 6 | # Create your views here. 7 | def index(request): 8 | print(request.user) 9 | if request.user.is_anonymous: 10 | return redirect("/login") 11 | return render(request, 'index.html') 12 | 13 | def loginUser(request): 14 | if request.method=="POST": 15 | username = request.POST.get('username') 16 | password = request.POST.get('password') 17 | print(username, password) 18 | 19 | # check if user has entered correct credentials 20 | user = authenticate(username=username, password=password) 21 | 22 | if user is not None: 23 | # A backend authenticated the credentials 24 | login(request, user) 25 | return redirect("/") 26 | 27 | else: 28 | # No backend authenticated the credentials 29 | return render(request, 'login.html') 30 | 31 | return render(request, 'login.html') 32 | 33 | def logoutUser(request): 34 | logout(request) 35 | return redirect("/login") -------------------------------------------------------------------------------- /userproject/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'userproject.settings') 9 | try: 10 | from django.core.management import execute_from_command_line 11 | except ImportError as exc: 12 | raise ImportError( 13 | "Couldn't import Django. Are you sure it's installed and " 14 | "available on your PYTHONPATH environment variable? Did you " 15 | "forget to activate a virtual environment?" 16 | ) from exc 17 | execute_from_command_line(sys.argv) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /userproject/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Logged in user 7 | 8 | 9 | welcome {{request.user}} 10 |

11 | This is the best website on this planet and you are very lucky to access it

12 | Logout 13 | 14 | -------------------------------------------------------------------------------- /userproject/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | 14 | 81 | 82 | 83 | 84 | 85 | 86 |
87 | {% csrf_token %} 88 | 89 |

Please sign in

90 | 91 | 93 | 94 | 95 |
96 | 99 |
100 | 101 |

© 2017-2019

102 |
103 | 104 | 105 | -------------------------------------------------------------------------------- /userproject/userproject/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/userproject/__init__.py -------------------------------------------------------------------------------- /userproject/userproject/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/userproject/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /userproject/userproject/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/userproject/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /userproject/userproject/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/userproject/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /userproject/userproject/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/SamirPaul1.django_project/3553d71af817ad9deb882a7458c0b0a2094c4520/userproject/userproject/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /userproject/userproject/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for userproject project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'userproject.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /userproject/userproject/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for userproject project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.0.4. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.0/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = '+w2t1e^5j(dc$6hp$z8q%j&u@()wo327xxiq@bd%z7*v27_hx%' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = ['codewithharry.com', 'programmingwithharry.com', '127.0.0.1'] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'home.apps.HomeConfig', 35 | 'django.contrib.admin', 36 | 'django.contrib.auth', 37 | 'django.contrib.contenttypes', 38 | 'django.contrib.sessions', 39 | 'django.contrib.messages', 40 | 'django.contrib.staticfiles', 41 | ] 42 | 43 | MIDDLEWARE = [ 44 | 'django.middleware.security.SecurityMiddleware', 45 | 'django.contrib.sessions.middleware.SessionMiddleware', 46 | 'django.middleware.common.CommonMiddleware', 47 | 'django.middleware.csrf.CsrfViewMiddleware', 48 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 49 | 'django.contrib.messages.middleware.MessageMiddleware', 50 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 51 | ] 52 | 53 | ROOT_URLCONF = 'userproject.urls' 54 | 55 | TEMPLATES = [ 56 | { 57 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 58 | 'DIRS': [os.path.join(BASE_DIR, "templates")], 59 | 'APP_DIRS': True, 60 | 'OPTIONS': { 61 | 'context_processors': [ 62 | 'django.template.context_processors.debug', 63 | 'django.template.context_processors.request', 64 | 'django.contrib.auth.context_processors.auth', 65 | 'django.contrib.messages.context_processors.messages', 66 | ], 67 | }, 68 | }, 69 | ] 70 | 71 | WSGI_APPLICATION = 'userproject.wsgi.application' 72 | 73 | 74 | # Database 75 | # https://docs.djangoproject.com/en/3.0/ref/settings/#databases 76 | 77 | DATABASES = { 78 | 'default': { 79 | 'ENGINE': 'django.db.backends.sqlite3', 80 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 81 | } 82 | } 83 | 84 | 85 | # Password validation 86 | # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators 87 | 88 | AUTH_PASSWORD_VALIDATORS = [ 89 | { 90 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 91 | }, 92 | { 93 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 94 | }, 95 | { 96 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 97 | }, 98 | { 99 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 100 | }, 101 | ] 102 | 103 | 104 | # Internationalization 105 | # https://docs.djangoproject.com/en/3.0/topics/i18n/ 106 | 107 | LANGUAGE_CODE = 'en-us' 108 | 109 | TIME_ZONE = 'UTC' 110 | 111 | USE_I18N = True 112 | 113 | USE_L10N = True 114 | 115 | USE_TZ = True 116 | 117 | 118 | # Static files (CSS, JavaScript, Images) 119 | # https://docs.djangoproject.com/en/3.0/howto/static-files/ 120 | 121 | STATIC_URL = '/static/' 122 | 123 | STATICFILES_DIRS = [ 124 | os.path.join(BASE_DIR, "static") 125 | ] -------------------------------------------------------------------------------- /userproject/userproject/urls.py: -------------------------------------------------------------------------------- 1 | """userproject URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.0/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path, include 18 | 19 | urlpatterns = [ 20 | path('admin/', admin.site.urls), 21 | path('',include('home.urls')), 22 | ] 23 | -------------------------------------------------------------------------------- /userproject/userproject/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for userproject project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'userproject.settings') 15 | 16 | application = get_wsgi_application() 17 | --------------------------------------------------------------------------------