{"id":27888270,"url":"https://github.com/ironlanguages/ironpython-aspnet-mvc","last_synced_at":"2025-05-05T09:07:11.172Z","repository":{"id":47352074,"uuid":"51666824","full_name":"IronLanguages/ironpython-aspnet-mvc","owner":"IronLanguages","description":"Bring the world of dynamic coding with IronPython and ASP.Net MVC together.","archived":false,"fork":false,"pushed_at":"2016-02-25T14:00:26.000Z","size":3484,"stargazers_count":17,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-03-25T21:59:13.733Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IronLanguages.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-13T21:31:42.000Z","updated_at":"2023-04-25T23:21:46.000Z","dependencies_parsed_at":"2022-08-22T01:40:45.598Z","dependency_job_id":null,"html_url":"https://github.com/IronLanguages/ironpython-aspnet-mvc","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/IronLanguages%2Fironpython-aspnet-mvc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronLanguages%2Fironpython-aspnet-mvc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronLanguages%2Fironpython-aspnet-mvc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronLanguages%2Fironpython-aspnet-mvc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IronLanguages","download_url":"https://codeload.github.com/IronLanguages/ironpython-aspnet-mvc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252470763,"owners_count":21753047,"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":[],"created_at":"2025-05-05T09:07:10.548Z","updated_at":"2025-05-05T09:07:11.164Z","avatar_url":"https://github.com/IronLanguages.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IronPython-AspNet-Mvc\nCreate AspNet MVC based websites and applications with IronPython to combine the power of the .Net Framework and Python.\n\nThe following things are currently supported:\n\n1. Application Startup\n2. Creating controller and actions\n3. Using different layout techniques\n4. Use bundles for embedding Script and Styles\n5. Use method decorators for routing and http-method filter\n6. Base implementation of the filter system\n\n## Simple example\nThis example shows some very basic usage. It creates an application and one `Home` controller which will be registered automatically.\n\n```python\n# ------------------------------------------------\n# This is the root of any IronPython based\n# AspNet MVC application.\n# ------------------------------------------------\n\nimport aspnet\n\n# Define \"root\" class of the MVC-System\nclass App(aspnet.Application):\n    \n    # Start IronPython asp.net mvc application. \n    # Routes and other stuff can be registered here\n    def start(self):\n        \n        # Register all routes\n        aspnet.Routing.register_all()\n\n        # Set layout\n        aspnet.Views.set_layout('~/Views/Shared/_Layout.cshtml')\n\nclass HomeController(aspnet.Controller):\n\n    def index(self):\n        return self.view(\"~/Views/Home/Index.cshtml\")\n\n```\n\n## Creating a controller\n\nFor creating a controller, just let your class derive from `aspnet.Controller`:\n\n```python\nclass ProductController(aspnet.Controller):\n    \n    # Index endpoint which is available over: http://yoursite.com/product/index\n    def index(self):\n        return self.view()\n```\n\nAll controller can be automatically registered using: `aspnet.Routing.register_all()` on application startup.\n\n## Making a action accepts only post\n\nTo make an action only accept post request, just use the `httpPost` decorator:\n\n```python\nclass ProductController(aspnet.Controller):\n    \n    @aspnet.Filter.httpPost\n    def add(self, model):\n        # ....\n```\n\n## Bundles\n\nRegister bundles to load them in your views:\n\n```python\n# Load style bundle\nbundle = aspnet.StyleBundle('~/Content/css')\nbundle.include(\"~/Content/css/all.css\")\n\naspnet.Bundles.add(bundle)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fironlanguages%2Fironpython-aspnet-mvc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fironlanguages%2Fironpython-aspnet-mvc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fironlanguages%2Fironpython-aspnet-mvc/lists"}