NoBoDy
Hi. I need a bit of help with my django project. Can not make the edit and delete button to work for a booking website. Thanks in advance
there is no code or anything about ur problem brother how we can help? https://stackoverflow.com/help/how-to-ask
alex
You are right. But can not provide all the code here.
ȺʍìɾⱮօհąʍʍąժ
You are right. But can not provide all the code here.
U don't need to provide all your code here. Just send your error or anything else
alex
I have the error 404 ( not found) when i clock on the edit booking. I checked the view, url, and the html file seems to be ok. I ask chat gpt too but still nothing works.
ȺʍìɾⱮօհąʍʍąժ
I have the error 404 ( not found) when i clock on the edit booking. I checked the view, url, and the html file seems to be ok. I ask chat gpt too but still nothing works.
When you get the error 404, that means Django cannot find the path. So, it is most likely that you provided the wrong path (You made a mistake in views.py or urls.py). check it again. If you upload your code ( urls.py & views.py) somewhere and send them here, along with a screenshot of your errors, it can help me assist you better
RZ
Hello, I have django configured so that the timezone is UTC, but does anyone know of a way for the dates in the django administration to be displayed and managed according to the timezone of the authenticated user's location at that moment? I've searched for information but can't find a clear answer to this.
Anonymous
You have to add %static% in your html code
I have added... It's been running successfully in port 5000 but some css issues on port 8000
Anonymous
I have added... It's been running successfully in port 5000 but some css issues on port 8000
The issue you're encountering might be related to the way Django serves static files in development mode. When you run python manage.py runserver, Django's development server is started, and it serves static files (like CSS, JavaScript, and images) in development mode using a built-in static file server. By default, Django uses a different port (8000) when you don't specify a port number explicitly. When you run your Django application on port 4000, it works fine because Django's static file server correctly serves the CSS file along with your HTML. However, when you run it on port 8000, you may encounter issues because the static file server might not be configured properly or might not be running. To resolve this issue, make sure you have properly configured Django to serve static files in your development environment. You need to ensure that the STATIC_URL and STATIC_ROOT settings are correctly configured in your Django settings file (settings.py). Additionally, make sure you have run python manage.py collectstatic to collect static files into the directory specified by STATIC_ROOT. After ensuring that the static files are properly configured and collected, try running your Django application on port 8000 again, and the CSS errors should be resolved.
Anonymous
Chat gpt answer for this
Kamronbek
hello I had a question. What is the difference between ManyToMany relationship and relationship created by adding a third model connecting 2 models? for example movie and genre. What's the difference between doing a direct ManyToMany of these and a 3rd model named MovieGenre that gets their ids (also related_name)? thanks in advance.
.
hello I had a question. What is the difference between ManyToMany relationship and relationship created by adding a third model connecting 2 models? for example movie and genre. What's the difference between doing a direct ManyToMany of these and a 3rd model named MovieGenre that gets their ids (also related_name)? thanks in advance.
Using a third model, you can add extra information about the association. For example, what if you want add a description as to why that genre is associated with the movie. Where would you store this “description” field? With only MTM, there isn’t a place for it. That’s when you consider adding a 3rd model to store this extra information. Hope that helps.
vaishnav
hello i have a doubt how to apply multiple user login in a django project like in a real estate project there will be a user and seller so they should have different login and also different pages, if anyone knows please replay im tired of it
Maxim
i want two users in my project a customer and a seller how can i do it
https://www.google.com/search?q=django+user+roles
Charly
i want two users in my project a customer and a seller how can i do it
No need to add two different kind of users just use a group
Charly
can u explain please
https://docs.djangoproject.com/en/5.0/topics/auth/default/#groups
NoBoDy
can u explain please
https://medium.com/djangotube/django-roles-groups-and-permissions-introduction-a54d1070544
vaishnav
thank u
Rose
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://dpaste.org - https://hastebin.com - https://nekobin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
Nana
Ok
Nana
My project can't load static files from the my app directory.
Charly
Locally or using a production server
Nana
Local server
Mrigank
Can someone suggest me a YouTube link to understand how to optimise django APIs using select related
D🌷
hello everyone
D🌷
base.html Request Method: GET Request URL: http://127.0.0.1:8000/home/ Django Version: 5.0.4 Exception Type: TemplateDoesNotExist Exception Value: base.html Exception Location: C:\Users\Fenix_Systems®\Desktop\lesson\myvenv\Lib\site-packages\django\template\backends\django.py, line 84, in reraise Raised during: blog.views.home Python Executable: C:\Users\Fenix_Systems®\Desktop\lesson\myvenv\Scripts\python.exe Python Version: 3.12.0 Python Path: ['C:\\Users\\Fenix_Systems®\\Desktop\\lesson', 'C:\\Users\\Fenix_Systems®\\AppData\\Local\\Programs\\Python\\Python312\\python312.zip', 'C:\\Users\\Fenix_Systems®\\AppData\\Local\\Programs\\Python\\Python312\\DLLs', 'C:\\Users\\Fenix_Systems®\\AppData\\Local\\Programs\\Python\\Python312\\Lib', 'C:\\Users\\Fenix_Systems®\\AppData\\Local\\Programs\\Python\\Python312', 'C:\\Users\\Fenix_Systems®\\Desktop\\lesson\\myvenv', 'C:\\Users\\Fenix_Systems®\\Desktop\\lesson\\myvenv\\Lib\\site-packages'] Server time: Sat, 06 Apr 2024 13:12:58 +0500 this error i don't understand
D🌷
Yes
𝔽ɛx-ꜱɪɴ
Yes
What is your templates directory location inside app or inside project?
Rose
Reported Clara [7002881163] to admins.​​​​​​​​​​​​​
Rose
Another one bites the dust...! Banned Clara. Reason: spam
Muhammadqodir
Hi I want to loaddata to postgrres from .sql file, what should I do
NoBoDy
Hi I want to loaddata to postgrres from .sql file, what should I do
https://www.google.com/search?q=how+to+import+.Sql+file+into+Postgres
Muhammadqodir
https://www.google.com/search?q=how+to+import+.Sql+file+into+Postgres
i asked from chat gpt, searching from google for 2 hours, I found but not loading
NoBoDy
i asked from chat gpt, searching from google for 2 hours, I found but not loading
so I guess it will be better to send what command you run or what error you get :)
Muhammadqodir
sqlite3 db.sqlite3 .dump > sqlite_dump.sql sudo -u bordo_new psql -d bordo_new \i sqlite_dump.sql I typed them psql:sqlite_dump.sql:3595: ERROR: current transaction is aborted, commands ignored until end of transaction block this error is returning
Muhammadqodir
1. This is not about loading data 2. is not PostgresSQL. It's the sqlite!
I dumped data from sqlite, and want to load to postgres
Brook
I dumped data from sqlite, and want to load to postgres
If it's proving hard, you could convert data to csv from sqlite and then write that into postgres
Aida
Django i18n When I run this command "django-admin compilemessages" I get this response File “L:\Back-end\env\Lib\site-packages\django\contrib\admin\locale\he\LC_MESSAGES\django.po” is already compiled and up to date. File “L:\Back-end\env\Lib\site-packages\django\contrib\admin\locale\he\LC_MESSAGES\djangojs.po” is already compiled and up to date. File “L:\Back-end\env\Lib\site-packages\django\contrib\admin\locale\kk\LC_MESSAGES\django.po” is already compiled and up to date. File “L:\Back-end\env\Lib\site-packages\django\contrib\admin\locale\kk\LC_MESSAGES\djangojs.po” is already compiled and up to date. File “L:\Back-end\env\Lib\site-packages\django\contrib\admin\locale\ky\LC_MESSAGES\django.po” is already compiled and up to date. File “L:\Back-end\env\Lib\site-packages\django\contrib\admin\locale\ky\LC_MESSAGES\djangojs.po” is already compiled and up to date. translation doesn't work Why?
Aida
I don't see any errors 🤔
I didn't say it's error It's not working
Eduardo
I didn't say it's error It's not working
You can't transfer directly because while the dump is SQL valid the schema is different between SQLite and PostgreSQL. You can try this https://m.ichael.dk/post/converting-sqlite3-to-postgres/
Eduardo
or this other option with Django https://hevodata.com/learn/sqlite-to-postgresql
Junior
guys how i can remove the flash message to default in forms?
Junior
because i am using alert to display message, but show the flash message too
Junior
i wanna remove this flash
Eduardo
The only pair of DBMS is possible to transfer DBs without too many issues is MySQL - MariaDB, because they're still mostly the same. In other cases the conversion is going to require more steps to adapt the DB between different systems
Of course
Hello I'm using Cloudflare to deploy django on ubuntu server with nginx and gunicorn But now it gives 403 forbidden error to my static files How can I solve that please help me
Olloyor M
yes
Of course
yes
Don't work same error
Charly
Don't work same error
What exactly you done?
Rose
Hello I'm using Cloudflare to deploy django on ubuntu server with nginx and gunicorn But now it gives 403 forbidden error to my static files How can I solve that please help me
This is not a Django specific question, please delete your offtopic message. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Of course
What exactly you done?
Chown -R 755 /path/to/static
Of course
What exactly you done?
And Chown -R user:user /path/to/static But again that doesn't work
Charly
Chown -R 755 /path/to/static
Is that even possible on cloud flare?
Of course
Is that even possible on cloud flare?
Yes but I check firewall rules that I don't have any rules
S
I am using django apscheduler , But everytime I run server it creates two job instead of one Any solution I m facing this problem on production server, There is solution for local but not server , Any solution will be appreciated
S
There is a library called django-apscheduler For scheduling task for future But at the time of command Python manage.py runserver Django load the sever two time one when code changes is detect and one for deployment This schedule task two time I only want to schedule a task once
Mahii
Hello friends, can you please introduce me the best Django training course that is project oriented?
Rose
User Neda_sh387 has 1/3 warnings; be careful! Reason: useless "good morning" at 10pm
Rose
User Lohith has 1/3 warnings; be careful! Reason: this not a job board and is only for Django
Rose
Hello friends, can you please introduce me the best Django training course that is project oriented?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial (https://docs.djangoproject.com/en/dev/intro/tutorial01/) * Tutorial from MDN (https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django) * Tutorial from django-girls (https://tutorial.djangogirls.org/en/)
amira
how can i costumize ( how it looks ) the django default admin interface ps : i used bootstrap theme but didn't know how to edit it .. it was crowded of features and removing one by one from the html file was complicated... is there an other way
Hariom
Hey how I can start as fresh?