Ravikumar
hiii everyone i user .gitignore ### Django ### *.log *.pot *.pyc pycache/ local_settings.py db.sqlite3 db.sqlite3-journal media pics/ file as and i am getting one problem in productions when i do migrations its shows no changes and when i did migrate also no changes and no alters in mysql tables and no new creating new tables in mysql database please anyone help me
Ravikumar
1146, "Table 'assetmgmt.AssetApp_laptophistory' doesn't exist")
Swati
is it secure to put json file of google application credentials in django app folder? if no then where they should be placed
Madara uchiha
Hi is django celery email is better to be used or we should refer custom code by using celery and beat
JigarThanda ☀️
I've tried that and didn't work, Is it possible that email verification be disabled
Show us your code where you are doing the authenticate using email and password.
Евгений
Hello! Maybe someone know answer for my problem According to the documentation I made a site map, the site is multilingual, but instead of a normal map it displays a list of url without spaces. And it does not create a version of the page for each language. sitemap.py from django.contrib.sitemaps import Sitemap from movies.models import Movies class DynamicViewSitemap(Sitemap): changefreq = 'weekly' i18n = True languages = ["en", "ru", "de", "es","pt", "fr"] alternates = True x_default = True def items(self): return Movies.objects.all() def location(self, item): return f'/movies/{item.slug}/' urls.py sitemaps = { 'dynamic': DynamicViewSitemap } urlpatterns = [ path('admin/', admin.site.urls), path('i18n/', include('django.conf.urls.i18n')), path('sitemap.xml', sitemap, {'sitemaps': sitemaps}), Result: https://wherefilmed.org/sitemap.xml
Ti
How can I join 2 tables in 2 different database?(Table A has a field that contains all of id of records in table B)
سلمىٰ
How do I solve this problem
سلمىٰ
ConnectionError at / HTTPConnectionPool(host='localhost', port=9001): Max retries exceeded with url: /?properties=%7B%27annotators%27%3A+%27pos%2Cparse%27%2C+%27outputFormat%27%3A+%27json%27%7D&pipelineLanguage=ar (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f77b8a10ca0>: Failed to establish a new connection: [Errno 61] Connection refused'))
سلمىٰ
how do I change the port?
Morteza
Or maybe the port is not allowed on the server
Charly
how do I change the port?
No, what thing are you trying to connect? that thing is the one thing you need to make sure is running
Charly
So the problem is not with the localhost connection
Django tries to connect to something on port 9001, but there is nothing running in that port
سلمىٰ
I was connected to the Stanford NLP core server
Charly
Abd Al Rhman
When integrating Django with React.js, which Authentication method do you recommend to be used?
Yazan
I need help : an example of a model that when execute the save method it sends a push notification using fcm-django I kinda did it but it never worked and no error was thrown
Abd Al Rhman
Djoser would meet the requirement?
Сергей
Djoser would meet the requirement?
You can use it, but you'll still need to explicitly setup token authentication settings in your project, e.g. in DEFAULT_AUTHENTICATION_CLASSES. Djoser docs tell about it in Authentication Backends chapter.
Didixx.sol
Good evening people. I'm making an app to record attendance, and I'm going to make it available for teachers to download the attendance list.. The students registered in the list will be those who attended in the last 10 minutes only. However, when I download the list, it is coming up with all the students. Does anyone know how to resolve? I can upload my models.py file here if needed
Didixx.sol
This is the function def gerar_pdf(request): um_dia = datetime.now() - timedelta(minutes=10) alunos = Aluno.objects.filter(data_aluno__gt=um_dia)
..
Any possibility to add custom JavaScript/css in django admin?? I want to display negative values in red. Also few more Javascript features needed in my admin section
ENOCH
hello once I begin a fresh work on Django and load the chrome browser it shows "this site can't be reached"
Wan
Please helpme, how to show image to upload to database, for seting Default = False?
Georg
hello. How can I override queryset in ManyToManyField (ManyRelatedManager) ?
pushpendra
Can anyone help me for create a layer to hit an Api by a python project
Andrew
Hi, I have one trouble, i change database from sqlie to mysql and got an error, how i can fix it? Error: unable to open database file Exception Location: var/www/u1972808/data/djangoenv/lib/python3.8/site-packages/telethon/sessions/sqlite.py, line 242, in _cursor
Andrew
One minute, I will upload it to pastebin
cj
oh wait... you're mixing it with Telethon probably you're doing something wrong in your frank-einstein
cj
and most probably, it looks like a Telethon problem, not Django itself but ... ¯\_(ツ)_/¯
cj
maybe you're mixing things with env variables to set a database, make a double check on that
Andrew
I've changed: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'u1972808_default', 'USER': 'u1972808_default', 'PASSWORD': 'eUM757mE7tTkumV5', 'HOST': 'localhost', } }
Kartos
Is there not PORT number?
Andrew
Is there not PORT number?
It's required?
Kartos
It's required?
This is the example how to set the mysql databse DATABASES = { 'default': { 'ENGINE':'django.db.backends.mysql', 'OPTIONS': { 'sql_mode': 'traditional', }, 'NAME':'shop', 'USER':'root', 'PASSWORD':'', 'HOST':'localhost', 'PORT':'3306', } }
Kartos
It's required?
I think you miss the port
cj
I think you miss the port
not really, if you don't set it manually, it will use the default one according to the db engine in use ¯\_(ツ)_/¯
cj
It's required?
no, unless you manually changed it in the DB server to another port and not using the default one
Andrew
so you don't have problem with Django, as I said it's Telethon issue, you have to check it
I have one question, exception location is: /var/www/u1972808/data/djangoenv/lib/python3.8/site-packages/telethon/sessions/sqlite.py, line 242, in _cursor But when I've tried check file sqlite.py I have another error - SFTP error #2: No such file
Andrew
then you have an issue with something else, not Django
I just can't figure out why Django is showing error in non-existent file
cj
it's complaining in the telethon library and its connection to an sqlite DB, you have to check your Telethon part of the project, Django is not complaining about anything, so, you don't have a Django-related problem
cj
I just can't figure out why Django is showing error in non-existent file
because you may have some function/view of your Django project wanting to use some function from your Telethon project, and as your Telethon project is broken, it makes your Django project to break... the guilty here is your Telethon project, not Django
Andrew
Okay, thanks
handgull
Someone can help me i have a problem with the admin panel css in production
cj
Someone can help me i have a problem with the admin panel css in production
read the documentation on how to serve static files in production
handgull
read the documentation on how to serve static files in production
Already did, i use python manage.py collectstatic
cj
Already did, i use python manage.py collectstatic
read it fully and completely, not just one command
Charly
Already did, i use python manage.py collectstatic
No but you need to set up your webserver to serve these files
cj
read the docs completely, not just the parts "you think" you only need
handgull
yea, in the entrypoint.sh (docker)
handgull
read the docs completely, not just the parts "you think" you only need
read, and i undestood that if i do a collectstatic the static files are placed in the STATIC_ROOT folder. but only that lol
handgull
ok ok solved, it was a docker related problem not django side! thanks to everyone
Tadj Mahal
Good afternoon, my friends. I have a problem with connection of base.html file. I can to connect one file with all styles with command {extend base.html}, but if i try to connect base-file with smth else files it styles not work. Maybe someone have a similiar problem? github-project link: https://github.com/Tadj-mahal/Shop/
Tadj Mahal
Are you getting any error?
I get errors in console, like this: [15/Mar/2023 19:42:06] "GET /clients/static/js/bootstrap.js HTTP/1.1" 404 2853 Not Found: /clients/static/js/custom.js
Tadj Mahal
path is correct.