DEV Community

Cover image for How to host Django Project on Vercel
Odipo Otieno
Odipo Otieno

Posted on

How to host Django Project on Vercel

  • In, set ALLOWED_HOSTS=[""]
  • add a file in same directory as called vercel.json and in the file write the code:
    "builds": [{
        "src" : "django_project/",
        "use" : "@vercel/python",
        "config" : {"maxLambdaSize": "15mb", "runtime" : "python3.9"}
    "routes": [
            "src" : "/(.*)",
            "dest": "django_project/"

NOTE: * replace django_project in the code with the name of your project * If you use the name of app instead, it will not work.

  • Navigate to your project folder and open file called, add line

    app = application
    at the bottom of the file.
  • run command pip freeze > requirements.txt Make sure requirements.txt file is created in the same directory as the

  • run git add, git commit, and git push commands to push the code to github.

  • create a vercel account and import your repository on vercel from github and that's just it.

Follow For More!!

Top comments (0)