I basically want to make a small personal website that probably won’t get any attention. It will also be somewhat simple. Is Django overkill and I should use Flask or something else or is it okay? I tried learning JS and using ExpressJS but JS overall feels very loosely typed and I don’t like it. I’ve been using Python for over 3 years now.

  • Turun@feddit.de
    link
    fedilink
    arrow-up
    8
    ·
    1 year ago

    No, you should use whatever you want instead.

    Seriously, don’t worry about it. You want to use Django? Use Django! You want to use flask? Use flask!

  • Synthead@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    1 year ago

    Sure! I like using larger frameworks anyway because they typically come with a lot of nice features you might miss on the smaller ones. Personal preference.

    • asudox@lemmy.worldOP
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      Once you learn Django, is it easy to get a simple website to get running? How is its performance? I am planning on using templates heavily, is it ok?

      • PorkSoda@lemmy.world
        link
        fedilink
        arrow-up
        6
        ·
        edit-2
        1 year ago

        Once you learn Django, is it easy to get a simple website to get running?

        You can get a local install of Hello World running in minutes. Same thing for a Docker instance.

        How is its performance?

        It’s performant enough that if you are asking this, it probably doesn’t matter for your use-case.

        I am planning on using templates heavily, is it ok?

        Yes, that’s how you use Django. Since you asked about performance though, one area where Django’s performance can degrade is if you start trying to add too much logic in the views. Follow the Model, View, Control structure and keep logic in the control layer as much as you can.

        • Noughmad
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          1 year ago

          All good advice, just remember that the “control” layer in Django is called “view”. So, keep logic in the views and avoid using too much logic in templates.

      • Synthead@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        1 year ago

        Sure yeah, it’s not hard really. There is some background you’ll need to learn, like adding a view or working with models, but when you learn it, you’ll be glad you did. Templates are a great reason to use Django.

        Performance is great. Of course, the real performance isn’t really with Django itself, but how you use it. For example, if you write expensive database queries, your app will be slower.

      • onlinepersona
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        I find it the easiest to start with if you’re using a DB. You don’t need to write any SQL and everything is in python. And the tutorial + documentation is stellar.

  • silas
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 year ago

    Yes! If you’re comfortable with Django, that’ll definitely work, not overkill at all.

    If you’re down to get your hands dirty with JS, Astro is really easy to learn and can be extremely powerful if needed. TypeScript or JSDoc will give you the types in JavaScript you’re looking for, and that’s built-in to Astro too. SvelteKit is similar to Astro’s syntax but has more powerful server-side tools built-in and is my personal favorite.

    Up to you, really just depends on how much you want to learn.

  • hperrin@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    Re: JS, I use Express with TypeScript for strict types. It’s really nice, but, it doesn’t have much in the way of built in features. You kind of have to bolt everything on yourself.

  • gbuttersnaps
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    I started out on django and ended up switching to flask for all my python backends, but it depends on what exactly you want. Django is very hand-holdy and does some of the work of setting up new pages/routes for you, however that does put you on rails a little bit compared to flask. Flask is more performant and customizable, but it’s slightly more effort to get going in my opinion.

    • Cyno
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      Was there a noticeable performance improvement on flask or what kind of features did you need that django didn’t provide? I’ve always used bigger enterprise frameworks for webapps and only recently started looking into Django for smaller personal ones so I’m wondering what are the differences

      • gbuttersnaps
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        I’ll be honest, the only reason I originally switched was because I needed to learn flask for a work thing. I didn’t really notice any major differences in performance, but it was a pretty light website at that point anyway. I do prefer flask now, but that might just be because I’ve used it more.

        • Cyno
          link
          fedilink
          arrow-up
          2
          ·
          1 year ago

          Hmm, having googled very superficially about django and flask, it seems to me like the state (at least today) is the opposite - flask is lightweight and django is more heavy duty, having a built in ORM layer, authentication service, admin interface, db migration framework, etc.

          To be fair the article also says Django is known for its performance but when I googled that the other day, it looked like it was often near the bottom of the chart rather than top… I guess it really comes down to personal preference in the end 🤷‍♂️

  • CameronDev
    link
    fedilink
    arrow-up
    5
    arrow-down
    4
    ·
    1 year ago

    Do you want a website or a webapp? Website, just stick with nginx + wordpress or something. If you actually want to write a webapp, then django should be fine. I have also used fastapi which was very easy to start with. If it’s a personal web app, then the performance will never really be a problem (unless it grows into something more). So I would pick whatever you can find example code for, and just run with it.

  • flynnguy
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Django is great, I’ve used it in a number of projects, both paid gigs and side projects. Where it really shines is giving you a nice admin to be able to do CRUD (Create, read, update and delete) operations on the database with minimal work on your end. If you don’t need this, then something like flask is lighter weight and might be a better option.

    However, while python has type hints now, it is still a loosely typed language. If you really want to the benefits that come with a strongly typed language, I’d suggest maybe looking at Rust, Go or even TypeScript.

  • jeremyparker
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Big framework vs little framework is a “debate” I’ve seen a lot - but I put it in quotes because it’s not really something that anyone has firm answers for, and everyone pretty much agrees that there probably is a cut off point in site complexity, but it’s not a single, hard number.

    For a small site, it probably won’t take very long either way, so do whichever one appeals to you . It sounds like it’s something of a personal project, which is all the more reason to use whatever tech stack you feel like using.

  • abhibeckert@lemmy.world
    link
    fedilink
    arrow-up
    3
    arrow-down
    3
    ·
    edit-2
    1 year ago

    JS overall feels very loosely typed and I don’t like it

    Yep, as someone with 20+ years of JS experience it’s pretty bad. There are hoops you can jump through to improve things but they add complexity and don’t really fix the fundamentals.

    Django is an OK choice.

    Personally I would go for Laravel and PHP. In my opinion the latest version of PHP is a better language than Python (that wasn’t true with old versions of PHP) and I prefer Laravel over Django because it’s more modular and generally easier to build exactly what you want, without being influenced by the framework. Laravel is only “opinionated” in areas that will not limit your project.

    You will have to build your own back end/dashboard in Laravel though. That’s not much work but in particular make sure you get your login system right.

    Whichever way you go, I highly recommend paying for ChatGPT+ and using that instead of google/stack overflow/lemmy as the first place you go to look up how to do something. Here’s an example where I asked for a basic hello world project, then asked to expand it with Eloquent and Blade (to fetch from a database and output a html page): https://chat.openai.com/c/60ef78f4-13a6-4e62-ab7c-da4603ffed52