I'm using flask as my backend and Vue.js for my frontend. I created my VueJS project with vue-cli.
The way I have my project setup right now is that my backend is serving my static files. I, npm run build, and output the bundle files to my backend.
Everything works. It's just annoying to build every time.
I would like to re-compile my bundle every time I make changes to Vue. Is this possible? Modify my webpack?
Note: My project/flask is dockerized too.
This is what I was looking for: https://github.com/vuejs/vue-cli/issues/1120 then I found https://www.npmjs.com/package/vue-cli-plugin-build-watch
Related
I have a Django Project for which I am trying to find a way to deploy as a .war file.
My objective is
to not reveal the source code during deployment
to De-Couple Django App from Database and deploy as a .war file. This will help me to update the app without re-initializing database.
As Jython is not supported for Python3, is there an alternative?
I also tried to create an exe through PyIntsaller but it acts as a malicious executable.
I'm new to Django and Python, I'm coming from Laravel.
I'm working on a Windows machine.
My Laravel project has tons of folders (vendor etc.) and is >100 MB my Django project is <50kB.
In the end, I want to upload my Django project to a webserver.
But I'm curious where the Djangofiles on my computer are located, and how deployment works. (what are the essential parts/files compared to Laravel (Project Folder + DATABASE) which I've to transfer)
Is the Django Framework similar to a Javascript file, which I can put I my project folder or get via linking?
The place you move your Django project folder to on your server is where your Django files is located. Django files might be small in size, however, to run your Django application you will need to install +100MB packages from PIP.
The essential part of Django is your project directory and your requirements.txt file in which all python package required to run your application will be listed in it.
Django is not similar to a Javascript file, Django is a complete web development framework similar to Laravel framework, you may refer to this Head-to-Head comparison between Django and Laravel: Here
For more details on deployment you may refer to the following tutorials:
Hosting Django with Nginx: Nginx + Django
Hosting Django with Apache: Apache + Django
I've developed Django as backend with ReactJS as frontend being served on Django server (127.0.0.1:8000) by putting frontend folder inside backend folder and using static files with path to build/static of frontend in settings.py. So I'm able to run reactjs app on localhost:8000. That's fine.
Now question is if it's possible to dockerize only Django backend, which will have everything including frontend contents and run single docker container opening react js app? Or shall I dockerize frontend as well separately?
Looking forward to your inputs.
Regards
Please note that I've also done with both backend and frontend running separately on 2 servers (localhost:8000 and localhost:3000), used docker-compose to build 2 dockerfiles and them talking each other. So my above q is about possibility to dockerize only backend as a single container image which has frontend static files inside.
I have a Django aplication (+REST framework) with pluggable Django apps (which are discovered using distutils' entry points, and can be developed independetly from each other, and installed via pip). This works well so far.
The main app should provide a basic index.html which dynamically loads React components, and each app should be possible to add React components as plugins, which are combined on the frontend then.
But: How the heck am I supposed to place my client directories into each app, so that they are found for collecting all the static files?
Should I put a react app into /my-app1/client and /my-app2/client?
my-application/
core-app/
client/
react files etc
static/
models.py
...
plugin-app1/
client/
react files etc
static/
models.py
...
And tell Webpack/brunch/whatever to compile all the css/js etc files into /my-app1/static, followed by ./manage.py collectstatic then?
Is there a better approach to collect distributed react "plugin" in dfferent Django apps into one static directory?
Can brunch.io do this? Webpack? Another? Own script?
It would be nice to have something like brunch watch - to have hot-updated all changed files instantly. This works for one directory, but not for a distributed net of plugin directories, right?
Or is this completely thought wrong? Please help.
I am planning on moving from "EmberJS" to the Ember-cli, though I have a small problem. Is it possible only to run file watcher instead of serving/using ember serve that will run local server? As I am running my PHP backend on the Google App Script I have already a local python HTTP server running in localhost:8080 I do not need another one to run in localhost:4200
If I don't run ember serve my local changes in development environment wont get updated. Is there a better way of doing this? Is it possible to use assets in the app folder when running in development environment? and use dist folder for staging/live environments?
As mentioned in the guide, you can use the build command with the --watch flag.
ember build --watch
That will keep rebuilding your changes but not actually run the server.
As for your second question:
Is it possible to use assets in the app folder when running in development environment? and use dist folder for staging/live environments?
I don't believe so. You can change the output-path property in your .ember-cli config file, but you can't have one that's specific to a certain environment. You could always write a quick script to move the files though. :)