vintasoftware / django-react-boilerplate Goto Github PK
View Code? Open in Web Editor NEWDjango 5, React, Bootstrap 5 with Python 3 and webpack project boilerplate
License: MIT License
Django 5, React, Bootstrap 5 with Python 3 and webpack project boilerplate
License: MIT License
Bug on bootstrap4.alpha4
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.
Add the things @andersonresende had to change in inflr
For reference, if there is erros with fonts being searched by webpack on the wrong location (not looking for it in s3).
We might need this: http://stackoverflow.com/questions/31796867/is-it-possible-to-have-publicpath-configured-dynamically-in-the-browser-with-w
For example shrinkwrap
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
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)]))')
User model is using __unicode__
method instead of __str__
.
In webpack.base
{
test: /bootstrap\/dist\/js\/umd\//,
loader: 'imports?jQuery=jquery'
},
{
test: /jquery\/dist\/jquery\.js$/,
loader: 'expose?$'
},
This creates bundles with base64 images overloading the css
Maybe create a script to fetch the code we use from the frontend-boilerplate.
"bootstrap": "4.0.0-alpha.2",
"bootstrap-loader": "1.0.10",
SECURE_HSTS_SECONDS = config('SECURE_HSTS_SECONDS', default=3600, cast=int)
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
https://docs.djangoproject.com/en/1.10/topics/http/middleware/#activating-middleware
Can remove 'django.contrib.auth.middleware.SessionAuthenticationMiddleware'
"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?
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',
)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.