From 18e1649b66899245e965fab77aa14fdadd8b0d55 Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Wed, 8 Jan 2025 15:11:19 +0100 Subject: [PATCH] Primer commit --- db.sqlite3 | 0 manage.py | 22 ++++ mysite/__init__.py | 0 mysite/__pycache__/__init__.cpython-311.pyc | Bin 0 -> 168 bytes mysite/__pycache__/settings.cpython-311.pyc | Bin 0 -> 2593 bytes mysite/__pycache__/urls.cpython-311.pyc | Bin 0 -> 1159 bytes mysite/__pycache__/wsgi.cpython-311.pyc | Bin 0 -> 688 bytes mysite/asgi.py | 16 +++ mysite/settings.py | 123 ++++++++++++++++++++ mysite/urls.py | 23 ++++ mysite/wsgi.py | 16 +++ polls/__init__.py | 0 polls/__pycache__/__init__.cpython-311.pyc | Bin 0 -> 167 bytes polls/__pycache__/urls.cpython-311.pyc | Bin 0 -> 375 bytes polls/__pycache__/views.cpython-311.pyc | Bin 0 -> 434 bytes polls/admin.py | 3 + polls/apps.py | 6 + polls/migrations/__init__.py | 0 polls/models.py | 3 + polls/tests.py | 3 + polls/urls.py | 7 ++ polls/views.py | 5 + 22 files changed, 227 insertions(+) create mode 100644 db.sqlite3 create mode 100755 manage.py create mode 100644 mysite/__init__.py create mode 100644 mysite/__pycache__/__init__.cpython-311.pyc create mode 100644 mysite/__pycache__/settings.cpython-311.pyc create mode 100644 mysite/__pycache__/urls.cpython-311.pyc create mode 100644 mysite/__pycache__/wsgi.cpython-311.pyc create mode 100644 mysite/asgi.py create mode 100644 mysite/settings.py create mode 100644 mysite/urls.py create mode 100644 mysite/wsgi.py create mode 100644 polls/__init__.py create mode 100644 polls/__pycache__/__init__.cpython-311.pyc create mode 100644 polls/__pycache__/urls.cpython-311.pyc create mode 100644 polls/__pycache__/views.cpython-311.pyc create mode 100644 polls/admin.py create mode 100644 polls/apps.py create mode 100644 polls/migrations/__init__.py create mode 100644 polls/models.py create mode 100644 polls/tests.py create mode 100644 polls/urls.py create mode 100644 polls/views.py diff --git a/db.sqlite3 b/db.sqlite3 new file mode 100644 index 0000000..e69de29 diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..a7da667 --- /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', 'mysite.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/mysite/__init__.py b/mysite/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/mysite/__pycache__/__init__.cpython-311.pyc b/mysite/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c5e7b9b37df4b77ef6ad688e00b7853afaa8492e GIT binary patch literal 168 zcmZ3^%ge<81V@|e(n0iN5CH>>P{wCAAY(d13PUi1CZpd*ZCdVWc1Nq$jgVvc@pWpQRns(yTYW?p7Ve7s&k mI1eQ?1;b90w22#9q8%Z!C$YMo~2A9Af@p+X&g^T8Sr-oepx&z zoyF&+bNGUYau=0bu$@?OThSUiYZA+%TEk>Fb%Sm0nbaa|%h0z;-Qr@gC87~Su?S{2 z_SoyVYcj3iCe>KeQVgrFd7W*W0K)b$Z*w!;99S=Ukh(!wssVaav8b-GFsv;K{-{bm z1otGiWmzrr<9r_Lb(8D)7(`Iln|Y$;0WfdrEm}A8gLv~jcx#KWn{8EPRcczSzInVK zMZ@5TP=no3)HX5yk1vC44mtYAJI);A1XdJl%U)Ae zY8x{-yhF*XJT;}O4`%Po-J!YXUuv^gx9_zY5ASVHJ=n;}wOq)~_F%ZWu2}}%;JQh* z&x~^0;PK)J(=#EOW$m?yX-|v@O=6mm=97XZ2$Tj`To|>m;9%8c!DaI<< zRSd#)_erfiPV_bmljS3sJvR#0ch3#ki#^_uRqmt{IO(RYafR;dKU7U)lPdsuLdous z>Yb5T6iD8196YQcZ?xVm#394cO$<^sY`ok{-;mWu@7aV(>rc0p`cr5I?(;=MX_9Ko zt9ozpZycx3e5S%x zHfzU#*`McpPDrRMl`4W0sPM~z0k@xSo))0eZW4pmPa*_~ zHr+NI|5~kJhv9~YX35)^`mm76rjChfatpKp&7?0*hyc@2;Yo_8lx6c+ila!m&0s=Qbd%EjN%Tkpg1?vwnM z-X!_DLH1O=MeKaFMKp1XZd(23w;+`URn&a1(2u@6Tx;)Lt`6o^~IQgi##%knDhH+a(K8Qlt_Ow_kHBs`S0fcj9>mEe))C$${TOod=sDPMBEfg ztumb$C`OZ=;9)w`NxHFc#^<5|>7?9DBn6BC0qrbGU+N^>2+9h~K{|7gojgpiE(%^r z4H17h8*`(HV8}%t@u!l$PSj;lc6uMB!ErEkkl_x}lRw>moxbh{{b^A2h(Fj>ynv!( z`)SGb`@lHTU91c*J{w-F_7-Q8ANXMZ?lm+%*-0KI#yio&_*f@$2%8JJ36z?E;A80A N?R}K#4Py$@`7a6VTPFYj literal 0 HcmV?d00001 diff --git a/mysite/__pycache__/urls.cpython-311.pyc b/mysite/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8cbd8a25ff05798d2e2c72609954b604140d88db GIT binary patch literal 1159 zcmb7DL2J}N7@cI3-EB(kp%;%MMRo%EDb~j6s2{RM5i%L)8 zv4?`*yj8?M(?Sm=S5Mv+dh5w=CJC&fptH&BWaiEL-uu3pFH1`fg7*3SyOGyG=)3x; zTeBKmyn(?-6rw%~jnIsZ#O#}f8aLubV)d=W?%M`35w$`KdONg_4TQeITef2pzThpJ z#xVu9GU%g*xEsE+kXq&ofpp@-&$4Q=l&SGIE4*@`49q!%tzdTC?R3^EUt^ZgHJthh zz1>mcj_cfyeIah_fw6Fo^=~Se98<1@cv^8S=MixIj~a#dd@)cYUH3Od+i4KzVU&&_ z2|Av#rV3o=XIm!*gA^!_!qTpbhgB+jWxC38cq-ww$O^lrlk(4M_hL38kia@pM@?wn zj_W!<)Dd-!!uG=?N?o(CRK|-|g`PGu7DLIWj{eu%rcI3{Puzu~H5kC*84QXmm0qwZ zd9=sj(xGB;&IGq$hTCe|QU|-Rl(k}UuH0YI1uUb>4Wdd*0#5g1meDDBn$dJ;91SHY z31u!BkNlXFcSN5`FWbLtZze3vV|s@#1CP3=LP9rd7=|%3mkn!%RELpq?F8ZZ=Nw%> z`O`CNB75QB!H27d8;2X8HcwZ&XDi)P%RRH)bE~ZvZXNZG?w(q!XV&V>ZY-Mzi|WUh GAn;EQcU(dM literal 0 HcmV?d00001 diff --git a/mysite/__pycache__/wsgi.cpython-311.pyc b/mysite/__pycache__/wsgi.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70a5e642e1ced30e856095ebd262e66aff63c37c GIT binary patch literal 688 zcmY*XL2DC16n?XtHoCP@#P&RtUIMyn4@D3W8d^g{lS3*>E}M1tWwT*+X4#pfCI=~~ zzrm}giu8AQPo*gADd5Rlptqi!%^HaB&AgfSX5RO{H_X?~O$)Sq|L{KiL;!y0&QePM zHdlSU`3wPcARvLkNQdavWJYXuOae#-%bW0JZJE5f2Bl!_%m6sovk(FXpn0a9^JNG+ z>w(dR>iXoT^}1beP+#y~6w;nZX*`yZLYkyvfWERVtDz{qON2y8RUc__-($>s%aD4K zdNdZnkl_P{BV=^srP1Pudoc#I+x3!!MZTvZ!Mk0J_be|WQlt^r_2R_=6fd=Wdyoqc=H>5CI3oB$Ih#xZi`oX9Y8tUr0D%__<6 zg{a&-=C07lwhx~lH0v$5eRO=>Xx7{A%hutm7e|xZMf0{qr6L~6YB?*ru4dr6nIU9$ zr{H1xn!cT*rlziwm64C4RPfBwi2?S!Aye7LO2Kb%l@q#tr1{3^_$iK=NO0n`66EcE z)KgA@tcFVH=VMMmWYLYCjIVDzDc<;LTG2TA^MHJ#&DNpwtm3YblaXjJh*_`CDf)+n^ktEm7R;q?qy~7bR*aFmInU|>@UkO literal 0 HcmV?d00001 diff --git a/mysite/asgi.py b/mysite/asgi.py new file mode 100644 index 0000000..44c7dff --- /dev/null +++ b/mysite/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for mysite 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.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') + +application = get_asgi_application() diff --git a/mysite/settings.py b/mysite/settings.py new file mode 100644 index 0000000..5f8fa1a --- /dev/null +++ b/mysite/settings.py @@ -0,0 +1,123 @@ +""" +Django settings for mysite project. + +Generated by 'django-admin startproject' using Django 5.1.4. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.1/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.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-5@k8%e-(*v+8nb1)dvie3_$$ol=3747i)x^n3%j9pg@9j$=b)_' + +# 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 = 'mysite.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 = 'mysite.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/5.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/5.1/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.1/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.1/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/mysite/urls.py b/mysite/urls.py new file mode 100644 index 0000000..9c2418f --- /dev/null +++ b/mysite/urls.py @@ -0,0 +1,23 @@ +""" +URL configuration for mysite project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.1/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('polls/', include("polls.urls")), + path('admin/', admin.site.urls), +] diff --git a/mysite/wsgi.py b/mysite/wsgi.py new file mode 100644 index 0000000..61b0d9d --- /dev/null +++ b/mysite/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for mysite 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.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') + +application = get_wsgi_application() diff --git a/polls/__init__.py b/polls/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/polls/__pycache__/__init__.cpython-311.pyc b/polls/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2cd2f500abe55682e09da5043b4019d36d29e4a1 GIT binary patch literal 167 zcmZ3^%ge<81P*O==^*+sh=2h`DC095kTIPhg&~+hlhJP_LlF~@{~09t%St~ZKQ~oB zxhS!=;9}E5dnqnpAKbfECGvc~mAdv@D#Pl#Pl88YdN$ z-I}q8GIkcYjYo%(h-JT0yikUxTw`W8)zQ{?dZJk+Q=)i-xo*MYfFv?w>{Ok_A2S+OmfzCPzUi}=zpLT z|CtI7a^U3TR_NBrm$Qn3kG${uk@r3%kEPNoK|8&_?%ZH}x5c+Pi)2>DWJEaORFEER zQcAdUN16_I8>Eu^uw!GI7Hh`D$Dm^wX=u~MvJLLSXAF}OF~9COeZcDJr-MMJKHRE- z5OSOKr4rm{Cofx5LhgQ(5xGAxbl@nS7@47aFKvE+Je}8Hwa}9g0_NzkTDE{ zqZpz_*gZ1=KW{}HX%Zt3rul;zCE@fC%KuQi>uc6$MH*bAXK6v)3FJ5($ ztIn`V>J>NjzF>ZcA6IrhTO1R$V)H!8ys+1kJQ1+3idfp$=^d1*ODTON8