From 0d88048230ecb891f605bb27030718cde0d2359b Mon Sep 17 00:00:00 2001 From: Mohammmed1101 <92180726+Mohammmed1101@users.noreply.github.com> Date: Wed, 27 Jul 2022 03:42:35 +0300 Subject: [PATCH] done --- .gitignore | 1 + firstProject/db.sqlite3 | 0 firstProject/firstProject/__init__.py | 0 .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 193 bytes .../__pycache__/settings.cpython-310.pyc | Bin 0 -> 2340 bytes .../__pycache__/urls.cpython-310.pyc | Bin 0 -> 1038 bytes .../__pycache__/wsgi.cpython-310.pyc | Bin 0 -> 606 bytes firstProject/firstProject/asgi.py | 16 +++ firstProject/firstProject/settings.py | 124 ++++++++++++++++++ firstProject/firstProject/urls.py | 23 ++++ firstProject/firstProject/wsgi.py | 16 +++ firstProject/home/__init__.py | 0 .../home/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 185 bytes .../home/__pycache__/admin.cpython-310.pyc | Bin 0 -> 226 bytes .../home/__pycache__/apps.cpython-310.pyc | Bin 0 -> 460 bytes .../home/__pycache__/models.cpython-310.pyc | Bin 0 -> 223 bytes .../home/__pycache__/views.cpython-310.pyc | Bin 0 -> 459 bytes firstProject/home/admin.py | 3 + firstProject/home/apps.py | 6 + firstProject/home/migrations/__init__.py | 0 .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 196 bytes firstProject/home/models.py | 3 + firstProject/home/tests.py | 3 + firstProject/home/views.py | 9 ++ firstProject/manage.py | 22 ++++ 25 files changed, 226 insertions(+) create mode 100644 .gitignore create mode 100644 firstProject/db.sqlite3 create mode 100644 firstProject/firstProject/__init__.py create mode 100644 firstProject/firstProject/__pycache__/__init__.cpython-310.pyc create mode 100644 firstProject/firstProject/__pycache__/settings.cpython-310.pyc create mode 100644 firstProject/firstProject/__pycache__/urls.cpython-310.pyc create mode 100644 firstProject/firstProject/__pycache__/wsgi.cpython-310.pyc create mode 100644 firstProject/firstProject/asgi.py create mode 100644 firstProject/firstProject/settings.py create mode 100644 firstProject/firstProject/urls.py create mode 100644 firstProject/firstProject/wsgi.py create mode 100644 firstProject/home/__init__.py create mode 100644 firstProject/home/__pycache__/__init__.cpython-310.pyc create mode 100644 firstProject/home/__pycache__/admin.cpython-310.pyc create mode 100644 firstProject/home/__pycache__/apps.cpython-310.pyc create mode 100644 firstProject/home/__pycache__/models.cpython-310.pyc create mode 100644 firstProject/home/__pycache__/views.cpython-310.pyc create mode 100644 firstProject/home/admin.py create mode 100644 firstProject/home/apps.py create mode 100644 firstProject/home/migrations/__init__.py create mode 100644 firstProject/home/migrations/__pycache__/__init__.cpython-310.pyc create mode 100644 firstProject/home/models.py create mode 100644 firstProject/home/tests.py create mode 100644 firstProject/home/views.py create mode 100644 firstProject/manage.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..8fa5b33d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +env \ No newline at end of file diff --git a/firstProject/db.sqlite3 b/firstProject/db.sqlite3 new file mode 100644 index 000000000..e69de29bb diff --git a/firstProject/firstProject/__init__.py b/firstProject/firstProject/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/firstProject/firstProject/__pycache__/__init__.cpython-310.pyc b/firstProject/firstProject/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..88c4ad2b02337b71cf15f72b7267a2ca9038e47c GIT binary patch literal 193 zcmd1j<>g`k0COMY@`ZfaghaZEvFNk)ENKv8~HYBG@PmRVF>q6_85q=9%? iIq~tCd6^~g@p=W7w>WHa^HWN5Qtd#t7c&6~76t&tjWsa< literal 0 HcmV?d00001 diff --git a/firstProject/firstProject/__pycache__/settings.cpython-310.pyc b/firstProject/firstProject/__pycache__/settings.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3f9474e60a31ce335f3afa32191494e691bf8485 GIT binary patch literal 2340 zcmb7FNpIUm6eekEv0^1&vNb_a9*U-FYAR{mBnXN$v`9N@w85m}mJm!(oRKs(H*-dD z#A^@z6FIaw6zH$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$QZQ(}bHn4shXlB4#M(xn4pAJh}Rk9uT?))24 zW2krL*VXAPyVO+atmIOX?5&_@ie1y}Oco8N!sx8NF{KpU+UV@uF40jJX8o1=JFqC? e`lj7|#wBSgdhEeay$>cplZO*;*P9H${{91L_(#+L literal 0 HcmV?d00001 diff --git a/firstProject/firstProject/__pycache__/wsgi.cpython-310.pyc b/firstProject/firstProject/__pycache__/wsgi.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..73dce1089b5d674607f08067deaa1b0c5c36db19 GIT binary patch literal 606 zcmY*X!EVz)5M4WIQw&8t(4O}iMC~3pRS1EaHVT3SDXowqOZL_~u{T=pSi75)^x7Y3 zk9-CHVIgtg#4m7SofOH8v@?3Unt5+#7Wel9;_T)3pVto_A-@{Xwyp#3+%YH4aWW&^ zEN;sCV0!dd)i_Mc_C2*Ritg58Q zm=&nf)YZFiR3&PlLOIrQ^FUF#;=(u$5?)aQ5ERx{<}`{pW+vndrgHqJDZ?@X6}=8m zq5^L$MjR@M>k^cWZcHws;J2Fz8TY;VMGiJ;?vj>_`e^Xs{dhP@rstQJqw#Q>e3}fd zKAztmwnq>euvVzt^m}zLNt})(seLr{!B$O}xhBGFQ cQCO|(y*Jyvymh~an1;Da_MSZRpZkIT7oy0+3jhEB literal 0 HcmV?d00001 diff --git a/firstProject/firstProject/asgi.py b/firstProject/firstProject/asgi.py new file mode 100644 index 000000000..bdd09d7d2 --- /dev/null +++ b/firstProject/firstProject/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for firstProject project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'firstProject.settings') + +application = get_asgi_application() diff --git a/firstProject/firstProject/settings.py b/firstProject/firstProject/settings.py new file mode 100644 index 000000000..575840904 --- /dev/null +++ b/firstProject/firstProject/settings.py @@ -0,0 +1,124 @@ +""" +Django settings for firstProject project. + +Generated by 'django-admin startproject' using Django 4.0.6. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.0/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-cxo&t0)bxqo+nt+c4b$y^sqp7mpkn^ykjon^4ne-8t2g5bzlp^' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'home' +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'firstProject.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'firstProject.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/4.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.0/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/firstProject/firstProject/urls.py b/firstProject/firstProject/urls.py new file mode 100644 index 000000000..72d5ca1c9 --- /dev/null +++ b/firstProject/firstProject/urls.py @@ -0,0 +1,23 @@ +"""firstProject URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/4.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path +import home.views + +urlpatterns = [ + path('admin/', admin.site.urls), + path('home/' , home.views.hello) +] diff --git a/firstProject/firstProject/wsgi.py b/firstProject/firstProject/wsgi.py new file mode 100644 index 000000000..8dcc33dc5 --- /dev/null +++ b/firstProject/firstProject/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for firstProject project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'firstProject.settings') + +application = get_wsgi_application() diff --git a/firstProject/home/__init__.py b/firstProject/home/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/firstProject/home/__pycache__/__init__.cpython-310.pyc b/firstProject/home/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a8978588fea259d45f43679d4d1f3cbf4428921 GIT binary patch literal 185 zcmd1j<>g`kf`9|}lR)%i5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;x_avsFxJacWU< zOh#^geoBmgUaCt`W?5>COMY@`ZfaghaZEvFNk)ENKv8~HYBG@PmRVF>q6_85q=9%a nPDXxiYD|25W?p7Ve7s&kg`kf`9|}lbnF`V-N=!FabFZKwK;UBvKes7;_kM8KW2(8B&;n88n$+0!0}# z8E>&BrsQVk`Drpm@ug%X=B4NBCFkdr6lEqAfecv5P{a(Rz{IaeXRDad;?$zzn2g-~ z{FE5~yi}K>%(B!Nm;B_?+|<01;+TTUl8pSkfTH}Y)MOynEwiY&L>J19Ndxg^)Ne literal 0 HcmV?d00001 diff --git a/firstProject/home/__pycache__/apps.cpython-310.pyc b/firstProject/home/__pycache__/apps.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fbfdb5de1f46f9279597f18c075eb0b7162d47e9 GIT binary patch literal 460 zcmYjN%}&EG3{IL3mHk}Mu1H*apbvl$+SoKWjY$XzRh6P{PPa~NQ<4^GT*nje7Q6+| zkqZY-yaFejb%n=0Pq&WIDJ`m&3Y}lT>72+!a!%e#>~A7jZ5)H*L<5S!dSoa{g4u**Rc3+j>=87lEqBP zwOAmWq)J!kdl)4a{Q)~(6qltA%8g?9hrOsiLgNvadUO|?`pk6pds?n?>@b%7KUU*) TFlM~VX1^g`kf`9|}lWc(WV-N=!FabFZKwK;UBvKes7;_kM8KW2(8B&;n88n$+0!0}# z8E>)W=BK3Q6#Hp1-QrBiO3X{o*Gow%0%=~!P{abHz{Ia8XRDad;?$zzn2g-~{FE5~ zyi}K>%(B!Nm;B_?+|<01;+TTUl8pSkfTH}Y)MOynEwiY&L>J19Ndxg1mjD0& literal 0 HcmV?d00001 diff --git a/firstProject/home/__pycache__/views.cpython-310.pyc b/firstProject/home/__pycache__/views.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..562b01fca313698b75da2ea52025289349bf608d GIT binary patch literal 459 zcmY*V%}T>S5Z>MVwAvPmXAkih&^~~O2rZ(QDvF397tKyhOOj1@HkFE=^x&)bB)&sV zf+t_Wle4jc4t(Ftx9m4NJF3@PXB2NQ?>8TmE&hc=>VSX)BFQArSk5EPZ7nj9JCT#S zkxSYEXCkC4y=OP_q<_xB)+c#b$ZKCiAwh?t?i?9Yp255VGT zP_`HnuuCNQBRA}UKXGa<#`l{?kYy^kR63Kvc5obIY5~D$c3s@6t&nS%JfYAYCEFce znQl@2bv4|LFAy}wX|9xvPYM|6=>p=BN~#Q|&H zhj=lCI~U>yP_@h8WrQvkNUEiY=EiKCaDZ+`@6ccI!lWtTNcQyF#C+%ldr7`35t)aT@>t literal 0 HcmV?d00001 diff --git a/firstProject/home/admin.py b/firstProject/home/admin.py new file mode 100644 index 000000000..8c38f3f3d --- /dev/null +++ b/firstProject/home/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/firstProject/home/apps.py b/firstProject/home/apps.py new file mode 100644 index 000000000..e5ea0afa8 --- /dev/null +++ b/firstProject/home/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class HomeConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'home' diff --git a/firstProject/home/migrations/__init__.py b/firstProject/home/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/firstProject/home/migrations/__pycache__/__init__.cpython-310.pyc b/firstProject/home/migrations/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..830371d494161b13faeadb286ffd29e8d85f3ff7 GIT binary patch literal 196 zcmd1j<>g`kf`9|}lR)%i5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;x_|vsFxJacWU< zOh#^geoBmgUaCt`W?5>COMY@`ZfaghaZEvFNk)ENKv8~HYBG@PmRVF>q6_85q=9%a yPDXxiYD{isdQoCYW`16AOniK1US>&ryk0@&Ee@O9{FKt1R6CFZikW}}3j+X?<~E)H literal 0 HcmV?d00001 diff --git a/firstProject/home/models.py b/firstProject/home/models.py new file mode 100644 index 000000000..71a836239 --- /dev/null +++ b/firstProject/home/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/firstProject/home/tests.py b/firstProject/home/tests.py new file mode 100644 index 000000000..7ce503c2d --- /dev/null +++ b/firstProject/home/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/firstProject/home/views.py b/firstProject/home/views.py new file mode 100644 index 000000000..07930fcc6 --- /dev/null +++ b/firstProject/home/views.py @@ -0,0 +1,9 @@ +from django.shortcuts import render +from django.http import HttpRequest , HttpResponse +# Create your views here. + +def hello(req : HttpRequest): + + res = "Hello World , I love Django!" + + return HttpResponse(res) \ No newline at end of file diff --git a/firstProject/manage.py b/firstProject/manage.py new file mode 100644 index 000000000..b55136bd8 --- /dev/null +++ b/firstProject/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'firstProject.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main()