{ "info": { "author": "Peter Sanchez", "author_email": "petersanchez@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "==============================\ndjango-easyconfig |nlshield|\n==============================\n\n\nThis app will make it easy to customize external Django apps \nthat use it.\n\nIt takes an approach very similar to the old django.contrib.comments \n(now django-comments) framework. It makes it easy to use custom \nforms, values, etc.\n\nQuick example...\n\nSay you have an open source Django app that lets you upload a \nPhoto and some metadata to that photo. To be able to customize \nthat form, the project owners would have to hack the app's \nsource to fit their needs (class names, etc.) or you have to \nmake your app customizable. That's where django-easyconfig \ncomes in...\n\n\nInstall\n-------\n\nBasic Install:\n\n $ python setup.py build\n $ sudo python setup.py install\n\nAlternative Install (Manually):\n\nPlace webutils directory in your Python path. Either in your Python \ninstalls site-packages directory or set your $PYTHONPATH environment \nvariable to include a directory where the webutils directory lives.\n\n\nUse\n---\n\n* XXX * These are not great docs. I'll work on updating this soon!\n\nYou must create a \"Config\" object in your app and use that to fetch \nany object or value you want to be able to have customized.\n\nHere is a basic example.\n\n### yourapp/config.py\n::\n\n from easyconfig import EasyConfig\n from django.contrib.auth.forms import AuthenticationForm\n from yourapp.forms import PasswordChangeForm\n\n\n class Config(object):\n ''' Base config class to easily pass forms, etc. to \n yourapp views.\n '''\n # Use the dotted Python path to this class\n config = EasyConfig('yourapp.config.Config', 'YOURAPP_CONFIG')\n\t\n def get_login_form(self):\n return self.config.get_object('get_login_form', AuthenticationForm)\n\n def get_password_change_form(self):\n return self.config.get_object('get_password_change_form', PasswordChangeForm)\n\n\nNow, you just need to use your yourapp.Config class any time you need \nto fetch one of these objects for use.\n\nHere's how it could be used in a urls.py file\n\n### urls.py\n::\n\n from django.conf.urls import url\n from yourapp import views\n from yourapp.config import Config\n\n\n config = Config()\n\n urlpatterns = [\n url(r'^login/$',\n views.login, {\n 'template_name': 'yourapp/login.html',\n 'authentication_form': config.get_login_form(),\n }, name='yourapp-login'),\n url(r'^passwd_change/$',\n views.passwd_change, {\n 'template_name': 'yourapp/passwd_change.html',\n 'passwd_change_form': config.get_password_change_form(),\n }, name='yourapp-passwd-change'),\n ]\n\nNow, anybody using your app in their own project can easily change the \nlogin and password change forms to whatever form they want. Here is how\nthey would do so in their own project.\n\n\n### settings.py\n::\n\n # Dotted python path to their own CustomConfig class\n YOURAPP_CONFIG = 'myproject.myapp.config.CustomConfig'\n\n### myproject/myapp/config.py\n::\n\n from myproject.myapp.forms import AuthForm, ChangeForm\n\n\n class CustomConfig(object): \n ''' Customize the forms!\n '''\n def get_login_form(self):\n return AuthForm\n \n def get_password_change_form(self):\n return ChangeForm\n\n\nThat's it. Easy right? :)\n\n\nCopyright & Warranty\n--------------------\nAll documentation, libraries, and sample code are \nCopyright 2010 Peter Sanchez . The library and \nsample code are made available to you under the terms of the BSD license \nwhich is contained in the included file, BSD-LICENSE.\n\n==================\nCommercial Support\n==================\nThis software, and lots of other software like it, has been built in \nsupport of many of Netlandish's own projects, and the projects of our \nclients. We would love to help you on your next project so get in \ntouch by dropping us a note at hello@netlandish.com.\n\n\n.. |nlshield| image:: https://img.shields.io/badge/100%-Netlandish-blue.svg?style=square-flat\n :target: http://www.netlandish.com", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bitbucket.org/petersanchez/django-easyconfig/", "keywords": null, "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "django-easyconfig", "package_url": "https://pypi.org/project/django-easyconfig/", "platform": "any", "project_url": "https://pypi.org/project/django-easyconfig/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://bitbucket.org/petersanchez/django-easyconfig/" }, "release_url": "https://pypi.org/project/django-easyconfig/0.3/", "requires_dist": null, "requires_python": null, "summary": "Module to make it easy to configure external Django apps.", "version": "0.3" }, "last_serial": 2120456, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "a4be411dae8935e2cc6af3cc0eadadc1", "sha256": "9db95dbc32b84af78b7c8ece2348a3e1a4e574a56c35e2e11d5460df8da116cf" }, "downloads": -1, "filename": "django-easyconfig-0.1.tar.gz", "has_sig": false, "md5_digest": "a4be411dae8935e2cc6af3cc0eadadc1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3463, "upload_time": "2010-12-31T03:19:22", "url": "https://files.pythonhosted.org/packages/07/3e/f55287606c02abfb19c2796243ed49e70c5ac172bb59782c0924b223f6ff/django-easyconfig-0.1.tar.gz" } ], "0.2": [], "0.3": [ { "comment_text": "", "digests": { "md5": "033bb7d66733f38d4c49a90e4e8211d3", "sha256": "676c67a0e2f2ef6a7dc32e0f670ba6c8b96dde4737a901d16dbe2738dfd04fbc" }, "downloads": -1, "filename": "django-easyconfig-0.3.tar.gz", "has_sig": false, "md5_digest": "033bb7d66733f38d4c49a90e4e8211d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4570, "upload_time": "2016-05-17T19:08:19", "url": "https://files.pythonhosted.org/packages/07/a2/9f846d9bc1f11ae91b646625752590735ad9d683e420183d1d9dba18311e/django-easyconfig-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "033bb7d66733f38d4c49a90e4e8211d3", "sha256": "676c67a0e2f2ef6a7dc32e0f670ba6c8b96dde4737a901d16dbe2738dfd04fbc" }, "downloads": -1, "filename": "django-easyconfig-0.3.tar.gz", "has_sig": false, "md5_digest": "033bb7d66733f38d4c49a90e4e8211d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4570, "upload_time": "2016-05-17T19:08:19", "url": "https://files.pythonhosted.org/packages/07/a2/9f846d9bc1f11ae91b646625752590735ad9d683e420183d1d9dba18311e/django-easyconfig-0.3.tar.gz" } ] }