{ "info": { "author": "Manuel Rodriguez", "author_email": "valle.mrv@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# django-themagicapi\n\nDjango application. To launch an api server without endpoint.\nCreate the database on demand.\n\nWe can create multiple databases for different applications.\nJust focusing on the client.\n\nAccording to how we do the JSON query the server.\nIt will create, alter the table, insert,\nlist or delete data from an entire database automatically.\n\nRequirements\n------------\n* Django 1.5+\n* django-tokenapi\n* valleorm\n* django-cors-middleware\n\nInstallation\n------------\n\nFirst obtain `themagicapi` package and place it somewhere on your PYTHONPATH, for example\nin your project directory (where settings.py is).\n\nAlternatively, if you are\nusing some sort of virtual environment, like [virtualenv][], you can perform a\nregular installation or use [pip][]:\n\n python setup.py install\n\n # or ...\n\n pip install django-themagicapi\n\n[virtualenv]: http://pypi.python.org/pypi/virtualenv\n[pip]: http://pip.openplans.org/\n\nAdd 'themagicapi', 'tokenapi' and 'corsheaders' to your `INSTALLED_APPS`.\n\n###These are the modifications of settings.py file:\n```python\n#Add these lines\nPATH_DBS = os.path.join(BASE_DIR, \"[path-of-databases]/\")\n\nMEDIA_ROOT = os.path.join(BASE_DIR, 'docfiles')\nMEDIA_URL = '/docfiles/'\n\nINSTALLED_APPS = [\n 'themagicapi.apps.ThemagicapiConfig',\n 'corsheaders',\n #......\n]\nMIDDLEWARE = [\n 'corsheaders.middleware.CorsMiddleware'\n #......\n]\n\nAUTHENTICATION_BACKENDS = [\n 'django.contrib.auth.backends.ModelBackend',\n 'tokenapi.backends.TokenBackend'\n #.....\n]\n\nCORS_ORIGIN_ALLOW_ALL = True\n```\n\nInclude `themagicapi.urls` and `tokenapi.urls` in your `urls.py`.\nIt will look something like this:\n\n urlpatterns = [\n url(r'^token/', include('tokenapi.urls')),\n url('', include('themagicapi.urls')),\n\n ]\n\nConfiguration and usage of token\n--------------------------------\n\nYou can change the number of days that a token is valid for by setting\n`TOKEN_TIMEOUT_DAYS` in `settings.py`. The default is `7`.\nmore information see [django-tokenapi]: https://github.com/jpulgarin/django-tokenapi.git\n\nUsage\n-----\n### Create new table user if not exists and add new user.\n paramsRow = {\n 'add':{\n \"db\":\"valleorm.db\",\n 'user':{\n \"nombre\": \"Pepito\",\n \"apellido\": \"Lopez\",\n }\n }\n }\n\n### Modify a user with know ID. Alter table automatically.\n\n paramsRow = {\n 'add':{\n \"db\":\"valleorm.db\",\n 'user':{\n 'ID': 1,\n 'apodo': 'donpepito',\n 'telf': '666666'\n }\n }\n }\n\n### Get all user\n\n paramsRow = {\n 'get':{\n \"db\":\"valleorm.db\",\n 'user':{\n }\n }\n }\n\n### Get by ID\n\n paramsRow = {\n 'get':{\n \"db\":\"valleorm.db\",\n 'user':{\n 'ID': 1,\n }\n }\n }\n\n### Remove row by ID\n paramsRow = {\n 'rm':{\n \"db\":\"valleorm.db\",\n 'user':{\n 'ID': 1,\n }\n }\n }\n\n\nFor more requests see [themagic-apiserver]: https://github.com/vallemrv/themagic-apiserver.git\n\nRequests example\n----------------\n```python\nimport requests\nimport json\ndata = json.dumps(***someparams***)\n#for get token see https://github.com/jpulgarin/django-tokenapi.git\ntoken = {\n 'user': 1, #user number\n 'token': 'some token',\n 'data': data\n}\n\nr = requests.post(\"http://localhost:8000/\", data=token)\nprint r.json()\n\n```\n:scroll: License\n----------------\n\nLicensed under the Apache-2.0, see `LICENSE`\n\n:heart_eyes: Contributors\n--------------------------\n\nManuel Rodriguez ", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/vallemrv/django-themagicapi.git", "keywords": null, "license": "Apache License, Version 2.0", "maintainer": null, "maintainer_email": null, "name": "django-themagicapi", "package_url": "https://pypi.org/project/django-themagicapi/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-themagicapi/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/vallemrv/django-themagicapi.git" }, "release_url": "https://pypi.org/project/django-themagicapi/1.0.34/", "requires_dist": null, "requires_python": null, "summary": "Django application. To launch an api server without endpoint. Create the database on demand", "version": "1.0.34" }, "last_serial": 2985525, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "88f4dff1b6d51fe1db1179acc5547823", "sha256": "896000163eb6d7a23ca35953ad2f47f67d57923b39b7fae04afd1a059d739d05" }, "downloads": -1, "filename": "django-themagicapi-1.0.0.tar.gz", "has_sig": false, "md5_digest": "88f4dff1b6d51fe1db1179acc5547823", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2598, "upload_time": "2017-06-28T16:19:59", "url": "https://files.pythonhosted.org/packages/48/c5/bf56a69f265b0100ae947ad0f9a820360dc0db470ea32f948c308c3ef848/django-themagicapi-1.0.0.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "9735f5f9a6778642018424584d8cdf8b", "sha256": "6ebefc1eb8c20f5dfcfa3aa30eb0df3ef6adcf8f06f6be035af598fd023fb239" }, "downloads": -1, "filename": "django-themagicapi-1.0.3.tar.gz", "has_sig": false, "md5_digest": "9735f5f9a6778642018424584d8cdf8b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2600, "upload_time": "2017-06-28T16:22:16", "url": "https://files.pythonhosted.org/packages/ce/e3/4400f13da02eafccd9cc2cf5b104d951bc871dcc2f49071e88c1bf39f8d4/django-themagicapi-1.0.3.tar.gz" } ], "1.0.33": [ { "comment_text": "", "digests": { "md5": "55678f753ef70630a4b5aeabc58f2ae1", "sha256": "19644ea979da8dd0dd819fca67efe94006e016438a9e3f447d0de3efa8757e67" }, "downloads": -1, "filename": "django-themagicapi-1.0.33.tar.gz", "has_sig": false, "md5_digest": "55678f753ef70630a4b5aeabc58f2ae1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2604, "upload_time": "2017-06-28T17:08:09", "url": "https://files.pythonhosted.org/packages/44/65/4f525b3e0838d09c97989588f547fe8c262efb4f3ee495813f4383ad6aa3/django-themagicapi-1.0.33.tar.gz" } ], "1.0.34": [ { "comment_text": "", "digests": { "md5": "c0ff99aca319b265e5566d47aa484403", "sha256": "c467ad2b62b82a6496a622c4194ea975c945768a9ab1f9d7b8fda88ea4e6ecd1" }, "downloads": -1, "filename": "django-themagicapi-1.0.34.tar.gz", "has_sig": false, "md5_digest": "c0ff99aca319b265e5566d47aa484403", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5792, "upload_time": "2017-06-28T17:18:17", "url": "https://files.pythonhosted.org/packages/44/bd/b6104c6f93dea66a22a4047ad128f9c32032d390040297a8338438582dee/django-themagicapi-1.0.34.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c0ff99aca319b265e5566d47aa484403", "sha256": "c467ad2b62b82a6496a622c4194ea975c945768a9ab1f9d7b8fda88ea4e6ecd1" }, "downloads": -1, "filename": "django-themagicapi-1.0.34.tar.gz", "has_sig": false, "md5_digest": "c0ff99aca319b265e5566d47aa484403", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5792, "upload_time": "2017-06-28T17:18:17", "url": "https://files.pythonhosted.org/packages/44/bd/b6104c6f93dea66a22a4047ad128f9c32032d390040297a8338438582dee/django-themagicapi-1.0.34.tar.gz" } ] }