Skip to main content

A Django app to swap the front-end scaffolding for the application.

Project description

Django frontend presets provide a command line that allow you to rapidly swap the front-end scaffolding for the application.

Choices are:
  • reset (reset the inital structure)

  • bootstrap (Setup Bootstrap)

  • vue (Setup VueJs)

  • react (Setup React)

The first time you run the command, it will move templates, static and locale directory to resources at the root of the project, setup the base structure, write your package.json and webpack.mix.js.

Quick start

  1. Install python dependencies.

    pip install django-frontend-presets

  2. Add “django_frontend_presets” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'django_frontend_presets.apps.DjangoFrontendPresetsConfig',
    ]
  3. Run the “preset” command to generate the base structure.

    python manage.py preset [reset, bootstrap, vue, react]

  4. Install javascript dependencies.

    npm install && npm run dev

  5. Update your Django settings:

    LOCALE_PATHS = [str(ROOT_DIR.path("resources", "locale"))]
    
    STATICFILES_DIRS = [str(ROOT_DIR.path("resources", "static"))]
    
    TEMPLATES[0]['DIRS'] = [str(ROOT_DIR.path("resources", "templates"))]
  6. Enjoy :)

Credit

The webpack configuration used came from Laravel Mix made by Jeffrey Way.

Project details


Download files

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

Source Distribution

django-frontend-presets-0.1.1.tar.gz (12.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page