feat: scaffold Django 5.2 project skeleton (Phase 0)#5
Draft
yuguang wants to merge 6 commits into
Draft
Conversation
- Replace Django 1.4 manage.py with Django 5.2 version - Add pythonfiddle_modern/ project package with settings, urls, wsgi, asgi - Configure settings.py: whitenoise, social_django, taggit, cloud_ide.fiddle, auth backends, i18n (en/zh), LocaleMiddleware, ALLOWED_HOSTS=['*'] for dev - Update requirements.txt: Django>=5.2, social-auth-core, social-auth-app-django, django-taggit, whitenoise (replaces mediasync + django-social-auth) - Add .gitignore (excludes .venv, __pycache__, *.pyc, db.sqlite3) - Add docs/modernization/ with PORTED_MODELS.md, DATA_MIGRATION.md, VALIDATION_CHECKLIST.md, old_inspectdb.txt - Add COMPLETION.md with bootstrap commands and handoff notes Python 2 / Django 1.4 patches applied to cloud_ide (editable install): compression.py, models.py, forms.py, admin.py, views.py, jsonresponse.py, templatetags/jqtmpl.py Exit criteria passed: - python manage.py migrate: OK (fiddle.0001_initial applied) - python manage.py runserver 8001: starts without ImportError on Django 5.2.15 Co-Authored-By: Oz <oz-agent@warp.dev>
- Add STATICFILES_DIRS pointing to project-level static/ directory - Create static/favicon.ico placeholder (16x16 transparent ICO) - STATIC_ROOT, Whitenoise CompressedManifestStaticFilesStorage, and staticfiles/ .gitignore entry were already set by Phase 0 - collectstatic: 128 files copied, 384 post-processed, 0 errors - manage.py check: 0 issues Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
- scripts/export_legacy_data.py: reads legacy SQLite DB directly (no Django required), dumps Language/Snippet/taggit tables to JSON, decompresses CompressedTextField blobs (gzip → zlib → UTF-8 fallback chain) - scripts/import_legacy_data.py: reads JSON export, get_or_create Language, create Snippet with username-based author lookup (fallback: legacy_import_user), re-applies tags via snippet.tags.set(); logs and counts skipped rows - scripts/README.md: full usage docs including full roundtrip example - docs/modernization/DATA_MIGRATION.md: filled in with actual commands, column-level schema mapping, roundtrip test results, and open issues - .gitignore: exclude legacy_export.json (generated artefact) Roundtrip test passed: 1 Language + 1 Snippet (with 2 tags) exported from db.sqlite3 and re-imported cleanly (0 skipped rows). Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
- Add social_django.urls at /social-auth/ with namespace='social' - Add TemplateView placeholder at /login/ (Phase 5 supplies real template) - Add LogoutView at /logout/ (POST-only, Django 5 CSRF-safe) - SOCIAL_AUTH_URL_NAMESPACE, env-var OAuth keys, and social_django INSTALLED_APPS / AUTHENTICATION_BACKENDS were already set in settings.py - Document cloud_ide.login as superseded: it uses django-social-auth (removed package), Django 1.4 URL patterns, and render_to_response; do not add to INSTALLED_APPS - All social backend URL reverses verified working - manage.py check: 0 issues Co-Authored-By: Oz <oz-agent@warp.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 0: Django 5.2 Project Scaffolding
Replaces the legacy Django 1.4 codebase with a fresh Django 5.2 project skeleton on the
modernize/django5branch.What's in this PR
New project structure:
pythonfiddle_modern/— Django 5.2 project package (settings, urls, wsgi, asgi)manage.py— replaced with Django 5.2 versionrequirements.txt— updated with modern deps (replaces mediasync, django-social-auth).gitignore— excludes .venv, pycache, db.sqlite3docs/modernization/— PORTED_MODELS.md, DATA_MIGRATION.md, VALIDATION_CHECKLIST.md, old_inspectdb.txtCOMPLETION.md— bootstrap commands and handoff notesSettings configured:
whitenoisefor static files (replaces mediasync)social_djangofor OAuth (replaces django-social-auth)django-taggit,cloud_ide.fiddlein INSTALLED_APPSLocaleMiddleware+ en/zh LANGUAGESPython 2 → Python 3 / Django 1.4 → 5.2 patches applied to
cloud_ideeditable install:compression.py: cStringIO → io, reimplemented compress_stringmodels.py: absolute imports, gettext_lazy, reverse(), on_delete, strforms.py,admin.py,views.py,jsonresponse.py: absolute imports, simplejson → json, render_to_response → render, is_ajax() removedtemplatetags/jqtmpl.py: TokenType enum, TextNode from correct moduleExit Criteria — Passed ✅
python manage.py migrateexits 0 (all migrations including fiddle.0001_initial)python manage.py runserver 8001starts with no ImportError on Django 5.2.15Conversation: https://app.warp.dev/conversation/20b49f96-beb9-4d1c-9fa1-244195b89cdb
Run: https://oz.warp.dev/runs/019ec33e-63f5-7ad5-829a-fdaca3aa7bed
This PR was generated with Oz.