Adilet
Thanks in advance
Mirco
Hi everybody. How can I set a new path for FileField of model? Without uploading a file to memory.
You should use upload_to attribute by passing a function where you can choose the path
Yuvi
Using django how to reduce camera size
𝔐𝔞𝔥𝔡𝔦 𝔉𝔦𝔯𝔬𝔲𝔷𝔧𝔞𝔥
hi, is there anyone could help me report an small bug to django-team?
Igor
Pycharm is really good espesially considering that fact that you can work with database in pycharm. But prof version is costs money...
Ghorz
hi, is there anyone could help me report an small bug to django-team?
I discovered a serious bug with Model with image field in Admin page. Once you submit, you get a 404. That when django is hosted on cpanel shared hosting. I had to make a fix for it to work. Issues in v2+ to 3+
Eguakhide
You can pass the context in form of a dictionary if you want to utilise some parts of it. return redirect('/<your urlpath>/',{'key':value,'key1':value1}
Hello Singh, thanks so much for the reply, yeah i can do this but i am trying to pass a complete Model Object. Is this possible too?
Omair
Hello Singh, thanks so much for the reply, yeah i can do this but i am trying to pass a complete Model Object. Is this possible too?
No you cannot do that. AFAIU you can only pass strings among views. You can try to pass a python object as a string and use eval on it in your redirected view but I wouldn't recommend doing something like that. What Singh suggested is the right way to go forward. The key-value pair can contain the primary-key of the model object which you should use in your redirected view to *get* the model object instance.
Ayush
What's the best resource to learn Django
Dheeraj
I think the best resource is the Django Documentation
Anonymous
My most of the concepts got cleared from there
AMIT
Hi guys in organization's which tool are you people using for django software..
Werner
how to add overhead?
H
Hello people!!
H
How can I deploy my django project having postgres database
H
On heroku
Anonymous
Good day everyone, please I am creating a django site that gonna shows each student recorded scores from Day 1 to Day 10 in an HTML table. I want to be able to add students scores of each day from my admin dashboard and it gonna display in template. I've created Model for Student and Result and I need more information especially the business logic to achieve this. Thank you
Aditya
Hello Singh, thanks so much for the reply, yeah i can do this but i am trying to pass a complete Model Object. Is this possible too?
Yes, its possible! you can pass model object,its a good practise to check the object is not returning None
Aditya
Just make sure to wrap it in a dictionary eg. dict_object={'model_key': ModelObject} return redirect('/<your urlpath>/',dict_object)
Aditya
Good day everyone, please I am creating a django site that gonna shows each student recorded scores from Day 1 to Day 10 in an HTML table. I want to be able to add students scores of each day from my admin dashboard and it gonna display in template. I've created Model for Student and Result and I need more information especially the business logic to achieve this. Thank you
Your business logic will sit in views.py so you might need to do the below: 1. Define a function based view accepting your requests in views.py eg. def my_view(request, *args, **kwargs): #business logic here 2. define a url to acces this view. eg. urlpatterns = [ path('', views.my_view,name='student_scores'),] 3. update your main urls to include urls from step2
Aditya
for your business logic you will need to 1. import your model 2. get the records from model using the filter of selected student or according to your use case 3. prepare a dictionary to get all the results 4. pass the same in the response with the context using render function with the designed template.
David
how to get object.id ? i mean django's inner id that is not defined in model but exists by default?
Aditya
how to get object.id ? i mean django's inner id that is not defined in model but exists by default?
its access the same way any other property on the model is accessed. but make sure you have only one result from the query set else it might give you error.
David
oh ive just missed [:1]
Eguakhide
🙏
🙏
Aditya
oh ive just missed [:1]
We all do miss things at some points 😅.. and we learn
Ibrahim
Learn Python, R, SQL, Data Visualization, Data Analysis & Machine Learning. Build a Portfolio. In-Browser Exercises. Instant Feedback. Career Coaching etc Paths: Data Analyst in R Data Analyst in Python Data Scientists in Python Data Engineer Dataquest teaches you the right skills, and helps you build a portfolio of projects along the way. As we've built the site, we've learned quite a few lessons on how to most effectively help our students. We've been gradually increasing the scope of our initial vision. For a limited time, get 50% OFF 1 year of Premium! signup, goto account and select type, upgrade Note: 50%off only applied for 1year premium subscriptions, hurry before offer end soon. sign-up here -> bit,ly/35lwxcP : change , to .
M
getting this warning message ?: (2_0.W001) Your URL pattern 'alerts/(?<site>(\d+))$' [name='alerts'] has a route that contains '(?P<', begins with a '^', or ends with a '$'. This was likely an oversight when migrating to django.urls.path().any suggestion how to correct it
M
path('alerts/(?<site>(\d+))$', views.alerts,name='alerts'), is my urls.py
EscanOr
Where can I find the language code of all supported languages by django I'm particularly looking language hindi
Vedant
When I am running manage.py sqlmigrate with the arguments I'm getting the queries for the table to be created but the last line doesn't have COMMIT in it and the table is not being created. What am I doing wrong?
Anonymous
So I was exploring the Django GitHub repo, and I got interested in understanding the core implementation of django itself. Anyone in the group who can guide from where to start understanding the code ?
Vedant
To migrate table
Alex
To migrate table
you may pass it the lable of the app you want to migrate. Or nothing to migrate everything.
Ferrum
I have models like this class Category(models.Model): name = Model.Charfield() Class Product(model.Model): categories = Model.manytomanyfield(Category) Class StockRecord(model.Model): product = Model.ForeignKey(Product) How do I serialize name field from the category model?
M
use re_path
Do u recommend some resources on it ?
Anonymous
Hi, I am looking for a full-stack django developer based in Lahore (outside Lahore can also contact if they feel they can do the project). I have a concept of a web site that I need to make, reference will be provided. I need someone who has knowledge about e-commerce sites . I have intermediate knowledge of python, I am willing to learn and work to make this project a reality in 6 months .. Note: It's a personal project. Its not a full-time project, This will be a part-time project ,PM if interested will contact you back.
Bayarkhuu
Hi
Bayarkhuu
I need e- commerce website
Bayarkhuu
Do you create commerce site?
Mirco
Ghorz
Do you create commerce site?
Open your pc, start coding 👍
Princu
How to learn django for a python beginner
Anonymous
I need one help
Anonymous
Can anyone help me please I am facing icon image problem in django .. can anyone help me
Doragonsureiyā
How to learn django for a python beginner
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Anonymous
Share code with pastebin or similar
Actually I cannot share image in group
Anonymous
Doragonsureiyā
Actually I cannot share image in group
Read the rules before any activity: @PythonRules
Anonymous
Can anyone tell what command is required for pip install -r filename.txt for python 3.9... I m facing problem in deploying
Jon snow
a noob question, i created a new todo list web app,if i want to implement it in server,do i need to create different database,so every user can use their own todolist?
@tele123
Hey everyone I am final year student and make a project on django ecommerce website.what are questions can be asked in campus placement interview.
@tele123
Plz share your suggestions
Darya
Hi i'm working on creating a shopping car but i got stuck any one can help me????
Darya
Let me send my code i i think my code is not curect
Doragonsureiyā
Hi i'm working on creating a shopping car but i got stuck any one can help me????
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z" Just ask about your problem directly! With ~80,000 people here, the probability that someone will help is pretty high. How to ask smart questions: http://catb.org/~esr/faqs/smart-questions.html
Darya
!meta
What?
Mirco
Ok
👍🏻
Khumoyun
Hello, Who knows source for learning Django Graphql api?