{ "info": { "author": "Erik Hall", "author_email": "hall.erik@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Topic :: Software Development :: Build Tools" ], "description": "# ng2django\n\n![PyPI](https://img.shields.io/pypi/v/ng2django)\n![PyPI - License](https://img.shields.io/pypi/l/ng2django)\n\nThis is a simple Python tool that will convert an HTML file built by Angular2+ to Django Template Language. This way static files can be made available to an Agnular app that is served up with a Django project.\n\nThe script basically does two things:\n\n- Adds a `{% load static %}` tag to the top of the file\n- Changes the value of `href` and `src` attributes of `link` and `script` tags to `{% static \"\" %}`\n\n## Dependencies\n\nThe script uses Beutifulsoup4. You can install it by running `pip install -r requirements.txt`.\n\n## Install\n\nJust run `$ pip install ng2django`\n\n## Usage\n\nBuild your Angular app and place the files in `//static//`.\n\nThe script takes two positional arguments:\n\n- `source`: The path to the HTML file you want to convert.\n- `dest`: Where you want the Django Template file saved.\n\nThen you can run\n\n`$ ng2django //static/index.html //templates/index.html`\n\nif you are storing your files directly in your Django app's `static` and `templates` directories (not recommended), or\n\n`$ ng2django //static//index.html //templates//index.html -s `\n\nif you are using some subdirectory of those paths.\n\n## Optional Arguments\n\nShort | Long | Description\n--- | --- | ---\n-s `` | --subdir `` | Include the subpath under `/static/` where your static files are stored.\n-css `` | --cssdir `` | Include the subpath under `/static//css/` where your static CSS files are stored.\n-js `` | --jsdir `` | Include the subpath under `/static//js/` where your static JS files are stored.\n-img `` | --imgdir `` | Include the subpath under `/static//img/` where your static IMAGE files are stored.\n-n | --nodelete | Do not delete the source file after converting.\n-p | --pretty | Create a dest file that is more human readable.\n\n## Recommended Setup and Usage\n\nIn you Angular project open your `package.json` file. Under `scripts`, change `build` to\n\n`ng build --prod --output-path //static/ng`.\n\nAdd a `postbuild` key under `script` and set the value to\n\n`ng2django //static/ng/index.html //templates/ng/index.html -s ng`.\n\n\nOr if you have css / js / images in seperate directories within static use args: -css css -js js -img img\n`ng2django //static/ng/index.html //templates/ng/index.html -s ng -css css -js js -img img`.\n\n\nRun `npm run build` and your Angular JS and CSS files will be saved to your Django app's static directory. Then, this script will run and convert your HTML file and save it in your Django app's templates directory.\n\n## Contributing\n\nContributions are welcome - submit an issue/pull request.\n\n## Push to PyPi\n\nUse these commands to release on PyPi\n\n\n rm -rf dist/ build/
\n python setup.py sdist
\n twine upload dist/*\n
", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Hall-Erik/ng2django", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "ng2django", "package_url": "https://pypi.org/project/ng2django/", "platform": "", "project_url": "https://pypi.org/project/ng2django/", "project_urls": { "Homepage": "https://github.com/Hall-Erik/ng2django" }, "release_url": "https://pypi.org/project/ng2django/20.7.13/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Convert your Angular built index.html file to Django Template syntax", "version": "20.7.13", "yanked": false, "yanked_reason": null }, "last_serial": 7695041, "releases": { "0.1.3": [ { "comment_text": "", "digests": { "md5": "957bccca23bf2203fec4ce5dd2180b89", "sha256": "8a8775d2445427b874edc3656d4ec99c755f15eded07560525bcb04637fa7bba" }, "downloads": -1, "filename": "ng2django-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "957bccca23bf2203fec4ce5dd2180b89", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 4639, "upload_time": "2019-09-03T23:00:17", "upload_time_iso_8601": "2019-09-03T23:00:17.931545Z", "url": "https://files.pythonhosted.org/packages/90/11/0cac7b7c77d6d906169ac9bd1d4f04b39decae451047c38bef6bd3ad1d38/ng2django-0.1.3-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "671bcdf08ac1a73395e520d36f9cef3e", "sha256": "c42e8ce3c319fed79886652546cd9dc5a1d0105f44773c143497512ff0a05d20" }, "downloads": -1, "filename": "ng2django-0.1.3.tar.gz", "has_sig": false, "md5_digest": "671bcdf08ac1a73395e520d36f9cef3e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3218, "upload_time": "2019-09-03T23:00:19", "upload_time_iso_8601": "2019-09-03T23:00:19.454231Z", "url": "https://files.pythonhosted.org/packages/ed/99/a4c42853e090edc5c97e3254d5c18b6b8828cfaa249fac6ae816bcf34e7c/ng2django-0.1.3.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "85890eaef37d065d618ef48a4eb830a2", "sha256": "e6dd01f501f4a653659013eb2e8d53fedf7f870c5df2ef81746d30d985a9ec61" }, "downloads": -1, "filename": "ng2django-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "85890eaef37d065d618ef48a4eb830a2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 4632, "upload_time": "2019-09-03T23:16:07", "upload_time_iso_8601": "2019-09-03T23:16:07.240692Z", "url": "https://files.pythonhosted.org/packages/02/4e/a901e91b00f04a2d7931478995e22e95b4368971d16c72bb1a0144ce81d1/ng2django-0.1.4-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "e754b43606cbb25ee4b0dbbf260ef9fa", "sha256": "d974c162b6ec950d18a082fa2c0129e84a89d821d27aa69dfa2f46c786cfe52b" }, "downloads": -1, "filename": "ng2django-0.1.4.tar.gz", "has_sig": false, "md5_digest": "e754b43606cbb25ee4b0dbbf260ef9fa", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3205, "upload_time": "2019-09-03T23:16:09", "upload_time_iso_8601": "2019-09-03T23:16:09.692669Z", "url": "https://files.pythonhosted.org/packages/13/bf/3c7c24ab0984c31ace8d27e991d7b015366a153a8243acfaeb8a833a09c9/ng2django-0.1.4.tar.gz", "yanked": false, "yanked_reason": null } ], "19.10.23": [ { "comment_text": "", "digests": { "md5": "0d97efc60c5fe7e01dd95149d4c16a87", "sha256": "098b460094d2d7391b0394aa27f18447efd7a7feced9df6f4aa14c9d8f2c9e8e" }, "downloads": -1, "filename": "ng2django-19.10.23.tar.gz", "has_sig": false, "md5_digest": "0d97efc60c5fe7e01dd95149d4c16a87", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3407, "upload_time": "2019-10-23T17:40:01", "upload_time_iso_8601": "2019-10-23T17:40:01.638263Z", "url": "https://files.pythonhosted.org/packages/af/b0/b18a9a60f3179376ed148a11916b95140b9d70b49f88faf38fed61793dfb/ng2django-19.10.23.tar.gz", "yanked": false, "yanked_reason": null } ], "20.7.13": [ { "comment_text": "", "digests": { "md5": "50f9ed3ec3296b2e277fdd6c26bec294", "sha256": "b243e99a76c1abbb35cc096b442b4b3e57bcbbff96341925149bbc633f291d0c" }, "downloads": -1, "filename": "ng2django-20.7.13.tar.gz", "has_sig": false, "md5_digest": "50f9ed3ec3296b2e277fdd6c26bec294", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4108, "upload_time": "2020-07-14T03:32:08", "upload_time_iso_8601": "2020-07-14T03:32:08.898410Z", "url": "https://files.pythonhosted.org/packages/d0/a5/e70d52ca5daa69ac2a9898b20e579f5bc5451289e19bdebaa91836a716ff/ng2django-20.7.13.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "50f9ed3ec3296b2e277fdd6c26bec294", "sha256": "b243e99a76c1abbb35cc096b442b4b3e57bcbbff96341925149bbc633f291d0c" }, "downloads": -1, "filename": "ng2django-20.7.13.tar.gz", "has_sig": false, "md5_digest": "50f9ed3ec3296b2e277fdd6c26bec294", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4108, "upload_time": "2020-07-14T03:32:08", "upload_time_iso_8601": "2020-07-14T03:32:08.898410Z", "url": "https://files.pythonhosted.org/packages/d0/a5/e70d52ca5daa69ac2a9898b20e579f5bc5451289e19bdebaa91836a716ff/ng2django-20.7.13.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }