diff --git a/lottopy_site/lottopy/__pycache__/urls.cpython-310.pyc b/lottopy_site/lottopy/__pycache__/urls.cpython-310.pyc index f93f61e5..b102b112 100644 Binary files a/lottopy_site/lottopy/__pycache__/urls.cpython-310.pyc and b/lottopy_site/lottopy/__pycache__/urls.cpython-310.pyc differ diff --git a/lottopy_site/lottopy/__pycache__/views.cpython-310.pyc b/lottopy_site/lottopy/__pycache__/views.cpython-310.pyc index 05f0935f..2bfc0d3a 100644 Binary files a/lottopy_site/lottopy/__pycache__/views.cpython-310.pyc and b/lottopy_site/lottopy/__pycache__/views.cpython-310.pyc differ diff --git a/lottopy_site/lottopy/lottopy_web_edition/c25_ans.csv b/lottopy_site/lottopy/lottopy_web_edition/c25_ans.csv index 811b2d04..eb7d9ce8 100644 --- a/lottopy_site/lottopy/lottopy_web_edition/c25_ans.csv +++ b/lottopy_site/lottopy/lottopy_web_edition/c25_ans.csv @@ -1,2 +1,2 @@ Winning_Numbers,Chance -14-18-22-23-5-9,[0.19480519480519481] +14-18-22-23-5-9,347/177100 diff --git a/lottopy_site/lottopy/lottopy_web_edition/cash25.py b/lottopy_site/lottopy/lottopy_web_edition/cash25.py index 8d8b4cb5..f6539c38 100755 --- a/lottopy_site/lottopy/lottopy_web_edition/cash25.py +++ b/lottopy_site/lottopy/lottopy_web_edition/cash25.py @@ -1,4 +1,5 @@ # WVLottopy: Matteo DiBiagio +from fractions import Fraction as frac from sheet2dict import Worksheet import pandas as pd import requests @@ -69,7 +70,7 @@ for n in range(0, 25): sorted_nums = sorted(likely_nums) total_freq = sum(frequency) -Chance = [(total_freq / 177100) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Chance = frac(total_freq, 177100) # Chance = number call freq / all possible numbers i.e. 11238513 Winning_Numbers = str("-".join(sorted_nums)) #print("Likely numbers are . . . ", sorted_nums, "\n", "With percent chance of winning being", chance[0]*100, "%") diff --git a/lottopy_site/lottopy/lottopy_web_edition/cash25.xlsx b/lottopy_site/lottopy/lottopy_web_edition/cash25.xlsx index 5a475600..52c9c364 100644 Binary files a/lottopy_site/lottopy/lottopy_web_edition/cash25.xlsx and b/lottopy_site/lottopy/lottopy_web_edition/cash25.xlsx differ diff --git a/lottopy_site/lottopy/lottopy_web_edition/d3_ans.csv b/lottopy_site/lottopy/lottopy_web_edition/d3_ans.csv index ccecb55c..c57ed27e 100644 --- a/lottopy_site/lottopy/lottopy_web_edition/d3_ans.csv +++ b/lottopy_site/lottopy/lottopy_web_edition/d3_ans.csv @@ -1,2 +1,2 @@ Winning_Numbers,Chance -0-4-6,[0.33] +0-3-6,17/5000 diff --git a/lottopy_site/lottopy/lottopy_web_edition/d4_ans.csv b/lottopy_site/lottopy/lottopy_web_edition/d4_ans.csv index 3c640808..7d8baa1b 100644 --- a/lottopy_site/lottopy/lottopy_web_edition/d4_ans.csv +++ b/lottopy_site/lottopy/lottopy_web_edition/d4_ans.csv @@ -1,2 +1,2 @@ Winning_Numbers,Chance -3-5-6-8,[5.35] +3-5-6-8,267/5000 diff --git a/lottopy_site/lottopy/lottopy_web_edition/daily3.py b/lottopy_site/lottopy/lottopy_web_edition/daily3.py index 85e47a2f..7110d3d4 100755 --- a/lottopy_site/lottopy/lottopy_web_edition/daily3.py +++ b/lottopy_site/lottopy/lottopy_web_edition/daily3.py @@ -1,4 +1,5 @@ # WVLottopy: Matteo DiBiagio +from fractions import Fraction as frac from sheet2dict import Worksheet import pandas as pd import requests @@ -69,7 +70,7 @@ for n in range(0, 10): sorted_nums = sorted(likely_nums) total_freq = sum(frequency) -Chance = [(total_freq / 10000) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Chance = frac(total_freq, 10000) # Chance = number call freq / all possible numbers i.e. 11238513 Winning_Numbers = str("-".join(sorted_nums)) #print("Likely numbers are . . . ", sorted_nums, "\n", "With percent chance of winning being", chance[0]*100, "%") diff --git a/lottopy_site/lottopy/lottopy_web_edition/daily3.xlsx b/lottopy_site/lottopy/lottopy_web_edition/daily3.xlsx index 2d7be544..85fb274a 100644 Binary files a/lottopy_site/lottopy/lottopy_web_edition/daily3.xlsx and b/lottopy_site/lottopy/lottopy_web_edition/daily3.xlsx differ diff --git a/lottopy_site/lottopy/lottopy_web_edition/daily4.py b/lottopy_site/lottopy/lottopy_web_edition/daily4.py index b23635da..19a6907c 100755 --- a/lottopy_site/lottopy/lottopy_web_edition/daily4.py +++ b/lottopy_site/lottopy/lottopy_web_edition/daily4.py @@ -1,4 +1,5 @@ # WVLottopy: Matteo DiBiagio +from fractions import Fraction as frac from sheet2dict import Worksheet import pandas as pd import requests @@ -69,7 +70,7 @@ for n in range(0, 9): sorted_nums = sorted(likely_nums) total_freq = sum(frequency) -Chance = [(total_freq / 10000) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Chance = frac(total_freq, 10000) # Chance = number call freq / all possible numbers i.e. 11238513 Winning_Numbers = str("-".join(sorted_nums)) #print("Likely numbers are . . . ", sorted_nums, "\n", "With percent chance of winning being", chance[0]*100, "%") diff --git a/lottopy_site/lottopy/lottopy_web_edition/daily4.xlsx b/lottopy_site/lottopy/lottopy_web_edition/daily4.xlsx index 30b891be..9db50d90 100644 Binary files a/lottopy_site/lottopy/lottopy_web_edition/daily4.xlsx and b/lottopy_site/lottopy/lottopy_web_edition/daily4.xlsx differ diff --git a/lottopy_site/lottopy/lottopy_web_edition/la_ans.csv b/lottopy_site/lottopy/lottopy_web_edition/la_ans.csv index ba93646c..4331d2e7 100644 --- a/lottopy_site/lottopy/lottopy_web_edition/la_ans.csv +++ b/lottopy_site/lottopy/lottopy_web_edition/la_ans.csv @@ -1,2 +1,2 @@ Winning_Numbers,SB,Chance -1-10-32-36-8,[3],[0.00036937852063902485] +1-10-32-49-8,[3],1/270725 diff --git a/lottopy_site/lottopy/lottopy_web_edition/lotto.xlsx b/lottopy_site/lottopy/lottopy_web_edition/lotto.xlsx index 997e970a..8ec661a0 100644 Binary files a/lottopy_site/lottopy/lottopy_web_edition/lotto.xlsx and b/lottopy_site/lottopy/lottopy_web_edition/lotto.xlsx differ diff --git a/lottopy_site/lottopy/lottopy_web_edition/lotto_america.py b/lottopy_site/lottopy/lottopy_web_edition/lotto_america.py index a9070df1..32a8392e 100755 --- a/lottopy_site/lottopy/lottopy_web_edition/lotto_america.py +++ b/lottopy_site/lottopy/lottopy_web_edition/lotto_america.py @@ -1,5 +1,6 @@ # WVLottopy: Matteo DiBiagio #from django_lottopy.lottopy_site.lottopy.lottopy_web_edition.megamil import Winning_Numbers +from fractions import Fraction as frac from sheet2dict import Worksheet import pandas as pd import requests @@ -70,7 +71,7 @@ for n in range(0, 10): sorted_nums = sorted(likely_nums) total_freq = sum(frequency + frequency_pb) -Chance = [(total_freq / 25989600) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Chance = frac(total_freq, 25989600) # Chance = number call freq / all possible numbers i.e. 11238513 Winning_Numbers = str("-".join(sorted_nums)) #print("Likely numbers are . . . ", sorted_nums, "SB:", likely_pb, "\n", "With percent chance of winning being", chance[0]*100, "%") diff --git a/lottopy_site/lottopy/lottopy_web_edition/lotto_america.xlsx b/lottopy_site/lottopy/lottopy_web_edition/lotto_america.xlsx index 28fed763..25cbf6d0 100644 Binary files a/lottopy_site/lottopy/lottopy_web_edition/lotto_america.xlsx and b/lottopy_site/lottopy/lottopy_web_edition/lotto_america.xlsx differ diff --git a/lottopy_site/lottopy/lottopy_web_edition/lotto_megamil.xlsx b/lottopy_site/lottopy/lottopy_web_edition/lotto_megamil.xlsx index 39328de1..ccc86cf2 100644 Binary files a/lottopy_site/lottopy/lottopy_web_edition/lotto_megamil.xlsx and b/lottopy_site/lottopy/lottopy_web_edition/lotto_megamil.xlsx differ diff --git a/lottopy_site/lottopy/lottopy_web_edition/lottopy_pb.py b/lottopy_site/lottopy/lottopy_web_edition/lottopy_pb.py index f1a013c7..3caa9a51 100755 --- a/lottopy_site/lottopy/lottopy_web_edition/lottopy_pb.py +++ b/lottopy_site/lottopy/lottopy_web_edition/lottopy_pb.py @@ -1,10 +1,14 @@ # WVLottopy: Matteo DiBiagio +from fractions import Fraction as frac from sheet2dict import Worksheet import pandas as pd import requests from collections import Counter import csv +def fraction_ratio(i): + return i/sum(i) + url = 'https://wvlottery.com/draw-games/powerball/?game-analyze=powerball&what-to-search=historysearch&date-range=-1' header = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", @@ -69,7 +73,7 @@ for n in range(0, 26): sorted_nums = sorted(likely_nums) total_freq = sum(frequency + frequency_pb) -Chance = [(total_freq / 292201338) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Chance = frac(total_freq, 292201338) # Chance = number call freq / all possible numbers i.e. 11238513 Winning_Numbers = str("-".join(sorted_nums)) #print("Likely numbers are . . . ", sorted_nums, "PB:", likely_pb, "\n", "With percent chance of winning being", chance[0]*100, "%") diff --git a/lottopy_site/lottopy/lottopy_web_edition/megamil.py b/lottopy_site/lottopy/lottopy_web_edition/megamil.py index cd896921..f81c63f5 100755 --- a/lottopy_site/lottopy/lottopy_web_edition/megamil.py +++ b/lottopy_site/lottopy/lottopy_web_edition/megamil.py @@ -1,4 +1,5 @@ # WVLottopy megamil: Matteo DiBiagio +from fractions import Fraction as frac from sheet2dict import Worksheet import pandas as pd import requests @@ -69,7 +70,7 @@ for n in range(0, 25): sorted_nums = sorted(likely_nums) total_freq = sum(frequency + frequency_pb) -Chance = [(total_freq / 302575350) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Chance = frac(total_freq, 302575350) # Chance = number call freq / all possible numbers i.e. 11238513 Winning_Numbers = str("-".join(sorted_nums)) #print("Likely numbers are . . . ", sorted_nums, "MB:", likely_pb, "\n", "With percent chance of winning being", chance[0]*100, "%") diff --git a/lottopy_site/lottopy/lottopy_web_edition/mm_ans.csv b/lottopy_site/lottopy/lottopy_web_edition/mm_ans.csv index 32d70943..c6ea6cd8 100644 --- a/lottopy_site/lottopy/lottopy_web_edition/mm_ans.csv +++ b/lottopy_site/lottopy/lottopy_web_edition/mm_ans.csv @@ -1,2 +1,2 @@ Winning_Numbers,MB,Chance -17-21-26-52-7,[24],[2.478721416004311e-05] +17-26-40-52-7,[24],1/4034338 diff --git a/lottopy_site/lottopy/lottopy_web_edition/pb_ans.csv b/lottopy_site/lottopy/lottopy_web_edition/pb_ans.csv index 5c3d08c8..fed67877 100644 --- a/lottopy_site/lottopy/lottopy_web_edition/pb_ans.csv +++ b/lottopy_site/lottopy/lottopy_web_edition/pb_ans.csv @@ -1,2 +1,2 @@ Winning_Numbers,PB,Chance -21-39-59-61-63,[17],[3.216959944242281e-05] +21-33-39-59-63,[17],16/48700223 diff --git a/lottopy_site/lottopy/urls.py b/lottopy_site/lottopy/urls.py index 2dec83cc..d37e3941 100644 --- a/lottopy_site/lottopy/urls.py +++ b/lottopy_site/lottopy/urls.py @@ -2,7 +2,7 @@ from django.urls import path from . import views urlpatterns = [ - path('', views.base, name='base'), - path('home/', views.home, name='home'), + #path('', views.base, name='base'), + path('', views.home, name='home'), path('about/', views.about, name="about"), ] diff --git a/lottopy_site/lottopy/views.py b/lottopy_site/lottopy/views.py index 2ac4254b..97336eba 100644 --- a/lottopy_site/lottopy/views.py +++ b/lottopy_site/lottopy/views.py @@ -1,25 +1,22 @@ # Create your views here. from django.http import HttpResponse from django.shortcuts import render +from django.conf import settings +from django.core.cache.backends.base import DEFAULT_TIMEOUT +from django.views.decorators.cache import cache_page import os import csv #f = "~/projects/django_lottopy/lottopy_site/lottopy/lottopy_web_edititon/pb_ans.csv" -#def files(f): -# reader = csv.DictReader(open(f)) -# for row in reader: -# global numbers, pb, chance -# numbers = row[0-5] -# pb = row[6] -# chance = row[7] -# pbdata = pbdata(numbers=numbers,pb=pb,chance=chance) -# pbdata.save() +# MAKE SURE TO START REDIS BEFORE SITE LOADS def base(request): return render(request, 'lottopy/base.html', {'nbar': 'home'}) +CACHE_TTL = getattr(settings, 'CACHE_TTL', DEFAULT_TIMEOUT) +@cache_page(CACHE_TTL) def home(request): # Powerball module_dir = os.path.dirname(__file__) @@ -77,7 +74,8 @@ def home(request): 'lanumbers': lanumbers, 'd3numbers': d3numbers, 'd4numbers': d4numbers, - 'c25numbers': c25numbers + 'c25numbers': c25numbers, + 'active': 'active' } return render(request, 'lottopy/home.html', context) diff --git a/lottopy_site/lottopy_site/__pycache__/settings.cpython-310.pyc b/lottopy_site/lottopy_site/__pycache__/settings.cpython-310.pyc index 9c5e4d14..575d7bc7 100644 Binary files a/lottopy_site/lottopy_site/__pycache__/settings.cpython-310.pyc and b/lottopy_site/lottopy_site/__pycache__/settings.cpython-310.pyc differ diff --git a/lottopy_site/lottopy_site/settings.py b/lottopy_site/lottopy_site/settings.py index 61003e81..381d2c0f 100644 --- a/lottopy_site/lottopy_site/settings.py +++ b/lottopy_site/lottopy_site/settings.py @@ -52,6 +52,8 @@ MIDDLEWARE = [ ] ROOT_URLCONF = 'lottopy_site.urls' +SESSION_COOKIE_SECURE = os.getenv('SESSION_COOKIE_SECURE_ENABLED') != 'False' +CSRF_COOKIE_SECURE = os.getenv('CSRF_COOKIE_SECURE_ENABLED') != 'False' # Templates Directory TEMPLATE_DIR = os.path.join(BASE_DIR,"templates") @@ -132,3 +134,14 @@ STATICFILES_DIRS = [ # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + +# Redis +#REDIS_HOST = 'localhost' +#REDIS_PORT = 6379 +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.redis.RedisCache', + 'LOCATION': 'redis://127.0.0.1:6379', + } +} +CACHE_TTL = 60 * 60 * 24 diff --git a/lottopy_site/static/bootstrap/assets/nrepeating.jpg b/lottopy_site/static/bootstrap/assets/nrepeating.jpg new file mode 100644 index 00000000..ad4941c1 Binary files /dev/null and b/lottopy_site/static/bootstrap/assets/nrepeating.jpg differ diff --git a/lottopy_site/static/bootstrap/css/styles.css b/lottopy_site/static/bootstrap/css/styles.css index 95f635d3..8940fa04 100644 --- a/lottopy_site/static/bootstrap/css/styles.css +++ b/lottopy_site/static/bootstrap/css/styles.css @@ -194,6 +194,19 @@ p { margin-bottom: 1rem; } +feature { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + border: 1px solid #e9ecef; +} + +feature:hover { + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + border: 2px solid #ffffff !important; +} + abbr[title], abbr[data-bs-original-title] { -webkit-text-decoration: underline dotted; diff --git a/lottopy_site/static/bootstrap/pics/WVOut.svg b/lottopy_site/static/bootstrap/pics/badWVOut.svg similarity index 100% rename from lottopy_site/static/bootstrap/pics/WVOut.svg rename to lottopy_site/static/bootstrap/pics/badWVOut.svg diff --git a/lottopy_site/static/bootstrap/pics/wvout.png b/lottopy_site/static/bootstrap/pics/wvout.png new file mode 100644 index 00000000..83068f4e Binary files /dev/null and b/lottopy_site/static/bootstrap/pics/wvout.png differ diff --git a/lottopy_site/templates/lottopy/about.html b/lottopy_site/templates/lottopy/about.html index 6b66d64e..be35750b 100644 --- a/lottopy_site/templates/lottopy/about.html +++ b/lottopy_site/templates/lottopy/about.html @@ -2,6 +2,15 @@ {% load static %} {% block about %} About -

"THIS IS MY FUCKING ABOUT PAGE"

-

"I'm testing it out"

+

About this site

+
+ +

This site was made initally as a project to familiarize myself with Django, and to publicly make available a script I had written to find the most often returned lottery combinations.

+

It started after two close friends of mine peaked my interest with their own ways to win the jackpot. One who thought it was all in location, and another who simply pulled numbers from his dreams and meditation (some winning +$10,000!)

+

Although I do not claim to have a universal link or the secret to winning numbers, my goal is to give the best edge available using statistical and historical analysis on the lottery.

+

The site is still in development, and I am working on adding more features, and improving the site's functionality.

+

If you have any suggestions or comments, please feel free to contact me at site email dot com

+ wallets + +
{% endblock about %} \ No newline at end of file diff --git a/lottopy_site/templates/lottopy/base.html b/lottopy_site/templates/lottopy/base.html index d46d4e4f..5292b1c5 100644 --- a/lottopy_site/templates/lottopy/base.html +++ b/lottopy_site/templates/lottopy/base.html @@ -22,32 +22,33 @@ "sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous"> --> - -