mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 07:51:09 -05:00
- Implemented font color configuration based on numeric values in various sections. - Added resizing functionality for input fields to accommodate text length. - Initialized filters on document ready for improved user interaction. - Created visualization for profile data using fetched dot format. - Enhanced SQL detail page with click event handling for row navigation. - Ensured consistent highlighting for code blocks across multiple pages.
ThrillWiki Development Scripts
Development Server Script
The dev_server.sh script sets up all necessary environment variables and starts the Django development server with proper configuration.
Usage
# From the project root directory
./scripts/dev_server.sh
# Or from anywhere
/path/to/thrillwiki_django_no_react/scripts/dev_server.sh
What the script does
- Environment Setup: Sets all required environment variables for local development
- Directory Creation: Creates necessary directories (logs, profiles, media, etc.)
- Database Migrations: Runs pending migrations automatically
- Superuser Creation: Creates a development superuser (admin/admin) if none exists
- Static Files: Collects static files for the application
- Tailwind CSS: Builds Tailwind CSS if npm is available
- System Checks: Runs Django system checks
- Server Start: Starts the Django development server on
http://localhost:8000
Environment Variables Set
The script automatically sets these environment variables:
DJANGO_SETTINGS_MODULE=config.django.localDEBUG=TrueSECRET_KEY=<generated-dev-key>ALLOWED_HOSTS=localhost,127.0.0.1,0.0.0.0DATABASE_URL=postgis://thrillwiki_user:thrillwiki_pass@localhost:5432/thrillwiki_dbCACHE_URL=locmemcache://CORS_ALLOW_ALL_ORIGINS=True- GeoDjango library paths for macOS
- And many more...
Prerequisites
- PostgreSQL with PostGIS: Make sure PostgreSQL with PostGIS extension is running
- Database: Create the database
thrillwiki_dbwith userthrillwiki_user - uv: The script uses
uvto run Django commands - Virtual Environment: The script will activate
.venvif it exists
Database Setup
If you need to set up the database:
# Install PostgreSQL and PostGIS (macOS with Homebrew)
brew install postgresql postgis
# Start PostgreSQL
brew services start postgresql
# Create database and user
psql postgres -c "CREATE USER thrillwiki_user WITH PASSWORD 'thrillwiki_pass';"
psql postgres -c "CREATE DATABASE thrillwiki_db OWNER thrillwiki_user;"
psql -d thrillwiki_db -c "CREATE EXTENSION postgis;"
psql -d thrillwiki_db -c "GRANT ALL PRIVILEGES ON DATABASE thrillwiki_db TO thrillwiki_user;"
Access Points
Once the server is running, you can access:
- Main Application: http://localhost:8000
- Admin Interface: http://localhost:8000/admin/ (admin/admin)
- Django Silk Profiler: http://localhost:8000/silk/
- API Documentation: http://localhost:8000/api/docs/
- API Redoc: http://localhost:8000/api/redoc/
Stopping the Server
Press Ctrl+C to stop the development server.
Troubleshooting
- Database Connection Issues: Ensure PostgreSQL is running and the database exists
- GeoDjango Library Issues: Adjust
GDAL_LIBRARY_PATHandGEOS_LIBRARY_PATHif needed - Permission Issues: Make sure the script is executable with
chmod +x scripts/dev_server.sh - Virtual Environment: Ensure your virtual environment is set up with all dependencies
Customization
You can modify the script to:
- Change default database credentials
- Adjust library paths for your system
- Add additional environment variables
- Modify the development server port or host