VelogaWhite commited on
Commit
6b88f68
·
0 Parent(s):

FirstCommit

Browse files
.gitignore ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ db.sqlite3 echo .venv
2
+ db.sqlite3
3
+ .venv
4
+ __pycache__
5
+ *.pyc
6
+ __pycache__
7
+ *.pyc
8
+ db.sqlite3
9
+ .venv
10
+ __pycache__
11
+ *.pyc
functional_tests.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ from selenium import webdriver
2
+
3
+ browser = webdriver.Firefox()
4
+ browser.get("http://localhost:8000")
5
+
6
+ assert "Congratulations!" in browser.title
7
+ print("OK")
manage.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+ """Django's command-line utility for administrative tasks."""
3
+ import os
4
+ import sys
5
+
6
+
7
+ def main():
8
+ """Run administrative tasks."""
9
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'superlists.settings')
10
+ try:
11
+ from django.core.management import execute_from_command_line
12
+ except ImportError as exc:
13
+ raise ImportError(
14
+ "Couldn't import Django. Are you sure it's installed and "
15
+ "available on your PYTHONPATH environment variable? Did you "
16
+ "forget to activate a virtual environment?"
17
+ ) from exc
18
+ execute_from_command_line(sys.argv)
19
+
20
+
21
+ if __name__ == '__main__':
22
+ main()
superlists/__init__.py ADDED
File without changes
superlists/asgi.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ ASGI config for superlists project.
3
+
4
+ It exposes the ASGI callable as a module-level variable named ``application``.
5
+
6
+ For more information on this file, see
7
+ https://docs.djangoproject.com/en/6.0/howto/deployment/asgi/
8
+ """
9
+
10
+ import os
11
+
12
+ from django.core.asgi import get_asgi_application
13
+
14
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'superlists.settings')
15
+
16
+ application = get_asgi_application()
superlists/settings.py ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Django settings for superlists project.
3
+
4
+ Generated by 'django-admin startproject' using Django 6.0.
5
+
6
+ For more information on this file, see
7
+ https://docs.djangoproject.com/en/6.0/topics/settings/
8
+
9
+ For the full list of settings and their values, see
10
+ https://docs.djangoproject.com/en/6.0/ref/settings/
11
+ """
12
+
13
+ from pathlib import Path
14
+
15
+ # Build paths inside the project like this: BASE_DIR / 'subdir'.
16
+ BASE_DIR = Path(__file__).resolve().parent.parent
17
+
18
+
19
+ # Quick-start development settings - unsuitable for production
20
+ # See https://docs.djangoproject.com/en/6.0/howto/deployment/checklist/
21
+
22
+ # SECURITY WARNING: keep the secret key used in production secret!
23
+ SECRET_KEY = 'django-insecure-yn6!va0-@jjwu)5($7u@w5po_#1_dm_yvoa2g(142(vau5+7jx'
24
+
25
+ # SECURITY WARNING: don't run with debug turned on in production!
26
+ DEBUG = True
27
+
28
+ ALLOWED_HOSTS = []
29
+
30
+
31
+ # Application definition
32
+
33
+ INSTALLED_APPS = [
34
+ 'django.contrib.admin',
35
+ 'django.contrib.auth',
36
+ 'django.contrib.contenttypes',
37
+ 'django.contrib.sessions',
38
+ 'django.contrib.messages',
39
+ 'django.contrib.staticfiles',
40
+ ]
41
+
42
+ MIDDLEWARE = [
43
+ 'django.middleware.security.SecurityMiddleware',
44
+ 'django.contrib.sessions.middleware.SessionMiddleware',
45
+ 'django.middleware.common.CommonMiddleware',
46
+ 'django.middleware.csrf.CsrfViewMiddleware',
47
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
48
+ 'django.contrib.messages.middleware.MessageMiddleware',
49
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
50
+ ]
51
+
52
+ ROOT_URLCONF = 'superlists.urls'
53
+
54
+ TEMPLATES = [
55
+ {
56
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
57
+ 'DIRS': [],
58
+ 'APP_DIRS': True,
59
+ 'OPTIONS': {
60
+ 'context_processors': [
61
+ 'django.template.context_processors.request',
62
+ 'django.contrib.auth.context_processors.auth',
63
+ 'django.contrib.messages.context_processors.messages',
64
+ ],
65
+ },
66
+ },
67
+ ]
68
+
69
+ WSGI_APPLICATION = 'superlists.wsgi.application'
70
+
71
+
72
+ # Database
73
+ # https://docs.djangoproject.com/en/6.0/ref/settings/#databases
74
+
75
+ DATABASES = {
76
+ 'default': {
77
+ 'ENGINE': 'django.db.backends.sqlite3',
78
+ 'NAME': BASE_DIR / 'db.sqlite3',
79
+ }
80
+ }
81
+
82
+
83
+ # Password validation
84
+ # https://docs.djangoproject.com/en/6.0/ref/settings/#auth-password-validators
85
+
86
+ AUTH_PASSWORD_VALIDATORS = [
87
+ {
88
+ 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
89
+ },
90
+ {
91
+ 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
92
+ },
93
+ {
94
+ 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
95
+ },
96
+ {
97
+ 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
98
+ },
99
+ ]
100
+
101
+
102
+ # Internationalization
103
+ # https://docs.djangoproject.com/en/6.0/topics/i18n/
104
+
105
+ LANGUAGE_CODE = 'en-us'
106
+
107
+ TIME_ZONE = 'UTC'
108
+
109
+ USE_I18N = True
110
+
111
+ USE_TZ = True
112
+
113
+
114
+ # Static files (CSS, JavaScript, Images)
115
+ # https://docs.djangoproject.com/en/6.0/howto/static-files/
116
+
117
+ STATIC_URL = 'static/'
superlists/urls.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ URL configuration for superlists project.
3
+
4
+ The `urlpatterns` list routes URLs to views. For more information please see:
5
+ https://docs.djangoproject.com/en/6.0/topics/http/urls/
6
+ Examples:
7
+ Function views
8
+ 1. Add an import: from my_app import views
9
+ 2. Add a URL to urlpatterns: path('', views.home, name='home')
10
+ Class-based views
11
+ 1. Add an import: from other_app.views import Home
12
+ 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
13
+ Including another URLconf
14
+ 1. Import the include() function: from django.urls import include, path
15
+ 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
16
+ """
17
+ from django.contrib import admin
18
+ from django.urls import path
19
+
20
+ urlpatterns = [
21
+ path('admin/', admin.site.urls),
22
+ ]
superlists/wsgi.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ WSGI config for superlists project.
3
+
4
+ It exposes the WSGI callable as a module-level variable named ``application``.
5
+
6
+ For more information on this file, see
7
+ https://docs.djangoproject.com/en/6.0/howto/deployment/wsgi/
8
+ """
9
+
10
+ import os
11
+
12
+ from django.core.wsgi import get_wsgi_application
13
+
14
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'superlists.settings')
15
+
16
+ application = get_wsgi_application()
test_selenium.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from selenium import webdriver
2
+ from selenium.webdriver.firefox.service import Service
3
+ from selenium.webdriver.firefox.options import Options
4
+
5
+ # 1. Path to the Browser
6
+ firefox_path = "/usr/lib/firefox/firefox"
7
+
8
+ # 2. Path to the Driver (CHANGE THIS LINE)
9
+ # We moved it to 'local/bin', so we must tell Python that!
10
+ driver_path = "/usr/local/bin/geckodriver"
11
+
12
+ service = Service(executable_path=driver_path)
13
+ options = Options()
14
+ options.binary_location = firefox_path
15
+
16
+ try:
17
+ print(f"Launching Browser: {firefox_path}")
18
+ print(f"Using Driver: {driver_path}")
19
+
20
+ driver = webdriver.Firefox(service=service, options=options)
21
+
22
+ driver.get("https://google.com")
23
+ print("\nSUCCESS: It works!")
24
+ print("Page Title:", driver.title)
25
+ driver.quit()
26
+
27
+ except Exception as e:
28
+ print("\nERROR:")
29
+ print(e)