Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,208,114 members, 8,001,546 topics. Date: Wednesday, 13 November 2024 at 12:06 PM |
Nairaland Forum / Science/Technology / Programming / For Django Developer (13227 Views)
Python/django Developer / CI/CD Pipeline For Django Application / Django Developer Plz Help (2) (3) (4)
(1) (2) (3) (4) (5) (6) (7) (8) (9) (Reply) (Go Down)
Re: For Django Developer by LSarcastic: 5:30pm On Jul 19, 2020 |
I believe that by 'knowledge' it's not only Django and Flask but HTML and CSS. Yes, you can call yourself a Backend developer. You'll have to prove it with projects though. Heylonmusk: 1 Like |
Re: For Django Developer by Taofeekdboy(m): 6:38pm On Jul 19, 2020 |
LSarcastic:I understand you perfectly but there are some scenarios where AbstractUser is a better approach as well and based on the example I made earlier, it is a better approach, when you are writing permissions, it is a better approach to inherit from AbstractBaseUser when you know what you are doing. Using User model directly is very tho because if things go wrong then it can be fatal. 1 Like |
Re: For Django Developer by fortifiedng: 11:44pm On Jul 19, 2020 |
Taofeekdboy: Even the Django documentation recommends you start every project inheriting from AbstractUser. E get why. 1 Like |
Re: For Django Developer by LSarcastic: 11:49pm On Jul 23, 2020 |
You've got a solid point man. Taofeekdboy: |
Re: For Django Developer by teamoneline: 9:47pm On Jul 30, 2020 |
Are there jobs for django in nigeria at all? |
Re: For Django Developer by Taofeekdboy(m): 5:33am On Jul 31, 2020 |
teamoneline:If there is, it will be few because most request for PHP, C# e.t.c but foreign companies do use django |
Re: For Django Developer by hitan(m): 12:10pm On Jul 31, 2020 |
Hello guys i am building a django web app, and i run into this error..... NoReverseMatch at /groups/posts/in/python/ Reverse for 'user-posts' with keyword arguments '{'username': ''}' not found. 1 pattern(s) tried: ['user/(?P<username>[^/]+)$'] below is the sample of the template HTML page <h3 class="mr-5"><a href="{% url 'posts:user-posts' username=post.user.username %}">@{{ post.user.username }}</a></h3> <div class="media-body"> <strong>{{ post.user.username }}</strong> <h5>{{ post.message_html|safe }}</h5> <time class="time"><a href="{% url 'posts:post-detail' username=post.user.username pk=post.pk %}">{{ post.created_at }}</a></time> {% if post.group %} <span class="group-name">in <a href="#">{{ post.group.name }}</a></span> {% endif %} </h5> below also is a sample of the app urls.py code path('', PostListView.as_view(), name="blog-home", path('user/<str:username>', UserPostListView.as_view(), name="user-posts", path('post/<int:pk>/', PostDetailView.as_view(), name="post-detail", And here is my views.py code that controls the username class UserPostListView(ListView): model = Post template_name = 'blog/user_posts.html' context_object_name = 'posts' paginate_by = 6 def get_queryset(self): user = get_object_or_404(User, username=self.kwargs.get('username')) return Post.objects.filter(author=user).order_by('-date_posted') How can I fix this, it seems the "username" is empty hence not matching the regex in urls.py? |
Re: For Django Developer by Taofeekdboy(m): 12:54pm On Jul 31, 2020 |
hitan:In your urls. py, did you add any app_name 'posts' or not, of you have not, add it and try again |
Re: For Django Developer by hitan(m): 3:29pm On Jul 31, 2020 |
Taofeekdboy:Please I would like to know why adding an app name in the urls.py would have that effect on the app |
Re: For Django Developer by hadamz: 4:49pm On Jul 31, 2020 |
hitan: Since you are will be calling it in the html i.e post:name of url therefore you must add create the app name. Sorry which book or tutorial video are are you using to learn? |
Re: For Django Developer by Taofeekdboy(m): 5:25pm On Jul 31, 2020 |
hitan:it is mandatory to add it because if you have more than one app in your django project, and the URL name is the same, then the URL need to match up with URL name you provide, that's why it is important to prefix it an app_name. I wish I could explain much better. |
Re: For Django Developer by hitan(m): 5:34pm On Jul 31, 2020 |
Taofeekdboy:In my groups app urls.py I did create an app name groups, so I don't know why there should be a clash, cos when I am referencing groups component using template tag I always use "groups:group_detail"... I removed app name from posts because it was giving me "namespace" error. I am using Corey Shafer tutorial on Django for the development of the web app, but I decided to add groups to the web app to make it robust |
Re: For Django Developer by hitan(m): 7:59pm On Jul 31, 2020 |
Taofeekdboy:I just did and still get the same error, please how can I resolve this issue its really giving me concern... |
Re: For Django Developer by Donpre(m): 8:21pm On Jul 31, 2020 |
hitan: did you add the app_name to your main urls.py using 'namespace' |
Re: For Django Developer by westfield: 2:31pm On Aug 01, 2020 |
Please am really in need of a hacker someone who can track someone phone 07059874837 |
Re: For Django Developer by teamoneline: 4:52pm On Aug 06, 2020 |
django tip: insert import ipdb; ipdb.set_trace() at the end of the file django identifies as the source of the error, reload the page and your browser will pause(continue loading not stopping), then go to your console. an interactive debugger will be set up, just type a variable name and hit enter, the value will be displayed. Good for debugging |
Re: For Django Developer by pixey(m): 11:08am On Aug 07, 2020 |
@Taofeekboydb,donpre and co ! Hello guys ! I am really enjoying this thread.I am also a django beginner too.I would like if we present our django issues on whatsapp or telegram group.More a like mini stackoverflow for us. |
Re: For Django Developer by Toppytek(m): 6:13pm On Aug 08, 2020 |
pixey: Did you know that you wouldn’t have come across this thread had it been it has been moved to WhatsApp? 1 Like |
Re: For Django Developer by saheedniyi22(m): 7:08pm On Aug 08, 2020 |
Toppytek:I wanted to say that too. Nairaland has the advantage of being open, so there is continuous flow of knowledge unlike whatsapp and telegram. |
Re: For Django Developer by pixey(m): 1:50pm On Aug 09, 2020 |
Toppytek: I understand you bro but dont get me wrong here .What I am saying is that we can develop a community of django devs where django related problems are resolved just like a mini stackoverflow etc.... for NL members. We don't have to use whatsapp. Just an opinion. |
Re: For Django Developer by Daejoyoung: 6:52pm On Aug 09, 2020 |
pixey:But can't all of that still be achieved on the thread? |
Re: For Django Developer by pixey(m): 11:14pm On Aug 09, 2020 |
Well like I said its just an opinion. |
Re: For Django Developer by Donpre(m): 9:28pm On Aug 12, 2020 |
Bosses them, abeg wetin be 'instance', can't find anything in the documentation about it
|
Re: For Django Developer by fortifiedng: 1:13am On Aug 13, 2020 |
Donpre: Instance there means that, when the user wants to update their profile, their previous information would be filled automatically. It's like creating an instance of what was there, before you edit it. TIP: Check the meaning of instance in the dictionary for better understanding 2 Likes |
Re: For Django Developer by Taofeekdboy(m): 5:18am On Aug 13, 2020 |
Donpre: In any OOP language, when you create a class, then you can create a variable name to instantiate the class e.g
So dog1 and dog2 are both instance of the dog class. You can read more on classes on python to understand better. |
Re: For Django Developer by Donpre(m): 10:32am On Aug 13, 2020 |
fortifiedng: Thanks, I finally get it now |
Re: For Django Developer by Donpre(m): 10:34am On Aug 13, 2020 |
Taofeekdboy:OOP in python is quite confusing. Starting with "self" instead of "this" to the weird init constructor. I get what instance is, just didn't understand how it could be a property of a form. It's clear now though. Thanks for the help |
Re: For Django Developer by saheedniyi22(m): 10:06pm On Aug 13, 2020 |
Donpre:Good evening, I use pydroid too, I want to know if you have been able to use the pydroid terminal to perform GitHub stuffs like push, clone and co? |
Re: For Django Developer by Donpre(m): 10:17pm On Aug 13, 2020 |
saheedniyi22: No I haven't tried it |
Re: For Django Developer by saheedniyi22(m): 10:23pm On Aug 13, 2020 |
Donpre: I've been trying recently but haven't been successful with it. How do you upload your codes on GitHub? For now I do copy and paste though. |
Re: For Django Developer by Donpre(m): 10:42pm On Aug 13, 2020 |
saheedniyi22:Haven't published my code to GitHub since my PC crashed. I didn't even think to try. I'll try it later tonight, and see if it works 1 Like |
(1) (2) (3) (4) (5) (6) (7) (8) (9) (Reply)
The Future Of Machine Learning In Nigeria / Bash Shell Vulnerability Affects Linux, Unix And Mac OS X / You Would Better Start Programming With Java Or 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. 62 |