Linux premium242.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
LiteSpeed
Server IP : 66.29.146.154 & Your IP : 216.73.216.6
Domains :
Cant Read [ /etc/named.conf ]
User : tukiwyzk
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
tukiwyzk /
helpgaza /
Delete
Unzip
Name
Size
Permission
Date
Action
-p
[ DIR ]
drwxrwxrwx
2025-10-17 07:59
customsearch
[ DIR ]
drwxrwxrwx
2025-10-17 07:59
mysearchengine
[ DIR ]
drwxrwxrwx
2025-10-17 07:59
public
[ DIR ]
drwxr-xr-x
2025-10-17 07:59
searchapp
[ DIR ]
drwxrwxrwx
2025-10-17 07:59
static
[ DIR ]
drwxrwxrwx
2025-10-17 07:59
staticfiles
[ DIR ]
drwxrwxrwx
2025-10-17 07:59
templates
[ DIR ]
drwxrwxrwx
2025-10-17 07:59
test_data
[ DIR ]
drwxrwxrwx
2025-10-17 07:59
tmp
[ DIR ]
drwxr-xr-x
2025-10-17 07:59
venv
[ DIR ]
drwxrwxrwx
2025-10-17 07:59
.htaccess
197
B
-r--r--r--
2025-10-17 07:59
DEPLOYMENT_GUIDE.md
4.68
KB
-rw-rw-rw-
2025-08-23 14:13
LOCAL_TESTING_GUIDE.md
4.57
KB
-rw-rw-rw-
2025-08-23 14:16
TODO.md
1.42
KB
-rw-rw-rw-
2025-08-23 16:07
backend_test_log.txt
41
B
-rw-rw-rw-
2025-08-23 16:04
base.html
2.5
KB
-rw-rw-rw-
2025-08-23 15:21
db.sqlite3
132
KB
-rw-rw-rw-
2025-08-23 14:24
deploy.sh
3.45
KB
-rw-rw-rw-
2025-08-23 14:12
final_test.py
1.69
KB
-rw-rw-rw-
2025-08-23 14:44
gunicorn.service
323
B
-rw-rw-rw-
2025-08-23 14:11
import_data.py
1.5
KB
-rw-rw-rw-
2025-08-23 14:10
local_setup.py
4.93
KB
-rw-rw-rw-
2025-08-23 14:15
manage.py
670
B
-rw-rw-rw-
2025-08-23 14:23
nginx_config.conf
2.08
KB
-rw-rw-rw-
2025-08-23 14:11
passenger_wsgi.py
66
B
-rw-r--r--
2025-08-23 16:59
performance_results.txt
539
B
-rw-rw-rw-
2025-08-23 16:06
performance_test.py
1.54
KB
-rw-rw-rw-
2025-08-23 16:05
requirements.txt
131
B
-rw-rw-rw-
2025-08-23 16:45
run_local.sh
1014
B
-rw-rw-rw-
2025-08-23 14:17
setup_mysql.sql
214
B
-rw-rw-rw-
2025-08-23 14:10
stderr.log
85.13
KB
-rw-r--r--
2025-12-09 11:53
test_backend.py
989
B
-rw-rw-rw-
2025-08-23 14:29
test_backend_fixed.py
1.2
KB
-rw-rw-rw-
2025-08-23 14:31
test_backend_with_log.py
1.13
KB
-rw-rw-rw-
2025-08-23 14:30
test_complete.py
2.41
KB
-rw-rw-rw-
2025-08-23 14:34
test_results.txt
406
B
-rw-rw-rw-
2025-08-23 14:45
wp-blog-header.php
2.73
KB
-rw-r--r--
2025-10-17 07:59
wp-cron.php
2.73
KB
-rw-r--r--
2025-10-17 07:59
Save
Rename
#!/usr/bin/env python3 """ Local Development Setup Script This script sets up the custom search engine for local development and testing. """ import os import sys import subprocess import sqlite3 from pathlib import Path def setup_local_environment(): print("=== Local Development Setup ===") # Create SQLite database for local development print("Setting up SQLite database...") conn = sqlite3.connect('db.sqlite3') cursor = conn.cursor() # Create priority_links table cursor.execute(''' CREATE TABLE IF NOT EXISTS searchapp_prioritylink ( id INTEGER PRIMARY KEY AUTOINCREMENT, term1 VARCHAR(255) NOT NULL, term2 VARCHAR(255) NOT NULL, url TEXT NOT NULL ) ''') # Insert some test data test_data = [ ('python', 'tutorial', 'https://realpython.com/tutorials/python/'), ('django', 'documentation', 'https://docs.djangoproject.com/'), ('ubuntu', 'server', 'https://ubuntu.com/server'), ('nginx', 'configuration', 'https://nginx.org/en/docs/') ] cursor.executemany( 'INSERT INTO searchapp_prioritylink (term1, term2, url) VALUES (?, ?, ?)', test_data ) conn.commit() conn.close() print("Database setup complete with test data.") # Update Django settings for local development print("Configuring Django for local development...") settings_file = 'mysearchengine/settings.py' with open(settings_file, 'r') as file: content = file.read() # Update settings for local development content = content.replace("DEBUG = False", "DEBUG = True") content = content.replace("ALLOWED_HOSTS = ['your-actual-domain.com', 'server_ip']", "ALLOWED_HOSTS = ['localhost', '127.0.0.1']") # Use SQLite for local development sqlite_config = ''' # Database - SQLite for local development DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } } ''' # Remove MySQL config and add SQLite config mysql_config_start = content.find("# Database") mysql_config_end = content.find("# Password validation") if mysql_config_start != -1 and mysql_config_end != -1: content = content[:mysql_config_start] + sqlite_config + content[mysql_config_end:] # Disable SSL for local development security_settings = ''' # Security settings (disabled for local development) SECURE_SSL_REDIRECT = False SESSION_COOKIE_SECURE = False CSRF_COOKIE_SECURE = False ''' content = content.replace("# Security settings", security_settings) with open(settings_file, 'w') as file: file.write(content) print("Django settings updated for local development.") # Create test data file print("Creating test data file...") test_data_content = """python tutorial https://realpython.com/tutorials/python/ django documentation https://docs.djangoproject.com/ ubuntu server https://ubuntu.com/server nginx configuration https://nginx.org/en/docs/ search engine https://duckduckgo.com/ """ os.makedirs('test_data', exist_ok=True) with open('test_data/abc.txt', 'w') as file: file.write(test_data_content) print("Test data file created: test_data/abc.txt") # Create local run script print("Creating local run script...") run_script = '''#!/bin/bash # Activate virtual environment source venv/bin/activate # Run database migrations python manage.py makemigrations python manage.py migrate # Import test data python -c " import os import django os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysearchengine.settings') django.setup() from searchapp.models import PriorityLink # Clear existing data PriorityLink.objects.all().delete() # Import from test file with open('test_data/abc.txt', 'r') as file: for line in file: line = line.strip() if line: parts = line.split() if len(parts) >= 3: term1, term2, url = parts[0], parts[1], ' '.join(parts[2:]) PriorityLink.objects.create(term1=term1, term2=term2, url=url) print(f'Imported: {term1} {term2} -> {url}') " # Start development server echo "Starting Django development server..." echo "Access the application at: http://localhost:8000" python manage.py runserver ''' with open('run_local.sh', 'w') as file: file.write(run_script) os.chmod('run_local.sh', 0o755) print("Local run script created: run_local.sh") print("\\n=== Local Setup Complete ===") print("Next steps:") print("1. Create virtual environment: python3 -m venv venv") print("2. Activate venv: source venv/bin/activate") print("3. Install dependencies: pip install -r requirements.txt") print("4. Run local setup: ./run_local.sh") print("5. Test search at: http://localhost:8000/search/?q=python+tutorial") if __name__ == "__main__": setup_local_environment()