commit ed1d65fa6237a73a3528cd8fb65de84a5d60df21 Author: Tahinli Date: Thu Jun 27 21:21:38 2024 +0300 feat: :sparkles: hello world diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3649d6d --- /dev/null +++ b/.gitignore @@ -0,0 +1,77 @@ +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b69ddd6 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..d40669c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/tJango.iml b/.idea/tJango.iml new file mode 100644 index 0000000..f09199f --- /dev/null +++ b/.idea/tJango.iml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..b46ea70 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "associatedIndex": 4 +} + + + + + + + { + "keyToString": { + "ASKED_ADD_EXTERNAL_FILES": "true", + "RunOnceActivity.OpenDjangoStructureViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "git-widget-placeholder": "main", + "nodejs_package_manager_path": "npm", + "settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable", + "vue.rearranger.settings.migration": "true" + } +} + + + + + + + + + + + + + + + + 1719511805110 + + + + + + \ No newline at end of file diff --git a/db.sqlite3 b/db.sqlite3 new file mode 100644 index 0000000..c97bd7b Binary files /dev/null and b/db.sqlite3 differ diff --git a/hello/__init__.py b/hello/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/hello/__pycache__/__init__.cpython-312.pyc b/hello/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..1770444 Binary files /dev/null and b/hello/__pycache__/__init__.cpython-312.pyc differ diff --git a/hello/__pycache__/urls.cpython-312.pyc b/hello/__pycache__/urls.cpython-312.pyc new file mode 100644 index 0000000..5f74765 Binary files /dev/null and b/hello/__pycache__/urls.cpython-312.pyc differ diff --git a/hello/__pycache__/views.cpython-312.pyc b/hello/__pycache__/views.cpython-312.pyc new file mode 100644 index 0000000..e442efe Binary files /dev/null and b/hello/__pycache__/views.cpython-312.pyc differ diff --git a/hello/admin.py b/hello/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/hello/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/hello/apps.py b/hello/apps.py new file mode 100644 index 0000000..bfc55f0 --- /dev/null +++ b/hello/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class HelloConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'hello' diff --git a/hello/migrations/__init__.py b/hello/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/hello/models.py b/hello/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/hello/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/hello/tests.py b/hello/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/hello/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/hello/urls.py b/hello/urls.py new file mode 100644 index 0000000..2f63793 --- /dev/null +++ b/hello/urls.py @@ -0,0 +1,6 @@ +from django.urls import path +from hello import views + +urlpatterns = [ + path("", views.home, name="home"), +] diff --git a/hello/views.py b/hello/views.py new file mode 100644 index 0000000..89bfe36 --- /dev/null +++ b/hello/views.py @@ -0,0 +1,5 @@ +from django.http import HttpResponse + + +def home(request): + return HttpResponse("Hello World!") diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..522182b --- /dev/null +++ b/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', 'tJango.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() diff --git a/tJango/__init__.py b/tJango/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tJango/__pycache__/__init__.cpython-312.pyc b/tJango/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..ef95a9a Binary files /dev/null and b/tJango/__pycache__/__init__.cpython-312.pyc differ diff --git a/tJango/__pycache__/settings.cpython-312.pyc b/tJango/__pycache__/settings.cpython-312.pyc new file mode 100644 index 0000000..95b5676 Binary files /dev/null and b/tJango/__pycache__/settings.cpython-312.pyc differ diff --git a/tJango/__pycache__/urls.cpython-312.pyc b/tJango/__pycache__/urls.cpython-312.pyc new file mode 100644 index 0000000..f471974 Binary files /dev/null and b/tJango/__pycache__/urls.cpython-312.pyc differ diff --git a/tJango/__pycache__/wsgi.cpython-312.pyc b/tJango/__pycache__/wsgi.cpython-312.pyc new file mode 100644 index 0000000..c34058b Binary files /dev/null and b/tJango/__pycache__/wsgi.cpython-312.pyc differ diff --git a/tJango/asgi.py b/tJango/asgi.py new file mode 100644 index 0000000..427b598 --- /dev/null +++ b/tJango/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for tJango 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/5.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tJango.settings') + +application = get_asgi_application() diff --git a/tJango/settings.py b/tJango/settings.py new file mode 100644 index 0000000..9eb0c27 --- /dev/null +++ b/tJango/settings.py @@ -0,0 +1,123 @@ +""" +Django settings for tJango project. + +Generated by 'django-admin startproject' using Django 5.0.6. + +For more information on this file, see +https://docs.djangoproject.com/en/5.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.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/5.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-samo*m*8!2jb+0b(7e8e$to@suc7z^5uy*4lm6ojjq5w9jj9h#' + +# 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', +] + +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 = 'tJango.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 = 'tJango.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/5.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/5.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/5.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/5.0/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/tJango/urls.py b/tJango/urls.py new file mode 100644 index 0000000..340ebd6 --- /dev/null +++ b/tJango/urls.py @@ -0,0 +1,23 @@ +""" +URL configuration for tJango project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.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, include + +urlpatterns = [ + path("", include("hello.urls")), + path('admin/', admin.site.urls), +] diff --git a/tJango/wsgi.py b/tJango/wsgi.py new file mode 100644 index 0000000..b6f1dd8 --- /dev/null +++ b/tJango/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for tJango 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/5.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tJango.settings') + +application = get_wsgi_application()