Dutchq
pythonanywhere doesnt automatically reload you have to go back to your daxhboard and click the green reload "appname" Button
I dd that already but when I checked the files they aren't same as the one committed to git
Siddharth
I dd that already but when I checked the files they aren't same as the one committed to git
try : git pull origin main git add . git commit -m "Success"
Siddharth
if any file didn't add then add it manually
Dutchq
after doing that I get server error 500 when I try to open the site. from pythonanywhere even from my local host
Meshack
You can zip the file then upload
Nithin
Which method is used to retrieve the forms data
Nithin
The data has been uploaded but how to retrieve?
Bilal
please how can i solve this problem ? Building wheel for cffi (pyproject.toml) did not run successfully. │ exit code: 1
麦当劳
on the frontend, encode the image before you send it to django
I have successfully encoded the file but now I am getting a defferent error "file [ "The type of the file couldn't be determined." ] "
阿德
So, I am trying to host a django website on hostinger , how to do it ? and is it good way ?
Dutchq
Good evening here please, I have a problem I used template tags in my HTML but nothing shows up on my website, like I use the tags to display the fields created from my database but it's just empty nothing shows just the header.
Siddharth
https://dpaste.org/wcPmM
can you shre views.py snippet ?
Dutchq
can you shre views.py snippet ?
https://dpaste.org/8cepp
Siddharth
https://dpaste.org/8cepp
See you wrote this : {% for post in posts %} but in Views you rendered : {'post':posts} so correct it and write: {% for i in post %} <article> <time>published:{{i.published_date}} </time> <h2><a href="">{{ i.title}}</a></h2> <p>{{i.text|linebreaksbr}}</p> </article> {% endfor %}
Siddharth
You have to access post not posts in your template as you renamed your dict
Siddharth
or simply you can go either way and change the views to look like: return render(request,'blog/post_list.html',{'posts':posts})
Siddharth
now with the old template it will give correct result
Dutchq
ok thanks very much let me correct it
the first one does not still display anything but the second one does but i get this error https://dpaste.org/34v9m
Dutchq
Did you migrated your models and made correct models
i did that already or am i to do that everytime i edit something ?
Siddharth
i did that already or am i to do that everytime i edit something ?
Umm I think you have not made your model correctly
Siddharth
Waoh am en more lost now
Umm I need to see all your snippet like models and forms too
Dutchq
Di
Hello everyone, I need help, prayers, wishes for success, or whatever is possible, hehehe. I have a project that was written with Python 2.7 and Django 1.6. Does anyone here have a Docker image with Python 2.7? I created a development environment and installed all the necessary packages. However, when I tried to use python2 manage.py runserver, I started receiving the message (Is it on sys.path? Is there an import error in the settings file?): No module named objects. I'm not sure where to go from this point.
Siddharth
https://dpaste.org/ACO03 for models.py
Send models snippet, this is views.py
Di
hehehe
Siddharth
hehehe
Is there any reason for using very old versions
Di
legacy project, maintenance needed
Siddharth
legacy project, maintenance needed
You should upgrade now, will be more beneficial and easy to use latest libs
Dutchq
Send models snippet, this is views.py
https://dpaste.org/8vhQz views.py
Siddharth
https://dpaste.org/8vhQz views.py
Bro you again sending same snippet
Siddharth
I need models.py not views
Dutchq
I need models.py not views
https://dpaste.org/CU9Nb models.py
Siddharth
https://dpaste.org/CU9Nb models.py
Why deleted your template and views snippet send again
Dutchq
Why deleted your template and views snippet send again
https://dpaste.org/3Xzpf models.py, views.py and template
Siddharth
https://dpaste.org/3Xzpf models.py, views.py and template
you still doing same mistake correct it
Siddharth
{'post':posts} don't reder this use this : {'posts':posts}
Sai
Any one has any django real time projects?
Doragonsureiyā
Any one has any django real time projects?
Don't ask meta questions like: - Any user of $x here? - Anyone used technology $y? - Hello, I need help on $z! Just ask directly! The better you are at explaining the problem, the more likely you are to get help. If you don't know what that means, read Asking Smart Questions.
Siddharth
Maxim
Any one has any django real time projects?
this is neither a job board nor a bulletin board, nor a project sharing group
Siddharth
When I do this there is an error
hmm , is your code available on github ?
Siddharth
Yes
sen me link
Maxim
Any one has any django real time projects?
https://t.me/django/263184?thread=263184
Dutchq
sen me link
https://github.com/bonsuAyuk/my_first_blog
Siddharth
i got your issue lemme send you a image in dm
Siddharth
https://github.com/bonsuAyuk/my_first_blog
actually u didn't have existing data present in your database so you should insert some data first through shell, admin or make interface to insert data then it will be visible to you
Dutchq
Thanks very much
Jqffgjhxxjkkj
Hello guys, how would I work with data from two databases for crud operations. Postgresql for user feeds and comments and Mariadb for user profile, users table etc.
Jqffgjhxxjkkj
Btw you can do both work in one only
Even if it's a microservice architecture?
Charly
Even if it's a microservice architecture?
Ina microservice architecture you should not access to diferent databases
Lalit
I have done static_url=cloudfront link Now django administrator page css is not loading How to resolve this?
HARILAL
Try collect static command https://docs.djangoproject.com/en/5.0/ref/contrib/staticfiles/#top
Lalit
I have done static_url='static', and media_url= cloudfront link And passing the media url through context. And using it like <img src='{{media_url}}media/img.png'> By doing this taking more time to reload
Lalit
Cloudfront link has only media. How can I do without including on static
Tg
how to solve this error/AUTH_USER_MODEL refers to model 'directory.CustomUser' that has not been installed
Igor
Hello, We are currently struggling with a strange problem of running migrations in the gitlab-ci to create a test database The project has approximately 1000-1500 migrations. Everything runs well until the command "migrate" finishes execution and we proceed to the next command of the pipeline When this happens, the tables magically disappear from the database Is there any hidden behaviour of the "migrate" that can cause this situation? Does Django drop tables when some conditions are met after the command execution, or is this impossible?
Igor
Please, also note, that the tables are really being created We connected to the database where the command should create the tables, and it actually shows us their presence during the execution Are there any environmental variables that should be taken into the account, project-specific settings, or something else, that might be not so well documented and cause the issue?
Igor
Each and every single table ? Hope you need to check out migrations file only, any one of the migrations file might delete the tables. Otherwise it should be the commands running in the ci-cd pipeline. Check log files of the DB you are using, it should have which query has deleting those.
Yes. Though, now we've found a solution. It is - to apply the migrations partially. So we've split the migrations onto 5 more-less equal blocks and then at least some tables started to be created Now the problem is, with the verbosity=3 enabled, we're probably having a one more error: psycopg2.errors.StringDataRightTruncation: value too long for type character varying(50) that happens somewhere deep inside django framework during the Running post-migrate handlers for application <...>
Igor
Most probably this was the reason for the migrations not to be created, though it also looks like we've exceeded some Django default limits with naming of classes, fields, or whatever else The exception, unfortunately, does not give any hints on the reasons behind it
DeathLikeSilence
hello everyone how can I create multiple user to authenticate In my project I have company, employees, and manager So for login I want to use JWT or Token for authenticate
Bekzod
hello everyone how can I create multiple user to authenticate In my project I have company, employees, and manager So for login I want to use JWT or Token for authenticate
you should create one auth user model and company, employees, manager models connect to user model with OneToOne relationship. JWT token create for one user, then company or others can login with user token. So models structure related your project logic