From 3d11e66df7158112052326a4b9edbf86dff10273 Mon Sep 17 00:00:00 2001 From: lottopy Date: Thu, 16 Jun 2022 13:55:23 -0400 Subject: [PATCH] CSRF ACTUALLY fixed, branches mixed up previously --- .../lottopy/__pycache__/views.cpython-310.pyc | Bin 1948 -> 1926 bytes lottopy_site/lottopy/views.py | 5 ++--- .../__pycache__/settings.cpython-310.pyc | Bin 3753 -> 3901 bytes lottopy_site/lottopy_site/settings.py | 10 +++++++--- lottopy_site/templates/lottopy/about.html | 10 +++++----- lottopy_site/templates/lottopy/base.html | 3 ++- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/lottopy_site/lottopy/__pycache__/views.cpython-310.pyc b/lottopy_site/lottopy/__pycache__/views.cpython-310.pyc index 007bb810561354450d58a6f5898f3c22f602ed48..9103c0ca642c9daedf689bd0ab742bab9d7aebd5 100644 GIT binary patch delta 174 zcmbQk-^S0E&&$ij00cIhjk63-DXL)a7IS8$%X9l PTpavtJWPx{j656w0)8ls delta 170 zcmZqUpTp0W&&$ij00gJkEKickP4&%?&Y#mL6X#K^5R|_k3k+)$h42+5Xb!p(JO7bv@2Kw6vTLs_!+4aBs|d~bO-}9jU+B!rG|YN@`O5}!#GZ3m=~pyx%4BK zK3gZ2NHZ9vBN(GuE;-6=4C8bhIhwnYpWyNnm_(irHi;>k$26VdA~Vo1dnquD0-eDe z)lj6f&}o79nS+cQFffk=EG~I|+{6->z2ynGjb+^7^BYi1|7j6-VRQwocp}f=^F*q{ zU-fDCdml)fY-!@T+_3j*jeWc2cI1V{WqqFCg-)`4*sxvKbdH*iiTa*vJNoORPAA=N zxAp6Dn$lbL%OpX=d$!ZsH)}AR)=$E}OOx5U_&k&Uhu2@#friNT0 zMPnSE%T32_)~p)eHpYyw)|a|qrG{-;d;`s3R`>~tvTxxnHl!4aiBh%lV0WkTu)0%T z+ug2gtZ!^pX|l9ksqU_BZf-xi@PGMUNqI`7fMvSo!6ADWv5Ci2HL1jdf~bf@Btasw HIrYtNLOj!U delta 607 zcmZvYO>YuG7{{6AWr2mIycEi73x&cKN`<0rwQ5`3#zq54S1;26N=gHyCQVHJ z0v^a*dLT`yC*zT`iB}U(9{C1-3rB1`ImtYEUjM&&=4;|}T<*BtP7^;lCWX7(zmi6)20!d z%n4_Y*|r!MKeTTPgu|SlNPwlKiY>@%-4J^rrM!ObP8=uQ&Pmf~_Vuox4J5@A{*x8k z9mCMOJ!OS`mkx=KWn4AUX6SwW_>^^Bh4By9Az`cXF}Yxua?tLx3l>QxGW#aK{|z0) Bo*w`J diff --git a/lottopy_site/lottopy_site/settings.py b/lottopy_site/lottopy_site/settings.py index 09ee1878..573a818b 100644 --- a/lottopy_site/lottopy_site/settings.py +++ b/lottopy_site/lottopy_site/settings.py @@ -29,7 +29,7 @@ DEBUG = False ADMINS = [('Matteo', 'clichemail1@gmail.com')] #ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]', '23.92.22.47:8000'] -ALLOWED_HOSTS = ['23.92.22.47', 'localhost'] +ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'wvlotterypredictor.xyz','www.wvlotterypredictor.xyz'] # Application definition @@ -47,6 +47,7 @@ INSTALLED_APPS = [ #'ckeditor', 'crispy_forms', 'django.contrib.sitemaps', + 'corsheaders', #'django.contrib.sites', #'django_cleanup.apps.CleanupConfig', ] @@ -56,6 +57,7 @@ SITE_ID = 1 MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', + 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', @@ -65,8 +67,10 @@ 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' +SESSION_COOKIE_SECURE = True +CSRF_COOKIE_SECURE = True +CSRF_TRUSTED_ORIGINS = ['https://wvlotterypredictor.xyz', 'https://www.wvlotterypredictor.xyz'] +CORS_ALLOW_ALL_ORIGINS = True # Templates Directory TEMPLATE_DIR = os.path.join(BASE_DIR,"templates") diff --git a/lottopy_site/templates/lottopy/about.html b/lottopy_site/templates/lottopy/about.html index 9bba3ded..1e36f452 100644 --- a/lottopy_site/templates/lottopy/about.html +++ b/lottopy_site/templates/lottopy/about.html @@ -5,12 +5,12 @@

About this site

-

This site was made initally as a project to familiarize myself with the web framework Django, and to publicly make available a program I had written to find the most likely lottery combinations.

+

This site was made initally as a project to familiarize myself with the web framework Django, and to publicly make available a program I had written to find the most likely lottery combinations. It is NOT in affiliation with the West Virginia State Lottery although they are listed above to help confirm winning numbers.

It began when two close friends of mine piqued 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.

-

I am also currently working on cleaning and refactoring the code involved as to open source it and allow others to make their own winning number generator for their state.

-

If you have any suggestions or comments, please feel free to contact me at admin at wvlotterypredictor dot xyz and please keep in mind this site is funded by the donations of those who support it, so any financial assistance is greatly appreciated.

+

I have created a cleaned and stripped down version of the scripts involved and they are hosted here. I encourage anyone interested to port it to their own local lotteries.

+

If you have any suggestions or comments, please feel free to contact me at admin at wvlotterypredictor dot xyz and please keep in mind this site is funded by the donations of those who support it, so any financial assistance is greatly appreciated.

For updates subscribe to the mailing list at the bottom of this page (I will not disclose or abuse your personal information) or follow me on the twitter linked in the navigation bar. Thank you for visiting!

Crypto Addresses

@@ -30,11 +30,11 @@

- + {% endfor %}
Subscribe to Newsletter
{% csrf_token %} diff --git a/lottopy_site/templates/lottopy/base.html b/lottopy_site/templates/lottopy/base.html index 5fdd629a..c023e5e8 100644 --- a/lottopy_site/templates/lottopy/base.html +++ b/lottopy_site/templates/lottopy/base.html @@ -4,9 +4,10 @@ + - + {% if title %} WV Lottery Predictor | {{title}}