Rup
Hey I need help I am new to django. Working on crud application. Yesterday I completed create. I created a database . But today I opened it it's showing error.
Rup
I opened pycharm. My project was open. I run the command python manage.py runserver
Faisal
Error type
Rup
Not found:/ favicon.ico
Full stack developer (React, Django)
def save(self, *args, **kwargs): if not self.id: # Only set the slug when the object is created. # Or whatever you want the slug to use self.slug = slugify(self.pname) super(products, self).save(*args, **kwargs) CAN ANYONE PLEASE EXPLAIN ME THIS super(products, self).save(*args, **kwargs) , that how its working
mr.INSOMNIA
Go to an inherited class and find it out by yourself
Bhashkar
Hey on production should we install uWSGI globally or in virtualenv ?
Ak
When I use min aggregate function, it gives value in string. How I convert it to the integer?
Не выходи из комнаты.
Hi. I'm use dramatiq as background framework. But I get error when run worker django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. Why? https://stackoverflow.com/questions/65455768
mukul
Int(value)
Sometimes it not work use Int(float(value))
No Name 😎🙍‍♂
nginx or apache which one is better for django project?
Mirco
nginx or apache which one is better for django project?
Whatever you are more comfortable with
mr.INSOMNIA
nginx or apache which one is better for django project?
Personally I use nginx. Choose whatever u want. But If u are going to set up i2p or tor website, use nginx, cuz apache is not secure for such purposes
Не выходи из комнаты.
Mirco
https://dramatiq.io/motivation.html
You can use Django Q to have the same reasons of dramatiq
Не выходи из комнаты.
I want to use dramatiq
Mirco
I want to use dramatiq
https://github.com/Bogdanp/django_dramatiq This one should make your life easier But honestly I strongly discourage you to use something not "mature" in production envs using Django You won't able to find the help that you can find with a more mature solution
learner
I have django model which has column STATUS. i want the count of Complete status. I am using ListView to display all the data but in summary I can't display Completed count. Someone please help. Thanks in advance
Mirco
So something like YourModel.objects.filter(status="complete").count() You can also create a custom manager or custom queryset to retrieve the completed ones and using an Enum for the status field
Anonymous
anyone has Mastering Django book??
Anonymous
Is anyone interested to help me .. actually I have designed daily investment site in django.. everything is working fine but I want to add one extra thing which is (Total invested ) which takes values of my amount and add them and show in index.html page... Will anyone help me pls
Anonymous
anyone has Mastering Django book??
Please if anyone has this DM me
Mirco
Please if anyone has this DM me
We don't support piracy, buy that book if you want it
Mirco
If you keep asking, the exit door is very close to u
Remy
Anyone knows how to setup swagger with DRF?
Mirco
Anyone knows how to setup swagger with DRF?
Use drf-yasg package and follow its documentation
Remy
Use drf-yasg package and follow its documentation
there's also the "native" way of handling it in DRF documentation, using get_schema_view
Remy
tho it doesn't return every endpoints
Mirco
there's also the "native" way of handling it in DRF documentation, using get_schema_view
Yup, but use drf-yasg to have Swagger and ReDoc automatically The built-in is not ready yet
Remy
ok let me try that
Remy
👍🏻
works awesome : )
Remy
thanks
Doragonsureiyā
works awesome : )
You're welcome! 😊
Hamidreza
how can we create a user outsite the Django Project create with like SqlAlchemy in another script? user = User.objects.create_user( username = 'nancy', password = 'opensesame', email = 'nancy@nancy.com' ) user.save() with insert a new row with this values in sqlalchemy dose not work
No Name 😎🙍‍♂
Mirco
Use @python
Hamidreza
Mirco
but realeted to Django
It's not related to Django, you specified that it's outside Django
Mirco
learner
So something like YourModel.objects.filter(status="complete").count() You can also create a custom manager or custom queryset to retrieve the completed ones and using an Enum for the status field
I used class based List View with context_object_name='model_context_name.' As you suggested, I created a new method in that class with return as self.model.objects.filter(status=compete).count() but I am not getting anything. In HTML i am using {{model_context_name. method_name}}. I am not getting what is wrong?
Faisal
Why
Nginx have good features
Mirco
Share via pastebin the file tree
learner
Share the code via pastebin
https://pastebin.com/PAtdSWrZ
Mirco
Yup, that was my idea It's the main reason of not collecting tests
Mirco
https://pastebin.com/PAtdSWrZ
Ok you are missing something You cannot use the context name to call a method inside the ListView
Mirco
The model context name is just a preferable way to identify the queryset but inside the template you need to loop over it Second thing is that you need to use context to pass to your template the count
Mirco
Spend more time to understand how Django views and template work, it's strongly recommended
Maltapopoulos 🇲🇹
Hello, I have a Django project but I don't use views.py do you think it is a good idea?
learner
Spend more time to understand how Django views and template work, it's strongly recommended
I just started to work on django. I'll definitely try to enhance my knowledge. Thanks for help.
Shreehari
Hello, I have a Django project but I don't use views.py do you think it is a good idea?
You have to follow certain rules recommend by django. hence No. If you are trying to build some really lightweight stuffs, then go for fastapi or flask.
Anonymous
hello django message how can I solve the storage fallback error please help?
Maltapopoulos 🇲🇹
I want to know the reason
Actually, I don't need to use views because I use graphQL
Mirco
Mirco
Actually, I don't need to use views because I use graphQL
You are confusing things, even if you use GraphQL you need views
Maltapopoulos 🇲🇹
Mirco
No because I am using schema
And ? Django works with views, you need views.
Maltapopoulos 🇲🇹
And ? Django works with views, you need views.
For the front I am using React.js
Mirco
For the front I am using React.js
It does not matter If you map a url in Django, you need a view
Vikas Singh
How I learn ds & alogo python
Maltapopoulos 🇲🇹
It does not matter If you map a url in Django, you need a view
No because I only use graphql in my urls.py
Vikas Singh
??