GithubHelp home page GithubHelp logo

vintasoftware / django-react-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
1.8K 1.8K 441.0 1.12 MB

Django 5, React, Bootstrap 5 with Python 3 and webpack project boilerplate

License: MIT License

Makefile 2.84% JavaScript 25.78% Python 58.49% HTML 4.89% Shell 3.52% Dockerfile 2.59% SCSS 1.90%
bootstrap bootstrap4 celery django heroku python react redux webpack

django-react-boilerplate's People

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  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  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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar

django-react-boilerplate's Issues

bin/run_webpack: line 15: npm: command not found while pushing to heroku

I follow all the README Steps for running it local. running locally fine (migration/run-server)
Then

heroku create appname
git add -a
git commit -m 'intial commit'
git push heroku master

has below error;

Counting objects: 87, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (70/70), done.
Writing objects: 100% (87/87), 22.28 KiB | 0 bytes/s, done.
Total 87 (delta 5), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote:  !     Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote:                         Detected buildpacks: Python,Node.js
remote:                         See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Python app detected
remote: -----> Running pre-compile hook
remote: ----->Pre-compile hook
remote: -----> Running Webpack
remote: jquery-webpack-stats.json created
remote: webpack-stats.json created
remote: bin/run_webpack: line 15: npm: command not found
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to meddy.
remote: 
To https://git.heroku.com/meddy.git
 ! [remote rejected] master -> master (pre-receive hook declined)

and the app.json file is ;

{
  "name": "appname",
  "description": "Meddy Heroku app.",
  "scripts": {
    "postdeploy": "python manage.py migrate"
  },
  "env": {
    "ALLOWED_HOSTS": {
      "description": "Django ALLOWED_HOSTS setting, e.g.: .appname.herokuapp.com"
    },
    "DISABLE_COLLECTSTATIC": {
      "description": "Heroku setting to disable Django collectstatic (it is run by bin/post_compile)",
      "value": "1"
    },
    "DJANGO_SETTINGS_MODULE": {
      "description": "Django settings Python import path",
      "value": "appname.settings.production"
    },
    "SECRET_KEY": {
      "description": "Django SECRET_KEY setting",
      "generator": "secret"
    }
  },
  "formation": {
    "web": {
      "quantity": 1,
      "size": "free"
    },
    "worker": {
      "quantity": 1,
      "size": "free"
    }
  },
  "addons": [
    {
      "plan": "heroku-postgresql:hobby-dev",
      "options": {
        "version": "9.5"
      },
      "as": "DATABASE"
    },
    {
      "plan": "heroku-redis:hobby-dev",
      "options": {
        "version": "3.2"
      },
      "as": "REDIS"
    },
    {
      "plan": "sendgrid:starter"
    },
    {
      "plan": "papertrail:choklad"
    },
    {
      "plan": "opbeat:test"
    }
  ],
  "buildpacks": [
    {
      "url": "heroku/nodejs"
    },
    {
      "url": "heroku/python"
    }
  ]
}

PS : I don't want to host repo on git and deploy via Button.

Papertrail alerts

Add to README instructions to setup Papertrail alerts.

Examples:

Name:Platform errors
Query:
"error code=H" OR "Error R" OR "Error L"
Name:Request timeout
Query:
code=H12
Name:Worker errors
Query:
"app/worker" AND ERROR/MainProcess

Single command to add SECRET_KEY (before deployment)

heroku config:set SECRET_KEY=$(python -c 'import random; import string; print("".join([random.SystemRandom().choice("{}{}{}".format(string.ascii_letters, string.digits, string.punctuation)) for i in range(50)]))')

Expost jQuery

In webpack.base

{
        test: /bootstrap\/dist\/js\/umd\//,
        loader: 'imports?jQuery=jquery'
      },
      {
        test: /jquery\/dist\/jquery\.js$/,
        loader: 'expose?$'
      },

It's very easy for the local.py.example to get outdated

Instead of local.py.example lets have a local.py and a base_local.py. base_local.py has everything we currently put on local.py.example while local.py will import everything from base_local.
README should have instructions for the developer to create local.py and import from base_local.py

Add pre-commit check on CI

"Usage in Continuous Integration
pre-commit can also be used as a tool for continuous integration. For instance, adding pre-commit run --all-files as a CI step will ensure everything stays in tip-top shape. "

@fjsj should we do this check on CI or do we have a reason not to do it?

ValueError: The file 'admin/css/pagedown.css' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage

I am getting below error;

emote: -----> Running post-compile hook
remote: ----->Post-compile hook
remote: -----> Running run_collectstatic
remote: -----> Collecting static files
remote:        Traceback (most recent call last):
remote:        ValueError: The file 'admin/css/pagedown.css' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7f5e80231710>.
remote:  !     Push rejected, failed to compile Python app.

I added below in base.py file.

STATICFILES_DIRS = (
    base_dir_join('assets'),
    base_dir_join('static'),
    base_dir_join('assets/static'),
    base_dir_join('assets/static2'),
    base_dir_join('apps/wedding/static')
)
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    # other finders..
    'compressor.finders.CompressorFinder',
)

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.