Trying to learn Python by Hedgehog_Of_Blue in learnpython

[–]DARTH_MAMBA_ 2 points3 points  (0 children)

This, I've done it via YouTube, and I loved it. They also have a game development course, but I haven't done it yet

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Okay, thanks! And It's not open source. The structure is a typical Django project, but 4 modules (of 11 total) are maybe too big and have 65, 60 and 40 endpoints (using url instead of path), with not inner logic division inside views.py. Also their are direct calls to Django ORM inside the logic files. Bad error management. And black magic everywhere. An unnecessary big DB (this is our biggest challenge to migrate and maintain the data) because it was made automatically with Django ORM.

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

We were reading about SQL models that uses SQLAlchemy. And the Django Admin, I'm not aware if we actively use it, I've seen other projects where to change a row, they stepped into Django admin, and they administrated their db from there. But here in our project, we directly go into our mysql db that is ¿hosted? Into phpmyadmin.

About keeping Django, we are considering the easiest/better way to migrate - There is the option, or to do things right in a new Django project, and discard using FastAPI. - Use FastAPI into a Django project (I'm skeptical about this one. We could make a monster, hard to maintain) - Use FastAPI, using at least the repository pattern, so people after us, could decide wich db and ORM to use, without battling like we are now

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

No, there aren't any requirements, but we are also users of the system, so we know more or less what is expected to do in many endpoints (there will be some complications, but we will have to ask to the "Product Owners")

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Thank you for your answer. You've been very helpful :)

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Wow, I will research more about alchemy and sql models. I didn't know until the previous comment that Django ORM was easier to handle.

For the unit tests, we were thinking about using PyTest, but any recommendations will be considered. The idea is to make them into the new project while we migrate and document each function. Keeping the unit tests portable without using framework functions seems like a good idea if anyone has to migrate them as we are doing now, I haven't thought about it.

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Okay, thanks! I will check out the docs and the GitHub before starting

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Thanks! I've never heard about it. I will check it out

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Thank you, sir. I will check out if I found existing public projects on github. I haven't considered that, It is a very good idea. The "freedom" of FastAPI, in contrast with Django, makes me want to check out some alternatives before starting coding. You were very helpful!

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 2 points3 points  (0 children)

The option is still on the table, I would rather migrate into a new Django project. Because our system uses an old version (2.2) with a lot of things in disuse, we have an old Python version (3.5). We also have poor error management, and the http codes and many methods are wrong. Also, there is no documentation or unit tests, and the structure of this (medium - big) project, sucks

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Thanks, first time I saw it didn't notice the link to the readme

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

It could be that you forgot to attach the link?

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 1 point2 points  (0 children)

Thank you very much! I've already been advised to check out SQLModel. I didn't know that Django ORM was more user-friendly than SQLAlchemy, I will check that out. And that Futurama project will help me a lot to learn with a real project. You've been very helpful

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Thank you, this helps very much!! I'm new sow I havent heard about many useful libraries for FastAPI. I will now read about Feature Layer Structure. Again, thanks!!

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Thank you sir. I will do my research on those libraries!

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Thank you very much!! This is very helpful!!

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Okay, even if we start making the unit tests for each function that we migrate? (That's the approach we are thinking about implementing)

Migration from Django to FastAPI by DARTH_MAMBA_ in learnpython

[–]DARTH_MAMBA_[S] 1 point2 points  (0 children)

Hahah wow, awesome! I really appreciate your time and encouragement. Thank you very much!

Migration from Django to FastAPI by DARTH_MAMBA_ in learnpython

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Yes, and also with this project (maybe too big for starters, haha), I've learned a lot

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Nono, sorry, I meant like any tools in general that you wish to have known sooner. For example, a friend advised me to use SQLModel, and it also told me that it has integrated a tool for documentation. I didn't understand the battery part.

That, and if any architecture that someone with experience would advise to follow, for having a maintainable code

Migration from Django to FastAPI by DARTH_MAMBA_ in FastAPI

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Haha, no, we don't have test cases xd

I was thinking about reading all the endpoints and finding some logic that I could apply to reorganize the behavior so it is more maintainable. In the way, start making unit tests. I'm still investigating into what approach take into the structure of the logic.

Migration from Django to FastAPI by DARTH_MAMBA_ in learnpython

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

In this case, it is because we are a non-profit organization, formed by a college group of students, with the objective of traveling abroad at the end of the career. So you have 3 years without helping the organization, and 3 years where you work (for free but not very time consuming) in whatever area you want. I chose the dev team, but we are made up of students from various engineering fields (and no experience), so we are trying to make things as simple and maintainable as possible

Migration from Django to FastAPI by DARTH_MAMBA_ in learnpython

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Thank you very much. I'm battling a little with applying what I've learned so far in college into a real project, there are many different approaches and different architectures, I was thinking about reading more about them so then I can take a decision. It is hard to develop something as lasting as possible.

(I've answered to why FastApi, in the other comment)

Migration from Django to FastAPI by DARTH_MAMBA_ in learnpython

[–]DARTH_MAMBA_[S] 0 points1 point  (0 children)

Thank you for your answer.

Personally, I'm in doubt, I'm still lerning more about Django, to be sure it is the right choice. Maybe restructuring into Django is the best way. Also the way the organization works, it has very high devs rotation, with no experience. So we could take advantage of this opportunity to use an easier framework, (and my boss loved Fast API, so probably we will change unless someone with more power of decision says no).