{"id":15442675,"url":"https://github.com/dragonscypher/djangifyed","last_synced_at":"2025-03-28T07:24:53.425Z","repository":{"id":257316575,"uuid":"857902804","full_name":"dragonscypher/Djangifyed","owner":"dragonscypher","description":"Automating Old Webpage Conversion to Django ","archived":false,"fork":false,"pushed_at":"2024-09-15T22:50:15.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-18T13:14:43.765Z","etag":null,"topics":["automation","python-3","subprocesses","tinker"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dragonscypher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-15T22:38:23.000Z","updated_at":"2024-09-16T00:35:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"92898823-1c1b-4ac5-9228-d70639688e0f","html_url":"https://github.com/dragonscypher/Djangifyed","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"4bbaaf0078333c7e69a55c03a08abc3324eb52ad"},"previous_names":["dragonscypher/djangify"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragonscypher%2FDjangifyed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragonscypher%2FDjangifyed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragonscypher%2FDjangifyed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragonscypher%2FDjangifyed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dragonscypher","download_url":"https://codeload.github.com/dragonscypher/Djangifyed/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245986261,"owners_count":20705187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","python-3","subprocesses","tinker"],"created_at":"2024-10-01T19:29:17.105Z","updated_at":"2025-03-28T07:24:53.399Z","avatar_url":"https://github.com/dragonscypher.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automating Old Webpage Conversion to Django 🛠️\n\n## Why I Created This\n\nSo here's the deal: one of my developer friends hit me up with this problem. They had a bunch of old websites written in **PHP** and good old **HTML/CSS/JS**, and they wanted to give them a fresh start using Django. 🤯 I thought, \"Why not make this process easier for everyone?\" After all, devs often work with legacy tech, and sometimes you just need to upgrade without starting from scratch.\n\nThat’s where this Python script comes in! It automates the conversion of HTML/CSS/JS/PHP files into a clean Django project—no need to manually rework everything from the ground up. ⚡️\n\n## What This Does 🧰\n\n- Converts **HTML** templates into Django's templating system.\n- Moves **CSS/JS** into Django’s static folder.\n- **Converts PHP** scripts into Python using `php2py`, so you can start working with Django views and models in no time.\n- Sets up a fresh **Django project** in a click.\n- **Static files**? No worries, the script handles those too.\n\n## How To Get This Working 🚀\n\n### Step 1: Install the Requirements\n\nMake sure you have the following Python packages installed:\n\n```bash\npip install djangify php2py beautifulsoup4 lxml django\n```\n\n### Step 2: Download the Python Script\n\nGet the Python script (I call it `auto.py`), and make sure it's in a place where you can run it (like your project folder or Desktop).\n\n### Step 3: Run the Script\n\nOpen up your terminal (or command prompt) and run:\n\n```bash\nauto.py\n```\n\n### Step 4: Select the Folder with Your Old Web Files 🗂️\n\nThe script will ask you to select the folder where your **HTML/CSS/JS/PHP** files are. Just navigate to that folder and select it. The script will take care of the rest.\n\n### Step 5: Name Your Django Project 🎉\n\nIt will ask for a name for your new Django project. Choose a cool name, and boom—you've got a Django project with all your old files integrated.\n\n## API Additions\n\nIf you want to add **APIs**, you can easily extend the Django project:\n- Use **Django REST Framework** to create APIs. Install it via `pip install djangorestframework`.\n- Add API views in `views.py`, serializers in `serializers.py`, and configure routes in `urls.py`.\n\nFor example, add this to your `views.py` to expose a simple API:\n\n```python\nfrom rest_framework.views import APIView\nfrom rest_framework.response import Response\n\nclass SimpleAPI(APIView):\n    def get(self, request):\n        data = {\"message\": \"Hello from your API!\"}\n        return Response(data)\n```\n\n### Adding the URL to Your API:\nIn `urls.py`:\n\n```python\nfrom django.urls import path\nfrom .views import SimpleAPI\n\nurlpatterns = [\n    path('api/simple/', SimpleAPI.as_view(), name='simple-api'),\n]\n```\n\n## Need Help? 🤔\n\nIf you run into any issues or have questions, feel free to hit me up! 📨 I’m here to help you sort out any bumps in the road. \n\nEnjoy your freshly upgraded Django project! 🎉✨\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragonscypher%2Fdjangifyed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdragonscypher%2Fdjangifyed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragonscypher%2Fdjangifyed/lists"}