Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

make django url more comfortable.

Project description

make urlpatterns very easy to use.


django >= 2.x


pip install django-request-mapping



from django_request_mapping import request_mapping

class UserView(View):

    def get_user_info_by_token(self, request, *args, **kwargs):
        return HttpResponse("ok")

    def some_others(self, request, year, *args, **kwargs):
        return HttpResponse("ok")

    @request_mapping(value="/login/", method="post")
    def login(self, request, *args, **kwargs):
        return HttpResponse("ok")


from django_request_mapping import UrlPattern
urlpatterns = UrlPattern()


python runserver

and request urls are:

get:  http://localhost:8000/user/get_info/
get: http://localhost:8000/user/get_list/1999/
post:  http://localhost:8000/user/login/


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-request-mapping, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size django_request_mapping-0.0.4-py3-none-any.whl (6.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size django-request-mapping-0.0.4.tar.gz (3.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page