We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I wanted to change the port to 5174 instead of its standard at 5173. I have updated the change in my settings.py by adding this line
DJANGO_VITE_DEV_SERVER_PORT =5174
then in vite.config.js I have updated the server port to 5174 as below
import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import { resolve } from 'path' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], root: resolve('./assets/'), base: '/static/', server: { host: 'localhost', port: 5174, open: false, watch: { usePolling: true, disableGlobbing: false, }, }, resolve: { extensions: ['.js', '.json', '.jsx', '.ts', '.tsx'], }, build: { outDir: resolve('./static/dist'), assetsDir: '', manifest: true, emptyOutDir: true, target: 'es2015', rollupOptions: { input: { main: resolve('./assets/js/main.jsx'), }, output: { chunkFileNames: undefined, }, }, }, })
In my template I found that vite_asset is still pointing to 5173 instead of 5174. Below is my template.html
{% extends 'baseTemplate.html' %} {% load static %} {% load django_vite %} {% block head %} {% vite_hmr_client %} {% vite_react_refresh %} {% endblock %} {% block content %} {% include 'mainViewNavbar.html' %} <div class="bg-sky-100"> <div id="dissolution_plot"></div> </div> {% endblock %} {% block script %} {% vite_asset 'js/main.jsx' %} {% endblock %}
the source code snippet from the rendered page shows
where I am expecting port 5174 as below
I have tried to restart both my django and vite servers and also cleared the cookies, but with the same result. My django-vite is version 3.0.4.
The text was updated successfully, but these errors were encountered:
Hi,
Since you are in the latest version of django-vite can you use the new way of defining settings (https://github.com/MrBin99/django-vite?tab=readme-ov-file#configuration) as this way will be deprecated at some point.
If it still doesn't work please let me know.
Sorry, something went wrong.
No branches or pull requests
I wanted to change the port to 5174 instead of its standard at 5173. I have updated the change in my settings.py by adding this line
DJANGO_VITE_DEV_SERVER_PORT =5174
then in vite.config.js I have updated the server port to 5174 as below
In my template I found that vite_asset is still pointing to 5173 instead of 5174. Below is my template.html
the source code snippet from the rendered page shows
<script type="module" src="http://localhost:5173/static/js/main.jsx"></script>where I am expecting port 5174 as below
<script type="module" src="http://localhost:5174/static/js/main.jsx"></script>I have tried to restart both my django and vite servers and also cleared the cookies, but with the same result. My django-vite is version 3.0.4.
The text was updated successfully, but these errors were encountered: