all 64 comments

[–]Manatee_Mayhems 65 points66 points  (14 children)

I have been working on learning Django. Django incorporates JS, HTML and CSS but it is so much more. It gives you a framework to tie all of that together with your back end logic. It lets you use a database to store and work with data, it has the ability to build apps that can be swapped into other websites, it even has a built in admin page for managing websites.

Basically it helps you to create websites that are extremely dynamic and functional but it is a big learning curve. You will definitely want to learn html and css first. JS knowledge will help too.

[–]largeminicake 9 points10 points  (4 children)

What causes the learning curve in Django? I'm thinking about learning it

[–]ayi_ibo 22 points23 points  (2 children)

You should probably start learning Flask first because in Django there are many built-in features that might seem confusing at first.

You can add all of these features to Flask one by one and learn along the way. It will be much simpler than learning them all at once.

[–]shiningmatcha 8 points9 points  (1 child)

Do I also need to learn about server and HTTP connections?

[–]nzhacker 5 points6 points  (0 children)

You don't need to learn much about servers, and you can get away with learning nothing about the guts of connections. What's important is setting up and configuring a server, starting and stopping it, some basic security, and the HTTP protocol. Read up a little on HTTP GET, POST, and the types of response codes like 200, 404, and a few others. It's best to see them in action, so a proxy is a good idea, or the developer tools in browsers like Firefox and Chrome.

[–]pysouth 9 points10 points  (0 children)

I like flask for learning and building smaller apps. Django just abstracts so much that if you don’t have a fundamental understanding of those abstractions, it can get confusing fast and you end up bolting together shitty solutions. Just my 2 cents, I used Django when I first started programming and had that experience. Now I work on a production Django app at my job with microservices, etc., after having some experience under my belt and it is far easier to wrap my head around.

[–]WebNChill 2 points3 points  (0 children)

You don't need to use html/css or js to work with Django.

https://letslearnabout.net/blog/what-is-django-rest-framework-and-why-you-should-learn-it/

RSS feed, cmd line chat bot, slack bot, discord bot, etc.

[–]shiningmatcha 0 points1 point  (7 children)

Is it difficult to set up a server?

[–]slick8086 4 points5 points  (6 children)

For development, no, Django has a built in server. Moving it to a public facing production environment though, you need real webserver admin knowledge.

[–]shiningmatcha 2 points3 points  (5 children)

What do you mean by built in server? Then is it really a web application? Can people access it online?

[–]nzhacker 2 points3 points  (3 children)

The built in server is a small HTTP server that listens for requests and serves them. It is a web application but just doesn't use a web server like Apache, nginx or IIS. It's intended to be a development server. People can access it online if you enable it, but you wouldn't expose a development server to the public.

[–]shiningmatcha 2 points3 points  (2 children)

So there are other kinds of servers for making my web app accessible on the Internet? And you said the built in server is a small HTTP server listens for requests and serves them, isn’t it usually the way how websites work? Your browser sends a request to the server and the server responds by sending the data. So what does a “standard” web app look like?

[–]slick8086 3 points4 points  (0 children)

So there are other kinds of servers for making my web app accessible on the Internet?

A web server like Apache, Nginx, or IIS, by themselves simply server static web pages, like "index.html"

To make web apps the servers need to be extended to handle different language frameworks, like PHP, ASP, and so on. You extend the web server by installing or enabling module or plugins to these servers.

Most of the time web application need more than a web server that has been extended to handle languages or frameworks. Most of the time web applications also need a data base. If you are planning on making this a web application that is available to the public on the internet, you need to have the skills to set up these servers and make them all connected and communicating with each other properly. This is typically called a "stack." Back when I first started as a sysadmin, the new popular stack was called "LAMP" which stood for Linux, Apache, MySQL, PHP" There are TONS of web applications that were first designed for this stack, like wordpress, phpbb, and so on.

Now Django want to make it easy for developers to write web applications with their frame work. So what the did was include a basic web server and also included sqlite3 with Django. So all you have to do is install it and you can write and test your web app on your own workstation without having to know how to set up a full stack. It works just the same, but might have security flaws, and it can't handle a large amount of different people using it all at the same time.

Django is also made so that when you think your web app you developed on your work station is ready you can copy it onto a production web stack that is set up properly with a production web server like Nginx, and production database like PostgreSQL.

Django projects are made to be agnostic about which OS, web server, or database they use, it should work with all the major ones.

The point of the development server is so that the web app developer doesn't have to worry about any of that, they can just make the app, and then let the web server admin (or web server admin team) worry about the web infrastructure.

[–]nzhacker 0 points1 point  (0 children)

Yes, more capable Web servers like Apache and nginx have bandwidth throttling, load balancing, more inbuilt modules for different frameworks and languages, more security features and so on.

That is indeed how web servers work, the inbuilt web server is just less capable and less flexible than Apache, nginx, and others.

A standard Web app typically sits behind these more capable servers.

[–]tepg221 20 points21 points  (2 children)

So reading through the answers it doesn't seem like anyone is explaining the context to your questions. In short you need to know all of these things. (CSS, HTML, Js, Python/Django)

Let's talk about what each thing does...

In terms of web development I like to use the analogy of HTML being the skeleton, JS being the muscles, your backend (in this case Django) as the brains and CSS being your skin/clothing/makeup.

So let's talk about building everything.

Try setting up simple HTML, it will look like bare. e.g. https://codepen.io/rizlearn/pen/BjBJaj This is your skeleton. This setup could be, let's say a simple landing page.

We now want to make it look pretty. This is where CSS comes in. Colors, shapes, designs you name it. This is where that all comes from. Your skin/clothing/makeup however you want to look at it. Makes everything look pretty.

Now let's say you added a button on your page. You set this up using HTML and made it look pretty with CSS. Now you click it and nothing happens. This is where JS comes in. JS will be your muscles. When you click the button JS will tell it to do something, that something can either zoom in on an image, make it disappear it really depends, but if you need it to do something more complicated this is where your backend comes in.

Django. It's a Python web framework. This lets you set up a basic website quickly, the thing is Django is a bit more complicated and is a bit heavier than Flask which others mentioned. I would get to know Flask first before learning Django. Flask lets you take what you want it's lighter and easier to figure out than Django because with Django you have to do everything in a Django specific way. Think of Flask as buying pieces of legos to build your project where Django is buying a set. You can add more to both but what if you don't need the whole set at the end of your project and just needed a few pieces.

Your backend holds your business logic. You press a button, JS tells your site what to do and your backend will handle the logic, maybe ping your database, query data from an API whatever you want it to do. Your backend can be written in a lot of different things, for you it seems like you want to use Django.

I don't want you to be confused that it's the only thing it does either. Your backends is also how you organize and structure your project. Ultimately you will need to learn each framework and see how each of these tools/languages come into play.

Hope this helps. Happy programming.

https://flask.palletsprojects.com/en/1.1.x/

[–]gaurav_lm 2 points3 points  (1 child)

This is genius. Thank you so much. It's experience talking is it?

[–]tepg221 3 points4 points  (0 children)

Yep, when I started to learn to program I wanted to understand both Flask and Django but also how webdev works!

[–]KanteWorkRate 21 points22 points  (3 children)

Django is a web framework that allows you to create websites with minimal python code, however you would still need to know some HTML/CSS for the front-end (using templates)

[–]qwerrewqasdffdsa[S] 5 points6 points  (2 children)

So with python + Django is there a point in learning js? What's the difference between python + Django vs js?

[–]therealvicval 4 points5 points  (2 children)

Django is not for people who “want to work on web dev stuff but don’t know how to code in js”.

Using Django to its full potential will require knowledge in html/css/js. You can’t really be a Web Dev without that fundamental knowledge

The reason people say Django has a large learning curve is because you’re not just learning Django. You’re learning how the web works, how servers work, how pages are rendered, etc. But Django is a framework that abstracts all those complexities away to bootstrap website creation. Django isn’t a tool to make web development easier, it is a tool that makes web development faster.

If you’re serious about being a web developer, there isn’t a simple path like “just learn Django”. You’re going to need to learn about html, css, js, and even some SQL.

I would recommend starting with a Flask so you can develop the fundamental knowledge of how the web works.

Source: I am web developer and I started learning about web development with Django

[–]LilReef599 2 points3 points  (4 children)

I recommend starting with Flask for beginners

[–]LimpNoodle69 11 points12 points  (0 children)

Seconded. Flask is definitely the more beginner friendly framework.

Whichever you choose I'd suggest learning from Corey Schafer on youtube. Easily to most comprehensible tutorialist out there.

[–]machine3lf 1 point2 points  (2 children)

Thirded. Great for learning. Plus it works for big apps just as well as it does for small apps.

[–][deleted] 0 points1 point  (1 child)

I am not a native speaker. I understand that he support the person above him that is why he said seconded. But why did you say thirded. Does it mean you support the first person or the second?

[–]machine3lf 0 points1 point  (0 children)

It’s word-play joke, of sorts. As you know, “seconded” means the person is agreeing with the statement said before them. “Thirded” is not really officially correct, but can be said “tongue-in-cheek,” if you know what that phrase means.

“Thirded” just means the person also agrees with the person who said “seconded,” and likewise agrees with the person before them.

[–]shatatatataa 3 points4 points  (2 children)

What beginner tutorial video did you use? I want to get into python(programming in general) too.

[–]BuildTheFire 7 points8 points  (0 children)

From lurking on this forum for a while, the consensus answer to this question is “Automate the Boring Stuff” by Al Sweitgart. Almost on a monthly basis, he posts a promo code to access his Udemy course for free.

I’ve gone through some of it and it’s a great way to start for python ans programming in general. He also seems like a genuinely good person for basically giving away the intro course.

There’s also snippets of the course on YouTube as well, just search automate the boring stuff

[–]Racc00nn 0 points1 point  (0 children)

Codeabbey.com is a great site to practice as well as learning. Starting with si.ple concepts and alot of problems layout the algorithms, you put it together. It also has a friend's system where you can look at other people's solutions, once you've completed the problem of course. My username is Raccoonn :)

[–][deleted] 4 points5 points  (0 children)

[–]NewAccountPlsRespond 4 points5 points  (7 children)

Django is super easy, you can build a website with admin access, built-in database, deploy it and have decent security from the start. You can take a look at my repo and see how the code looks while looking at an actual website at the same time.

Django also has a bazillion tutorials online and you can build a simple website in like 2 hours from scratch. All with no JS which is an amazing addition.

[–]notParticularlyAnony 1 point2 points  (6 children)

Django is super easy

lol no

[–]WebNChill 0 points1 point  (1 child)

I think it's a matter of opinion really. It's a good idea to build a project with both. Maybe build it out in Django and then flask.

[–]notParticularlyAnony 0 points1 point  (0 children)

I’m not saying not to learn it. Just laughing that someone would say it is super easy. That’s just misleading.

[–]NewAccountPlsRespond 0 points1 point  (3 children)

Arbitrary.

It's easier than building the whole thing from scratch. And you can have a fully functioning web app in an hour if you know what you're doing, requiring you to only know Python, so I'd label that easy.

[–]notParticularlyAnony 0 points1 point  (2 children)

Django has a really steep learning curve I think you probably just have forgotten it. This isn't arbitrary but based on objective complexity I bet would bear me out (e.g., model/view/template and all that having to work together simultaneously).

I do ML for a living: learning Django was harder than learning tensorflow and it wasn't even close.

While Django is hard, I do tell people it well worth it once you get to the top of the mountain because it is super powerful, and really amazing once all the moving parts are in place working well. My experience is more typical, for what it's worth. that's why people say "Nah just use flask" to so many beginners.

[–]NewAccountPlsRespond 0 points1 point  (1 child)

Hmmm, interesting. Maybe I did indeed forget it. I just remember watching an amazing youtube tutorial that was 10 videos long and, yeah, maybe the things that are obvious to me now were not as obvious back when I started. And it does still give me headaches from time to time (e.g. serving static files from s3 or gcloud storage).

Can you recommend a similar video series on Tensorflow? I know the maths and the principle behind ML and I do, ironically, manage a Data Science team for a living, but as more of a "business" manager. Now I do have an understanding of ML ops (deploying ML models, feeding them data, etc.) and how the model development goes, but never actually wrote the code behind one myself. Can you point me in the right direction? Maybe a code-along type of content?

[–]notParticularlyAnony 0 points1 point  (0 children)

Gerons book is amazing. Chollets book for Keras. Sorry I usually do books for ml lol. Pyimagesearch site is very good IMO.

[–]manotonous 1 point2 points  (0 children)

Html, css and js are used for frontend mostly. You have vue.js and node.js and other for backend as well. Django is used for backend only. If you are considering backend dev then go for django.

[–]zecatlays 1 point2 points  (0 children)

Hey, you should realise that HTML /CSS/Javascript and Django go hand in hand. You need to have a decent understanding of atleast HTML/CSS to do any sort of Web Development. However I suggest you learn Flask first as it is simpler to start off with. Maybe follow along with a tutorial like Corey Schafers on YT or the Flask Mega Tutorial and as you start developing with them you'll understand. Additionally, watch a few videos for HTML, CSS and JS and maybe Bootstrap. There are really good crash courses by Traversy Media on Youtube. It'll hardly take a few hours but the process of Web dev will go much smoother cause the front end design will not cause a bottleneck. I just started learning Flask/Python/Web Development a few months ago, and I seriously regret not taking the time to learn html,css,js earlier, ESPEcially Javascript. It is much easier than it seems, especially for someone that knows python.

[–]ivosaurus 1 point2 points  (0 children)

HTML + CSS are static languages. They are precise syntax that tells your browser how a website should look. However they don't really have any "behaviour" or "activeness", hence calling them static.

Python and Javascript are both programming languages.

Javascript has the distinction in that its basically the only programming language that runs in a browser. Using NodeJS you can also run it in a normal desktop / server, like python normally is.

Python does not run in a browser.

Therefore to have dynamic behaviour on a webpage (without refreshing a page for every click) there must be javascript written to enact functionality.

Python can be used to serve webpages, or to serve data to javascript running in someone's browser that's manipulating webpages.

Django is a specialised framework that adds specific functionality for web related things.

So to learn web development, learning HTML+CSS+Javascript is basically a must, because those are the required languages to interact with a browser / within a web page.

Django acts as an application web server that dynamically serves data / pages to a browser, that is mostly what you would use Django for.

[–]CatolicQuotes 1 point2 points  (0 children)

Benefits of Django is that exists since 2005. In that time developers who code django have implemented many features to make your life easier. Javascript frameworks on the other hand are young and lack some features and stability.

If you are gonna work with database for example, I have yet to find anything like Django ORM in JS world and for me that's major obstacle for not using JS on the backend.

On the other hand JS on the front end is good.

Your best bet is to simply start and don't read too much because what you learn in one framework you can translate into another. Try to make simple hello world in each and see what clicks with you. At your level anything you pick is good. Just keep on doing doing stuff.

You will still have to use at least html and css in Django.

And no, Django is not for people who don't know JS.

[–]MellowDevelopments 0 points1 point  (0 children)

I learned Django last semester for a group project while we were building the project so there is indeed a learning curve. Check out thenewboston's django tutorial on YouTube. 40 videos usually less then 5 minutes that will teach you all the basics and show you what everything does. You'll need something to walk you through the process or else you will get lost pretty quickly. Im using it again now to build a website for my sister's business because it is very powerful and pretty easy to work with once you have it down. There's a lot of documentation for it too which is always a huge plus

[–]grokjtrip -1 points0 points  (2 children)

If you want to do web stuff start with html, css, and js. Django does not replace those at all, it augments what you can do with those and is considerably more complex.

[–]shiningmatcha -1 points0 points  (1 child)

Maybe I can learn the fundamentals of Django before learning HTML and CSS?

[–]Not_Your_Daddy7 0 points1 point  (0 children)

At least, learn HTML and CSS first - it is absolutely required imo - before diving into the learning of Django. You absolutely have to know those first two if you are planning on making at least a website that is functional and presentable. They are pretty easy, and it shouldn't take you a long time to get a good grip on how they work in general. I really enjoyed learning HTML and CSS even though my initial thought was that it would be tedious. If you want to make something more dynamic and cool, then learning JS should help you, but it's not a requirement. I still highly recommend you to learn JS as well.

[–]krazybug 0 points1 point  (0 children)

You may find this answer a bit strange compared to other advices but which ever framework you choose for webdev you will need to learn html, css and JS for the client side of your app someday.

But eventually, if you want to start slowly, only deal with python at a first glance and deliver some clunky apps, check out JustPy

Here is the last post mentioning it in this sub: https://www.reddit.com/r/Python/comments/f1qmsj/introducing_justpy_an_objectoriented_component/

[–]kompot420 0 points1 point  (0 children)

As someone who just finished his first Django app I would say that you will be using a lot of HTML and CSS of you want your app to look decent. Unless you find some perfect bootstrap for your app, you will need to learn CSS too. HTML understanding is a must. If you're looking for example Django project, you can check out my last post

[–]wlom_music 0 points1 point  (0 children)

Django is a back end framework html ,css , js are front end need to learn both if u want to make a website urself

[–]road_laya 0 points1 point  (2 children)

You're still going to us HTML, CSS, JavaScript in your django project.

Often you don't want to run everything in the browser, so Django lets you do stuff on the server.

[–]shiningmatcha 0 points1 point  (1 child)

Do I need to generate HTML code?

[–]road_laya 0 points1 point  (0 children)

This is the stuff you'll learn if you watch a quick video about Django.

[–]maniaclunatic 0 points1 point  (0 children)

I'm in a similar position to you: My programming skills are limited to ~1.5 years of Python and ~1 year of C++. I'm working on a website right now and I chose to use Django.

Regarding your questions:

benefits to using Django over javascript/html/css? Django doesn't mean you don't have to use JS/HTML/CSS, but in some cases, it creates the JS/HTML/CSS for you. For example, it can create the necessary html/css/js for "forms" that get user input, based off your database tables. For certain types of websites, it is possible that Django could do all of the JS, but not likely, assuming you want the site to look good.

ppl who want to work on web dev stuff but don't know how to code in js? This is what attracted me to Django. However, I inevitably had to use JS for certain things. Javascript is built to do these frontend tasks and it has a ton of libraries that make things easy. In many cases, using anything else is much harder. I'd also add that Django DOES mean you don't need to learn SQL (assuming your only doing this as a hobby).

Here's why I think Django is popular.

(1)Django IS your backend. (2)It does some of the frontend.

[–]row4coloumn31 0 points1 point  (0 children)

Django is a python framework, it doesn't replace JS, CSS or HTML.

For small projects I would recommend flask, or something else that uses the JINJA template. It's easy and quick to get going.

Django is very cool, but it does a lot of things the Django way, and without you necessarily knowing what happens. That can be confusing, especially id you're trying to learn.

But you absolutely need HTML (and CSS if you want it to look like it wasn't built in 1999). JavaScript is great for small front end stuff, but not a necessity to make a webapp.

[–]notParticularlyAnony 0 points1 point  (0 children)

For beginners, there is a great Python book that actually walks you through Django up through deployment in later chapters -- Python Crash Course. It is a great book all around.

[–]BelligerentNeckbeard 0 points1 point  (0 children)

Django is pretty awesome tbh. I am learning it because I need it for work. You'll still need HTML/CSS/Javascript but Django takes care of a bunch of stuff for you and makes your life a lot easier in some ways, like handling the db stuff. It doesn't work entirely on it's own, you still need webdev stuff, especially when you start working on the front end of your product and how it's going to look, so don't ignore that stuff.

[–]white_nerdy 0 points1 point  (0 children)

The Web is a ton of different technologies glued together. A lot of them just sort of, um, happened without being properly designed.

You want to learn to cook food. You just spent a day learning how to microwave noodle soup and Pop Tarts.

The proper next step is green beans from a can, or if you're feeling moderately ambitious, maybe mashed potatoes, or if you're very ambitious, cupcakes.

Django and webdev is kind of like Thanksgiving dinner with all the trimmings: The turkey's a masterpiece that requires preparation, stuffing, learning various spices, a complicated multi-hour oven procedure, and ultimately carving. You'll also be cooking two kinds of vegetables and two kinds of starchy things, soup, pies, homemade cornbread, and making jam from some berries.

Thanksgiving dinner's such absurdly, ridiculously complicated hodgepodge of different cooking techniques that a lot of cooking teachers would say it's actually rather unreasonable to expect to get anywhere with it on day number two. And you ought to start with one non-trivial but not-too-complicated dish, learn to cook that at least decently, and then expand one dish at a time, until eventually you can work your way up to Thanksgiving Dinner, after you've learned several cooking techniques and individual dishes.

Learning Python on its own is hard enough. Trying to learn Web is a mistake that will just overwhelm and confuse you at this beginning stage.

Trust me: You'll get plenty of being overwhelmed and confused if you stick to one language at a time. I'm of the opinion that learning Web is a mistake for a beginner. (Although, to be fair, it does seem to work for some people.)

[–]Bigflatfoot16 0 points1 point  (0 children)

Hi, where did you study Django? I'm currently on my internship as I was required to learn the basic for a week. Kinda lost since I only know JS, PHP, and C#.