Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,194,345 members, 7,954,403 topics. Date: Friday, 20 September 2024 at 06:14 PM

Taofeekdboy's Posts

Nairaland Forum / Taofeekdboy's Profile / Taofeekdboy's Posts

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (of 18 pages)

Programming / Re: For Django Developer by Taofeekdboy(m): 5:33am On Jul 31, 2020
teamoneline:
Are there jobs for django in nigeria at all?
If there is, it will be few because most request for PHP, C# e.t.c but foreign companies do use django
Programming / Re: My Collections Of Python Projects by Taofeekdboy(m): 10:14pm On Jul 30, 2020
KlausMichaelson:


Good evening Sir

Your question:
What tells the user the kind of operations your program is capable of performing?

My Answer:
Calculation = input('addition, subtraction, multiplication, division, or modulo? ')

Your Question:
What happens if the user does not enter the operations to be performed correctly as used in the program? Like Addition instead of addition (issue of cases).

My Answer:
I use .lower if I want any input to be in lower case i.e
Calculation = input('addition, subtraction, multiplication, division, or modulo? ').lower

Your Question:
What happens if the user tries to divide a number by zero?

My Answer:
You use try except ZeroDivisionError or ValueError

But Sir I don't know where to to put in this try, except block in my program sad

The reason why I am yet to update my new code after about an hour now is because I don't know the position where the try..... except ZeroDivisionError and except ValueError block comes in. Please help me sir.

Thank you


I am through for the day as it is very late here, I would have shown you the code but you have to change the logic if you want to use the try and exept block.
I recommend while loop, if it's true, then it will keep requesting for the user's input if there's an error until you put a condition to meet.
Read more on while loop, try and exeption. As a beginner, try to fix things on your own, when you reach that point you feel you are lost then you can Google or use stackoverflow. Goodnight.

1 Like

Programming / Re: My Collections Of Python Projects by Taofeekdboy(m): 7:16pm On Jul 30, 2020
KlausMichaelson:
So I spent the previous night thinking of writing a code that can accept input from a user and run different operations on it. The operations are limited to Addition, subtraction, Division, Multiplication, and Modulo. I came up with this after much thought.


number1 = int(input('what number? '))
number2 = int(input('what number? '))
calculation = input('what operation do you want? ')

def operation(num1,num2):
addition = num1 + num2
subtraction = num1 - num2
multiplication = num1 * num2
division = num1 / num2
modulo = num1 % num2
if calculation == 'addition':
return addition
elif calculation == 'subtraction':
return subtraction
elif calculation == 'multiplication':
return multiplication
elif calculation == "division":
return division
elif calculation == 'modulo':
return modulo


result = operation(number1, number2)
print(result)
based on what ibromodzi has said, I could see ZeroDivisionError, TypeError and other Errors in this code,
When writing mostly inputation code, you need to validate user's input because if you fail to do so, your program will break as Python is a runtime language. Try to put it in 'try' and 'exception' block.. I wish you Goodluck in your learning.
Programming / Re: Dear Programmers, How Do You Remember Your Syntax? by Taofeekdboy(m): 9:50pm On Jul 29, 2020
fhranchez:
Dear programmers, How do you memorize your syntax and make sure it sticks even when working on complex projects.


Coding is really hard without mastering the basics
You don't memorize syntax or code, you understand the basics and how it works. Arrays, objects or dict, set, tuples and so on are there for reasons.
When working on complex projects, it is allowed to copy code even on stackoverflow or Google but you must have an idea of how the code works or else you are just going on the wrong path. Don't memorize code or syntax, undestand it better and put it into use.

5 Likes

Programming / Re: Pls Help.. I'm Losing Confidence In My Abilities by Taofeekdboy(m): 8:43am On Jul 28, 2020
Etinosa1234:
I've been learning Java for close to three months now...and I get overwhelmed when I see a Java question...
Most of the times I get to attempt it but sometimes I'll use the help section...

Pls is it normal to be under confident in my abilities at this stage of my learning
You are still on track because it takes time for you to understand the logic behind those coding.
There is difference between learning something and understanding the concepts.
And also try to master how you can write your own code so you can understand things at first.

1 Like

Programming / Re: Built A Pizza Application With React. Added A Custom Pizza Builder. by Taofeekdboy(m): 10:16pm On Jul 23, 2020
tensazangetsu20:
This is still a work in progress. Took inspiration from dodopizza.ng to create https://chinomso1995.github.io/dodosPizza/. Added a custom pizza builder. App was done with react. Still not finished though. Authentication and taking care of orders (a page for displaying orders). Taofeekedboy, devdev and olalekank really helped when I got stuck on the modal.
That's very nice.
Few suggestions tho,
If you can make it more unique than its parent project, you can use filtering method other than the data-target method.
Also limiting items in a single load will be awesome as well, as this will make it look more interactive.
But it is a job well done.
Programming / Re: For Django Developer by Taofeekdboy(m): 6:38pm On Jul 19, 2020
LSarcastic:
I think the OneToOne relationship is a better approach. One thing I've learnt about OOP is the SOLID principle. Responsibilities should be divided across classes and models. Leave the User model to handle core Django features while you have a different model that provides other functionalities for a user. So many things could go wrong with Abstract User.

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

Programming / Re: For Django Developer by Taofeekdboy(m): 5:02pm On Jul 19, 2020
Donpre:


You work remotely? as a Django or front-end developer?

that aside,
You know that redirect thing nairaland does when you log in, like it'll show a success page and then waits a while before redirecting to the home page. How can it be done with Django?

I've done my due diligence, but can seem to know how to use reverse_lazy, or reverse() to achieve that feature

Thanks!
I'm not working in Nigeria, I am just freelancing as a developer not full time but my main work is different from that.
Well if you need something like that, you will use javascript for that because django only redirect you once, you use setInterval and setTimout in javascript, that's the reason you need to learn javascript to be able to manipulate the Brower and your page.

1 Like

Programming / Re: For Django Developer by Taofeekdboy(m): 3:27pm On Jul 19, 2020
Toppytek:
To some extent I understand what guys are saying but I can’t really fathom is going on.

@Donpre what the the name of the editor you’re using on your phone? Is there something like that for iOS?

@Taofeekdboy come and adopt me please, make me your mentee.
If you need my assistance on it, you can pm me but you will have a lot to do on your side because my company has resumed and our timezone is different.

1 Like

Programming / Re: For Django Developer by Taofeekdboy(m): 7:25am On Jul 18, 2020
Donpre:


It's a typo, my url is correctly written courses:add_synopsis

also I can't remove the str cause the url actually take a course parameter just like the one below it that takes 2 parameters. it's from a reverse() in a get_absolute_url method of the model

funny thing is the code works fine provided the add_synopsis path is above the <str:course>, I just don't know why.

maybe I'll ask advanced Django groups

Thanks for the time
I got you but the way you are writing the URL path is wrong, when you are trying to match a path in django, it will start from the top to bottom to find the actual path but your path is not written in a nice structure...
Example,
You are writing a blog project and when you want to get a detail on a post, you match the path with the slug or pk of the post in your url so that your url will look like domain/blog/slug or pk
When you are receiving a parameter in your url path, your main path should have something to prefix it..
If you are not prefixing your url parameters with anything then your add synopsis must come first before your plain parameter path because it is still the same as empy string without getting the parameter.
Samething applicable when working with router in React.
Programming / Re: For Django Developer by Taofeekdboy(m): 11:57pm On Jul 17, 2020
Donpre:

I got the last part but the first part didn't explain why Django didn't just skip the first three paths, considering I used {% url "course:add_synopsis" %} in my HTML.
I would expect it would just call the view straight up but instead it's matching the second path.
OK, I don't know if you made a mistake, your app name is courses but you are using course in your url, and also the second path is not written well, remove the str from the course and leave only the course because you are not receiving a parameter in your view which you need to match it with...
If you look at the error, it is coming from the second path which means it is matching it with course.
Programming / Re: For Django Developer by Taofeekdboy(m): 11:30pm On Jul 17, 2020
Donpre:
@django developers

I need some explanation as to how url matching works. I've read the documentation but it didn't help.

When I placed my 'add_synopsis' path below the rest (as shown) I get an error (also shown)

Although I fixed it by moving the url path to the second position as recommend by a stack overflow post.

I just want to understand how the url matching works and why my code got that error in the first place, in case of future codes and larger projects

Thanks
In django urls, you have to be wary of the slash, strings and variables you use. In the second url path, you put <str:course> where as you are not getting a parameter for the course.
The only place where urls matching is very strict is your root folder url where admin, Django. Contib.auth has to come before your app urls.

1 Like

Programming / Re: For Django Developer by Taofeekdboy(m): 9:59pm On Jul 17, 2020
Toppytek:


Thanks a lot but really I don’t know what to do, I learnt JavaScript is super important for developers, but Python is my first programming language, and I can tell you that I have a natural proclivity for design and beautification especially in terms of color combinations. I haven’t gone far with Django but I need that mental readiness “what’s next?”

@taofeekdboy.
Your assumption is very right, Javascript is the main deal when it comes to UI/UX, if you are prolific in design and beautification, then you can start out as a frontend developer, with this you need to master Html, CSS and Javascript
Then you can further your backend path later with Django.

You just need to ask yourself which one is more comfortable for you or which one will give you happiness when doing it.
Programming to me is like having fun because whenever I am sitting down with my laptop, the joy I derive from it is second to none.
So go with whatever that gives you the confidence and oxytocin.

1 Like

Programming / Re: Programmers Of Nairaland. I Need Help!!! by Taofeekdboy(m): 9:45pm On Jul 17, 2020
tensazangetsu20:
Thanks to everyone who helped me out. Here is the final code I used https://codepen.io/chinomso1995/pen/mdVzZJE incase anyone else has a similar problem.
Nice bro... More cheers!!!!
Programming / Re: Programmers Of Nairaland. I Need Help!!! by Taofeekdboy(m): 3:45pm On Jul 17, 2020
tensazangetsu20:

Thank you so much for taking your time to go through this with me. God bless you.

Bro, I have worked on it, not really different from the one I did and also you are almost there, I have put some comments in it to get you through,
just make sure you map through or loop, which one you are comfortable.

https://codepen.io/taofeek-adeshina-adebayo/pen/yLeRqjw

1 Like

Programming / Re: Programmers Of Nairaland. I Need Help!!! by Taofeekdboy(m): 2:28pm On Jul 17, 2020
tensazangetsu20:

It is pure CSS no frameworks. What adjustments do you think I should make. The pizzamodal is in the same folder as the pizzas component. The modal is its own class based component. I made it class based to handle some events related to those slider buttons. Scroll down to check.
You need to map or loop through the pizzas state and map it to your Modal component, you don't need to write your Modal return output in Pizza component, you just need the props object from Pizza component, I will copy the code from your codepen and re write it....
Programming / Re: Programmers Of Nairaland. I Need Help!!! by Taofeekdboy(m): 1:28pm On Jul 17, 2020
tensazangetsu20:

https://codepen.io/chinomso1995/pen/mdVzZJE
Bros I tried to use your method but its not displaying the pictures or text. Can you go through the code . Maybe there is something I am not doing right. I already set all the properties on the pizzas array now I want to show a unque property according to each button click on that modal.
I have gone through your code but I noticed where you are passing Modal on Pizza component and you are using PizzaModal which is not getting the props, if you are using PizzaModal for the pizza details, then the component will be the one to get the props, then you can use it in your component.... And one more thing, if you are using css framework, at times the implementation might differ because they have incorporated their own javascript or React element into it because I am seeing Modal that you are passing into Pizza components and it is not a component on its own...
Programming / Re: For Django Developer by Taofeekdboy(m): 9:55am On Jul 17, 2020
Toppytek:
I’ve been hearing a lot about React and Vue but I don’t know which one to go for cos am yet to start my JavaScript journey, that been said, I have a thing for Flutter as well coz i learnt it can be integrated to the DRF.

I’m a Django newbie, started a month ago.
@taofeekdboy @donpre

Well, React is a Javascript library while Vue is a javascript framework, both are used for frontend development.
Vue is easy to learn and grasp and it's documentation is super awesome, on the other hand, React has a steep learning curve compared to Vue and some concepts in React are difficult to digest such as props, life cycle but all can be achieved with consistency.
I will advise beginners to go for Vue because it is easy to setup and learn.
Flutter is used for mobile app development and in creation of desktop apps. It is written in Dart, a language created by Google.
Programming / Re: Programmers Of Nairaland. I Need Help!!! by Taofeekdboy(m): 1:05am On Jul 17, 2020
I have posted it on codepen, you can check it there as well .
https://codepen.io/taofeek-adeshina-adebayo/pen/yLeRqjw
Programming / Re: Programmers Of Nairaland. I Need Help!!! by Taofeekdboy(m): 12:55am On Jul 17, 2020
I am trying to post the code but it is not allowing it here
Programming / Re: Programmers Of Nairaland. I Need Help!!! by Taofeekdboy(m): 12:12am On Jul 17, 2020
tensazangetsu20:

Abeg can you just give me an example.
Yes I am writing one now... Just wait.
Programming / Re: Programmers Of Nairaland. I Need Help!!! by Taofeekdboy(m): 11:59pm On Jul 16, 2020
devdev:

Lol... you open the modal with boolean using setState.... that same setState pass the data of the current item and call it on the modal. Do you need example?
devdev is right, in your setState where you are calling your modal, pass the ID or the pizza data you want to show..
Programming / Re: For Django Developer by Taofeekdboy(m): 8:07am On Jul 14, 2020
Donpre:

It's funny how you painted React in such bright only to recommend Vue at the end

Another question tho, I know I'm getting ahead of myself here but is Vue/React integrated into the django template or you build API with DRF and make calls to that instead?
The reason why I said that was because Vue is easier to learn and can integrate easily, for beginners, you will always go for easier method right grin. I learnt React first, moving to Vue was so super easy that it didn't take me like 3 days to grab everything in Vue.
React has a steep learning curve compared to Vue because of its lifecycle can sometimes f*ck with your head, props and all that, but when you are comfortable with it, you won't leave it for other frameworks.

Back to your question,
You can integrate both Vue and React in django template directly but I won't advise you to do so because it will get messier as you are writing a lot of code, the best thing is build a Restful API and let your frontend consume the API, you can do whatever you want with it in the frontend.
So I build API with DRF and my React app consume the API, making calls, getting data, posting data, deleting data, patching data, updating and so on..

1 Like 1 Share

Programming / Re: For Django Developer by Taofeekdboy(m): 7:56am On Jul 14, 2020
fortifiedng:


Wanna ask a question, Taofeekdboy. When developing your web apps with Django ofcourse, Do you build with Django itself or you build with DRF?
Django web apps can be built without using DRF, the main purpose of DRF is to build a Restful API to consume in your frontend, you can build webs apps with Django, JQuery, bootstrap.

Before learning React and other frontend tools, I built my web apps with Django only but after learning React, Vue, I make use of Django for my backend and React or Vue to consume the API in the frontend.
Building with DRF gives you a lot of advantages:
You can use your API for both web apps and mobile applications. Using React-native, you can consume your Restful API in your React-native projects.

3 Likes

Programming / Re: For Django Developer by Taofeekdboy(m): 9:47pm On Jul 13, 2020
Donpre:

I've been hearing this talk and I don't quite understand how Django and React are soulmates.

Also, how does a Vue-Django combo compare against a React-Django combo

#Newbie
Have worked with Vue-Django and React-Django but I prefer React-Django because React is easy to setup with Django both in development and production. As a newbie, I will advise you to go for Vue as your first javascript framework as it is easy to learn and simple to integrate with any backend language.
Django-React community is more accessible than Vue-Django.

2 Likes

Programming / Re: For Django Developer by Taofeekdboy(m): 8:24pm On Jul 13, 2020
fortifiedng:


How long did it take you to learn react?
It took me like 2 months to learn React fully but up till this moment I am still learning it, now I am at the stage of writing npm packages for resuability in other projects.

2 Likes

Programming / Re: For Django Developer by Taofeekdboy(m): 6:40pm On Jul 13, 2020
fortifiedng:
Undeniable. The blend of React and Django gives a sweet coding savour wink

UI/UX is another different field on it's own. Truly the road long pass trailer
As in, they are made for each other, I enjoy using Django with React a lot..
Programming / Re: For Django Developer by Taofeekdboy(m): 5:03pm On Jul 13, 2020
saheedniyi22:
I have this question to ask,

If I learn html,css, Django/flask. Can I call myself a full stack developer

Not really brother, I will still call that back end developer, Full stack developer knows most of the tools used for designing both the UI/UX and back end.
Though django uses jinja template to output logic on the front end but it is not enough as world has evolved beyond that. You need to have a solid understanding of frond end tools such as html, CSS, JavaScript(This is where you need to choose from different javascript frameworks: angular, react, vue e.t.c... react is just a library grin grin) and back end tools e.g PHP, Rust, C#, Python and so on.

If you are good with Javascript, you can use it for both frontend and backend development using nodejs. There are unlimited resources for you out there and you need to grab it, learn and continue learning as the journey to become a full stack developer long pass trailer.

1 Like

Programming / Re: For Django Developer by Taofeekdboy(m): 12:35am On Jul 13, 2020
ore291:

It's very nice as per more functions what my junior bro does for school now is zoom classes so maybe teachers should be able to create a schedule of classes and when the students logs in ,

he sees the schedule knows when he's to come online ,

he can then click on the subject which redirects to the teachers zoom link ,

Then after the class is done the teacher uploads
Assignment as you already have done .

Does the teacher give assignment individually or by class?
For now, individually, I wanted to make it general but I want a way where the teacher will keep track of the student and can make a report as well. I will buy the idea of the classes, mayb I can use the classes to make it more interactive.
Thanks brother.
Programming / Re: For Django Developer by Taofeekdboy(m): 11:43pm On Jul 12, 2020
http://tlinker.pythonanywhere.com
Two groups of teacher and student, a teacher can set questions for students to answer and also a teacher can prepare assignment for each student, getting the scores of each student and receiving their assignments. I am thinking of more functions to add to it tho
Programming / Re: My First Ever Javascript Webapp by Taofeekdboy(m): 11:34pm On Jul 12, 2020
ore291:
that'll be nice self , if you make it open source I won't mind contributing and I learnt Vue first cause on reddit they were like react has a very steep learning curve and for someone like me who just learnt JavaScript let me not go and injure my brain
It has been a long time... I think I told you about the project related to school management.
Well, I am done with the first part. If you don't mind you can check it up on
http://tlinker.pythonanywhere.com
Two groups of teacher and student, a teacher can set questions for students to answer and also a teacher can prepare assignment for each student, getting the scores of each student and receiving their assignments. I am thinking of more functions to add to it tho.

1 Like

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (of 18 pages)

(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. 75
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.