{"id":16851731,"url":"https://github.com/they4kman/flango","last_synced_at":"2026-03-12T08:35:50.764Z","repository":{"id":57430049,"uuid":"81672779","full_name":"theY4Kman/flango","owner":"theY4Kman","description":"Flask-like interface for Django","archived":false,"fork":false,"pushed_at":"2018-04-26T13:25:08.000Z","size":16,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T17:09:01.980Z","etag":null,"topics":["django","flask"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theY4Kman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-11T18:24:52.000Z","updated_at":"2020-08-01T09:26:11.000Z","dependencies_parsed_at":"2022-08-26T02:41:39.664Z","dependency_job_id":null,"html_url":"https://github.com/theY4Kman/flango","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theY4Kman%2Fflango","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theY4Kman%2Fflango/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theY4Kman%2Fflango/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theY4Kman%2Fflango/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theY4Kman","download_url":"https://codeload.github.com/theY4Kman/flango/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248358555,"owners_count":21090402,"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":["django","flask"],"created_at":"2024-10-13T13:30:10.883Z","updated_at":"2026-03-12T08:35:50.683Z","avatar_url":"https://github.com/theY4Kman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flango!\n\nDo you like the niceties of Flask, but have to use Django for some reason? Are you a lunatic?\n\nIf you answered yes twice, this library is for you! \n\nSupports Python 2.6 to 3.7, and Django 1.8+\n\n\n# Quickstart\n\nInstall package.\n\n```bash\npip install flango\n```\n\nCreate Flango app, add it to your urls.\n\n```python\n# urls.py\nfrom flango import Flango\n\napp = Flango(__name__)\n\n@app.route('/\u003cint:pk\u003e')\ndef index(pk):\n    from django.contrib.auth.models import User\n    return User.objects.get(pk=pk).first_name\n\nurlpatterns = app.urlpatterns\n```\n\n\n# Benefits\n\n- Access current request anywhere\n \n    ```python\n    from django import forms\n    from flango import request\n \n    class MyForm(forms.Form):\n       def save(self):\n           instance = super(MyForm, self).save(commit=False)\n           instance.user = request.user\n           instance.save()\n           return instance\n    ```\n\n\n- Declare your routes alongside your views\n \n    ```python\n    from flango import render_template\n    from myapp import app\n \n    @app.route('/about')\n    def about():\n       return render_template('about.html')\n    ```\n\n\n- Typed variable parts\n \n    ```python\n    from flango import render_template\n    from myapp import app\n \n    @app.route('/map/\u003cfloat:lat\u003e/\u003cfloat:long\u003e')\n    def map(lat, long):\n       assert isinstance(lat, float)\n       assert isinstance(long, float)\n       return render_template('map.html', lat=lat, long=long)\n    ```\n\n\n- Return response content, status code, and headers directly from views\n \n    ```python\n    from myapp import app\n \n    @app.route('/ok')\n    def ok():\n       return 'ok'\n \n    @app.route('/idk')\n    def idk():\n       return 'idk', 404\n \n    @app.route('/wat')\n    def wat():\n       return 'wat', 400, {'Content-Type': 'text/wat'}\n    ```\n\n\n- Save precious PEP-8 space when building URLs\n \n    ```python\n    from django.db import models\n    from flango import url_for\n    \n    class MyModel(models.Model):\n       def get_invitation_link(self, friend_name):\n           return url_for('my-model-invite', id=self.id, friend_name=friend_name)\n    ```\n\n\n# Using `flango.request` with regular Django views\n\nFlango wraps your view functions to provide the `request` object globally. When your form or other code which accesses `flango.request` is called from a regular Django view, it will fail.\n\nTo fix this, add Flango's `global_request_middleware` to your `settings.MIDDLEWARE`:\n```python\n# settings.py\nMIDDLEWARE = (\n    'flango.global_request_middleware',\n    # ...\n)\n```\n\nFor best results, place it at the top of the list. This allows you to use `flango.request` in other middlewares.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthey4kman%2Fflango","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthey4kman%2Fflango","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthey4kman%2Fflango/lists"}