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
Doragonsureiyā
Madara uchiha
Hi is django celery email is better to be used or we should refer custom code by using celery and beat
Nasrullah
JigarThanda ☀️
Евгений
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'))
Charly
سلمىٰ
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
سلمىٰ
سلمىٰ
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
cj
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"
Siddharth
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) ?
ENOCH
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
cj
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 ... ¯\_(ツ)_/¯
Andrew
cj
maybe you're mixing things with env variables to set a database, make a double check on that
Andrew
Kartos
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
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',
}
}
cj
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
cj
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
Andrew
Okay, thanks
handgull
Someone can help me i have a problem with the admin panel css in production
cj
handgull
cj
read the docs completely, not just the parts "you think" you only need
handgull
devmie
handgull
yea, in the entrypoint.sh (docker)
cj
cj
handgull
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/
Omar
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.
Omar
null
Tadj Mahal