Giter VIP home page Giter VIP logo

inertia-django-vite-vue-minimal's Introduction

Inertia + Django + Vite + Vue minimal template

A minimal, working template for Inertia + Django + Vite + Vue.

Technologies

  1. Inertia - powered by the official Inertia.js Django Adapter
  2. Django v4.2
  3. Vite 5 - powered by Django Vite
  4. Vue 3
  5. TypeScript
  6. WhiteNoise - to serve static files

How to install & run

  1. Download the repo. You can either:

    a. Clone the repo (without the git history):

    npx degit https://github.com/mujahidfa/inertia-django-vite-vue-minimal

    b. Or, create a repo based on this template via the GitHub template generator.

  2. Install required Python packages.

    # Create and activate a virtual environment
    python3 -m venv .venv
    source .venv/bin/activate
    
    # Install required Python packages
    pip install -r requirements.txt
  3. Install required Node.js packages.

    npm install
  4. Run the Vite dev server:

    npm run dev
  5. Run Django's default migrations:

    python manage.py migrate
  6. Run the Django dev server (in a separate terminal):

    python manage.py runserver

How to build for production

  1. Set DEBUG=False in settings.py.

    # In settings.py
    ...
    DEBUG=False
    ...
  2. Build the JS/assets for production:

    npm run build
  3. Run collectstatic:

    rm -rf staticfiles/
    python manage.py collectstatic
  4. Run the Django server:

    python manage.py runserver

inertia-django-vite-vue-minimal's People

Contributors

mujahidfa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

inertia-django-vite-vue-minimal's Issues

Minor correction

Hey @mujahidfa

Thanks for the great example. It helped me a lot.

It is working but you need to set DEBUG=True beforehand in the settings.py in order to get it running locally.

Cheers,
Leander

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.