{ "info": { "author": "Zenobius Jiricek", "author_email": "airtonix@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Django Anchored Domains\n==========================\n\ndjango-ikari is an application for anchoring configurable\nurlconfs to user configurable subdomains or domains to use\nin software-as-a-service projects.\n\nTable of Contents\n=================\n1 Installation\n2 Settings\n3 Models\n 3.1 Permissions\n4 Middleware\n5 Views\n6 URLs\n7 Templates\n8 License\n\n\n1 Installation\n~~~~~~~~~~~~~~\n Copy or symlink `ikari/' subdirectory to Python path (`setup.py'\n script for automated installation will be supplied later on). Module\n contents are available in the `domains' module.\n\n In order to use application, add `domains' to INSTALLED_APPS in\n Django project `settings.py' file,\n `domains.middleware.DomainsMiddleware' to MIDDLEWARE_CLASSES\n after `AuthenticationMiddleware', and configure application settings\n described in the next section.\n\n2 Settings\n~~~~~~~~~~\n Following Django settings are read by the application:\n - `DOMAINS_ACCOUNT_URLCONF' - if set, `request.urlconf' is set to\n this value when Domain's domain is accessed. This breaks\n django-debug-toolbar and misleads reverse URL resolver (main\n urlconf is always used for reverse URL resolving).\n - `DOMAINS_DEFAULT_DOMAIN' - Default domain name, on which \"main\"\n (non-user) site is hosted. Used to prevent redirection to\n `DOMAINS_DEFAULT_URL' when `DomainsMiddleware' is used both\n on accounts' sites and main site. Also used to construct default\n value of `DOMAINS_DEFAULT_URL' when it is not set.\n - `DOMAINS_DEFAULT_URL' - URL to redirect to when user agent\n refers to site with an unknown domain (not registered in any of\n accounts). When not set, a URL is constructed from\n `DOMAINS_DEFAULT_DOMAIN' or current Site object's domain and\n `DOMAINS_PORT'.\n - `DOMAINS_IP' - if set, value is used to verify custom domains\n in `DomainForm'. It can be set to a string (literal\n 'aa.bb.cc.dd' value that is compared to `sockets.gethostbyname()'\n result), or, for more complex deployments, it can be a function\n that will receive IP as returned by `sockets.gethostbyname()'\n - `DOMAINS_PORT' - can be set to custom port that will be used in\n Domain site URLs. This way, developer can successfully use\n Domains on e.g. 127.0.0.1:8000.\n - `DOMAINS_ROOT_DOMAIN' - root domain for subdomains (with or\n without leading dot). Must be set.\n - `DOMAINS_SUBDOMAIN_STOPWORDS' - tuple of regular expressions\n ([http://docs.python.org/library/re.html]) that cannot be used as\n subdomain names. Default is `(\"^www$\",)'. Use this to stop users\n from e.g. using reserved domain names or using profanities as\n their domain name. Expressions are tested using `re.search', not\n `re.match', so without using `^' anchor they can match anywhere in\n the domain name.\n - `DOMAINS_THEMES' - a sequence of (codename, name) pairs\n indicating available themes for user sites.\n - `DOMAINS_USE_SSO' - use django-sso when redirecting user to\n newly created site. Default is True if django-sso is available,\n False otherwise.\n - `DOMAINS_USERSITE_URLCONF' - name of URLconf module for user\n sites. This is used by Domain instances' get_absolute_url()\n method.\n\n3 Models\n~~~~~~~~\n Application defines one model, `Domain'. Model has three fields:\n - `owner', OneToOneField reference to\n `django.contrib.auth.models.User' model, which holds user owning\n the account;\n - `members', ManyToManyField reference to\n `django.contrib.auth.models.User' model, which holds account\n members;\n - `domain', name of custom full domain for the site, changeable by\n user;\n - `subdomain', a sub-domain of `DOMAINS_ROOT_DOMAIN', not\n editable by user;\n - `is_public', boolean. If True (default), DomainMiddleware will\n allow any `auth.User' to log in to Domain's account; if False,\n only users that are Domain members will be allowed;\n Class has one class attribute, `subdomain_root', which contains root\n for subdomains as in `DOMAINS_ROOT_DOMAIN' setting description,\n always with leading dot. This attribute should not be written.\n\n Model defines `get_absolute_url(path = '/', args = (), kwargs = {})'\n method, which returns link to configured domain\n ([http://subdomain.root_domain/path] if `domain' is None,\n [http://domain/path] otherwise). Optional path can be either an\n absolute path or, if `settings.DOMAINS_USERSITE_URLCONF' is set,\n a name, args and kwargs for reverse URL lookup.\n\n Two methods are defined, `add_member(user)' and\n `remove_member(user)' to respectively add or remove `user' from\n `members' and send out `domains.signals.add_member' or\n `domains.signals.remove_member' with additional `user'\n parameter.\n\n3.1 Permissions\n===============\n - `can_set_custom_domain' enables setting `is_subdomain' to `True'\n by the account owner. If Domain owner does not have such\n permission, `account_detaul' view hides checkbox for\n `is_subdomain', and on form validation `is_subdomain' field is\n unconditionally set to `True';\n - `can_set_public_status' does the same for `is_public' field.\n\n4 Middleware\n~~~~~~~~~~~~\n `domains.middleware.DomainsMiddleware' looks at\n `request.META['HTTP_HOST']' and, if it matches any `Domain' model\n instance:\n - sets `request.domain' to that instance (it can be later used by\n views and, with `request' context processor, in templates);\n - immediately logs out (and redirects to reverse URL lookup of\n `domains_not_a_member') any `auth.models.User' that is not this\n account's owner or memeber, unless `request.domain.is_public'\n is true;\n - if `DOMAINS_ACCOUNT_URLCONF' setting is set, sets\n `request.urlconf' to its value, allowing single project to display\n different URL hierarchies for main site and account sites;\n\n *WARNING*: setting `request.urlconf' doesn't fit well with reverse\n URL lookups (those will still be made against root urlconf),\n django-debug-toolbar, and probably other things as well. For\n maximum reliability, consider running two separate projects on\n single database: one for \"main\" site, other for account domains,\n or use single urlconf for both;\n - send signal `domains.signals.domain_request' and if any\n receiver returns an instance of `HttpResponse', returns this\n response instead of actual page. This can be used for\n e.g. displaying error message and not allowing to log into expired\n accounts.\n\n If current domain doesn't match any of existing Domain instances\n and is not `DOMAINS_DEFAULT_DOMAIN', middleware redirects user to\n `DOMAINS_DEFAULT_DOMAIN'.\n\n5 Views\n~~~~~~~\n - `domains.views.create_account' - if logged in user does not\n have a Domain, displays a form to create a new one or accepts\n results of this form. After accepting form and creating new\n account, redirects user to that account, using django-sso if\n available. It is not configured in default `urls.py' and should\n be added directly in main site's urlconf.\n - `domains.views.account_detail' - displays using\n `domains/account_detail.html' template and validates\n `domains.forms.DomainForm' form, which enables user to\n configure account's domain. In supplied `urls.py' this view is\n named `domains_account_detail'.\n - `domains.views.claim_account' - if `domain.owner' is NULL,\n logged in user can \"claim\" the account, i.e. click a button\n directing to this view, which will send an e-mail to\n `settings.MANAGERS'. This view should be called with a POST\n request. In default `urls.py' this view is named\n `domains_claim_account'.\n - `domains.views.remove_member' - for Domain_owner, with\n `user_id' parameter set, this post will remove user with supplied\n ID from the member list. This view should be called with a POST\n request. In default `urls.py' this view is called\n `domains.views.remove_member'.\n\n6 URLs\n~~~~~~\n In supplied urlconf, `domains.urls', one external URL is\n configured: root for `account_detail' view. More URLs are\n configured for various POST actions. This is intended to be\n included in the subdomain sites' urlconf.\n\n In main site a link to create account form should be used. Account\n is created by view `domains.views.create_account'. Sample\n urlconf line is:\n (r'^accounts/create-site/$', 'domains.views.create_account'),\n\n7 Templates\n~~~~~~~~~~~\n Application in default setup needs two templates:\n - `domains/account_detail.html' called by `account_detail' view.\n Receives two arguments:\n - `object' - edited Domain instance, and\n - `form' - DomainForm instance to display.\n - `domains/create_account.html' called by `create_account' view.\n Receives one argument, `form', holding an instance of\n DomainCreateForm.\n - `domains/claim_account_subject.txt' and\n `domains/claim_account_email.txt' - these templates are used by\n `claim_account' view to create an e-mail to MANAGERS. This\n templates receive three arguments:\n - `user' - user that is sending the claim,\n - `domain' - an account that is claimed,\n - `site' - `sites.Site' object for current site.\n\n\n8 License\n~~~~~~~~~~\n This project is licensed on terms of GPL (GPL-LICENSE.txt) licenses. \n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-ikari", "package_url": "https://pypi.org/project/django-ikari/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-ikari/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/django-ikari/0.0.5/", "requires_dist": null, "requires_python": null, "summary": "Django middleware to allow user configurable domain anchoring to admin configured urlconfs.", "version": "0.0.5" }, "last_serial": 830638, "releases": { "0.0.1": [], "0.0.5": [ { "comment_text": "", "digests": { "md5": "ee76199b14a508aab53ac12a1e2aecfd", "sha256": "c514ddd330a93eaa7412f86b489d5c5ec2d040f68c01005333da9125fd304293" }, "downloads": -1, "filename": "django-ikari-0.0.5.tar.gz", "has_sig": false, "md5_digest": "ee76199b14a508aab53ac12a1e2aecfd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17685, "upload_time": "2013-08-02T04:29:16", "url": "https://files.pythonhosted.org/packages/fb/81/6bd66d75de126987cb3fc332b6b3537faa0a6c6f63483981ce0f180618d2/django-ikari-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ee76199b14a508aab53ac12a1e2aecfd", "sha256": "c514ddd330a93eaa7412f86b489d5c5ec2d040f68c01005333da9125fd304293" }, "downloads": -1, "filename": "django-ikari-0.0.5.tar.gz", "has_sig": false, "md5_digest": "ee76199b14a508aab53ac12a1e2aecfd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17685, "upload_time": "2013-08-02T04:29:16", "url": "https://files.pythonhosted.org/packages/fb/81/6bd66d75de126987cb3fc332b6b3537faa0a6c6f63483981ce0f180618d2/django-ikari-0.0.5.tar.gz" } ] }