Procházet zdrojové kódy

Hotfix needed to run sharix-open-webapp-base, after a major update

- Added .gitignore
- A little cleaning

The logic in a project can be broken! Examine the changes made and change the logic to match them.
TonyKurts před 1 rokem
rodič
revize
8e44258d4c

+ 21 - 0
.gitignore

@@ -0,0 +1,21 @@
+# Virtualenv
+env/
+venv/
+
+# VSCode
+.vscode
+
+# Python
+__pycache__/
+*.py[cod]
+*$py.class
+
+# Django
+migrations/
+staticfiles/
+media/
+
+# Other
+*.sqlite3
+*.*~
+*.*.swp

binární
__pycache__/__init__.cpython-310.pyc


binární
__pycache__/admin.cpython-310.pyc


binární
__pycache__/apps.cpython-310.pyc


binární
__pycache__/forms.cpython-310.pyc


binární
__pycache__/models.cpython-310.pyc


binární
__pycache__/urls.cpython-310.pyc


binární
__pycache__/utils.cpython-310.pyc


binární
__pycache__/views.cpython-310.pyc


+ 1 - 4
forms.py

@@ -1,12 +1,10 @@
 from django import forms
-from captcha.fields import CaptchaField
 import datetime
 
 class MyForm(forms.Form):
     name = forms.CharField(label="", widget=forms.TextInput(attrs={'class':'form-control', 'placeholder':'Имя', 'id':'sendemailname'}))
     email = forms.CharField(label="", widget=forms.TextInput(attrs={'class':'form-control', 'placeholder':'Email', 'type':'email', 'id':'sendemailemail'}))
     message = forms.CharField(label="", widget=forms.Textarea(attrs={'class':'form-control', 'placeholder':'Сообщение', 'rows':'3', 'id':'sendemailmessage'}))
-    captcha = CaptchaField()
 
 SERVICE_CHOICES =(
     (0, "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"),
@@ -31,5 +29,4 @@ class OrderForm(forms.Form):
     service = forms.MultipleChoiceField( required=True, choices=SERVICE_CHOICES, widget=forms.CheckboxSelectMultiple(), error_messages=service_errors)
     datetime = forms.DateTimeField(initial=datetime.date.today, widget=forms.DateTimeInput(attrs={'type':'datetime-local', 'class':'form-control', 'placeholder':'form-control'}) )
     phone = forms.RegexField(regex=r'^\+?1?\d{9,15}$', error_messages=number_errors, widget=forms.TextInput(attrs={'class':'form-control', 'type':'tel', 'placeholder':'+79876543210'}))
-    comment = forms.CharField(label="", required=False, widget=forms.Textarea(attrs={'class':'form-control', 'placeholder':'Комментарий', 'rows':'5'}))
-    captcha = CaptchaField()
+    comment = forms.CharField(label="", required=False, widget=forms.Textarea(attrs={'class':'form-control', 'placeholder':'Комментарий', 'rows':'5'}))

+ 0 - 39
migrations/0001_initial.py

@@ -1,39 +0,0 @@
-# Generated by Django 4.1.3 on 2023-07-26 08:47
-
-import ckeditor.fields
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    initial = True
-
-    dependencies = [
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='ButlerPage',
-            fields=[
-                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('title', models.CharField(max_length=150)),
-                ('slug', models.SlugField(unique=True)),
-                ('content', ckeditor.fields.RichTextField(blank=True, null=True)),
-            ],
-            options={
-                'verbose_name': 'Простая страница',
-                'verbose_name_plural': 'Простые страницы',
-            },
-        ),
-        migrations.CreateModel(
-            name='FAQmodel',
-            fields=[
-                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('question', models.TextField(blank=True)),
-                ('answer', models.TextField(blank=True)),
-            ],
-            options={
-                'verbose_name': 'FAQ',
-            },
-        ),
-    ]

+ 0 - 17
migrations/0002_rename_butlerpage_landingpage.py

@@ -1,17 +0,0 @@
-# Generated by Django 4.1.3 on 2023-08-01 09:28
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('landing', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.RenameModel(
-            old_name='ButlerPage',
-            new_name='LandingPage',
-        ),
-    ]

+ 0 - 0
migrations/__init__.py


binární
migrations/__pycache__/0001_initial.cpython-310.pyc


binární
migrations/__pycache__/0002_rename_butlerpage_landingpage.cpython-310.pyc


binární
migrations/__pycache__/__init__.cpython-310.pyc


+ 0 - 1
urls.py

@@ -20,7 +20,6 @@ urlpatterns = [
     path('clean-cottages/', page_html, name='clean-cottages'),
     path('clean-out/', page_html, name='clean-out'),
     path('clean-renovation/', page_html, name='clean-renovation'),
-    path('captcha/', include('captcha.urls')),
 
     #path('services/<str:page>/', services_html, name="services"),
     #path('', views.flatpage, {'url': ''}, name='about'),

+ 1 - 1
views.py

@@ -4,7 +4,7 @@ from .models import *
 from landing.forms import *
 # Create your views here.
 from django.core.mail import EmailMessage, get_connection
-import core.config as settings
+import core.settings as settings
 
 
 def send_email_mess(body, sub):