Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,149,980 members, 7,806,860 topics. Date: Wednesday, 24 April 2024 at 04:46 AM

I Need Help With Django - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / I Need Help With Django (998 Views)

[Day 1] Thrift Collector(esusu) API In Seven Days With Django / Built A To-do-list Web App With Django And Bootstrap. / Learn How To Build A Realtime Chat Application With Django, Rabbitmq And Vue.js (2) (3) (4)

(1) (Reply) (Go Down)

I Need Help With Django by babajeje123(m): 5:08pm On Feb 12, 2022
I'm currently learning Django for web development and I can't resolve the following error that I have spent days on in resolving. Please check my codes here https://github.com/abbeykk/my-first-blog

I need help urgently as this is the project they gave me where I am doing my internship.

1 Share

Re: I Need Help With Django by Aifedayo(m): 6:39pm On Feb 12, 2022
Although I couldn't fine the post_detail in your code

However, do it like this:

"{'pk': ' '}"

You shouldn't use single string followed by another single string

2 Likes

Re: I Need Help With Django by ichidodo: 12:19pm On Feb 13, 2022
Guy, you go suffer well well.. Haha.
Re: I Need Help With Django by flam5: 9:41pm On Feb 13, 2022
You need to do the below:
1. Create a detail view with either pk or slug parameter e.g
def post_details(request, slug):
#input your code

2. Use get_absolute_url() method in your template to link to specific post. In your models.py input the class method get_absolute_url() and pass in the argument based on the parameter you used (slug) in your post_details view.

3. Set the path in your urls.py e.g path('details/<slug:slug>/', .........)

4. Your template will look like
<a href = "{{post.get_absolute_url}}"> {{post.title}} </a>

Note: I didn't use pk because it's not a recommended practice for security reasons.
Re: I Need Help With Django by adelnehis(m): 9:59pm On Feb 13, 2022
babajeje123:
I'm currently learning Django for web development and I can't resolve the following error that I have spent days on in resolving. Please check my codes here https://github.com/abbeykk/my-first-blog

I need help urgently as this is the project they gave me where I am doing my internship.


Your git is incomplete
Re: I Need Help With Django by bedfordng(m): 7:44pm On Feb 14, 2022
Like someone said, your git is incomplete. You did not add the file that is causing the error.

From the look of things . It seems the error is coming from the post id . Probably you did not properly include the post id in your URL patterns or in view def request function.

Try not to use the dictionary keyword argument in your URL patterns . Instead use the conventional method .example

path("post_details/<int:post_id>/",.........)

def post_details(request, post_id):

If you can screenshot the code for this , it would be helpful to analyze.

1 Like

Re: I Need Help With Django by 1saed: 8:11pm On Feb 14, 2022
Hi

Welcome to django.


You shared ur page view error without sharing ur code in views.py , template, forms.py and all


It might be difficult to provide a solution by the scant info u shared.



Another thing is this
. if you are serious and zealous to learn web dev, a mentor is inevitable,
Is that clear
?



Imagine the man hour you are loosing waiting for a professional who will fix this for you?

Just imagine




With That same amount of time....the project would have been concluded.


So



Ur next drive would be to get a mentor.


Here are a few of my projects, hosted on Pythonanywhere

Schapp.pythonanywhere.com



I can mentor u, if u want


Thank you

1 Like

Re: I Need Help With Django by babajeje123(m): 9:55pm On Feb 14, 2022
Thank you all for trying to help. I am a learner and what I am doing is actually a project given to me where I am doing my internship. I have wasted a lot of time and working behind schedule.

I have uploaded the folder that contains my project on google drive and here is the link
https://drive.google.com/drive/folders/1Q_3mjl6GDzYYSNlk02WNyx1qRYn4rtwW?usp=sharing

Please help me out!!!
Re: I Need Help With Django by babajeje123(m): 9:56pm On Feb 14, 2022
1saed:
Hi

Welcome to django.


You shared ur page view error without sharing ur code in views.py , template, forms.py and all


It might be difficult to provide a solution by the scant info u shared.



Another thing is this
. if you are serious and zealous to learn web dev, a mentor is inevitable,
Is that clear
?



Imagine the man hour you are loosing waiting for a professional who will fix this for you?

Just imagine




With That same amount of time....the project would have been concluded.


So



Ur next drive would be to get a mentor.


Here are a few of my projects, hosted on Pythonanywhere

Schapp.pythonanywhere.com



I can mentor u, if u want


Thank you
Why won't I be serious and zealous. I'm calling you right away.
Re: I Need Help With Django by dodgelord: 2:56pm On Aug 22, 2022
babajeje123:



Re: My Advice To Seun On How To Improve Nairaland Programming Section by babajeje123(m): 5:54am On Oct 31, 2017
in as much as I don't support Seun's non-challant attitude towards this section, I think those who are advising him should build their own platforms using all the loopholes they've found here. They can even form a partnership if it would be difficult on individual basis. Oga dhtml, how far above africoder or what's the name?


Seun site still better pass he site with all his mouth making. Dhtml

Re: I Need Help With Django by Jagaban50: 5:53am On Aug 24, 2022
1saed:
Hi

Welcome to django.


You shared ur page view error without sharing ur code in views.py , template, forms.py and all


It might be difficult to provide a solution by the scant info u shared.



Another thing is this
. if you are serious and zealous to learn web dev, a mentor is inevitable,
Is that clear
?



Imagine the man hour you are loosing waiting for a professional who will fix this for you?

Just imagine




With That same amount of time....the project would have been concluded.


So



Ur next drive would be to get a mentor.


Here are a few of my projects, hosted on Pythonanywhere

Schapp.pythonanywhere.com



I can mentor u, if u want


Thank you

Goodday sir, I just sent an Email, can u please guide me on learning web design using Django framework and can I do all my work with Django without the need to learn css and html?

I know little of python Basic, but I gave programming a break which I plan to come back to.
I actually stop at the OOP part of python
Re: I Need Help With Django by 1saed: 11:43pm On Aug 24, 2022
07031009036


Whenever its comfortable, Call me let's talk

(1) (Reply)

Medical Website With HTML, CSS And Javascript. / I Want To Invest In A Big Telecoms Project Any Ideas / Programming In Java And C++

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 22
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.