How to make a website with Python and Django - MODELS AND MIGRATIONS (E04)

  Рет қаралды 18,551

Hacker Shack

Hacker Shack

Күн бұрын

Пікірлер: 67
@LinsLouis
@LinsLouis 3 жыл бұрын
At 4:38 new import appeared "from django.http import HttpRequest, HttpResponse" and "def index(request): print(request.user) return render(request, 'index.html') " changed to "def index(request: HttpRequest) -> HttpResponse: return render(request, "index.html")" similarly, below in views.py. Why it is not explained?
@johanstovring
@johanstovring 4 жыл бұрын
hello I can't find the part about the setup.cfg, can you help me?
@albythekkedan
@albythekkedan 3 жыл бұрын
Why is it showing Improperly Configured cannot import accounts
@albythekkedan
@albythekkedan 3 жыл бұрын
My AccountsConfig.name inside apps.py of accounts may not be correct ,and i can't find that part in this video,can anyone show
@albythekkedan
@albythekkedan 3 жыл бұрын
So i am not able to migrate
@robertlink198
@robertlink198 3 жыл бұрын
​@@albythekkedan I got stuck there too, in accounts/apps.py the name needed to be the full module path identical to what was entered on line 41 of settings.py under installed apps
@mathmeup561
@mathmeup561 3 жыл бұрын
changw in apps.py name="accounts" by name = 'Hacker_website.apps.accounts'
@maxpeterson9886
@maxpeterson9886 3 жыл бұрын
@@robertlink198 Thank you.
@黄胜衍
@黄胜衍 2 жыл бұрын
At 31:39, can I know where to create the "user" from the request.user.profile.interest. I cant define the 'user' attribute
@nadeemsaif6507
@nadeemsaif6507 3 жыл бұрын
Hey man, I just wanted to say, these are some great vids..... I'm a little slow to understand so there is a littel part that I completely missed :) When you reorganized the routes, (public and accounts), in the navbar html we were supposed to do the same thing we did with the public app, where we changed the "url 'contact' " to "url 'public:contact' " I forgot to do that with the accounts app since i was following the tutorial frame by frame😅 i guess that was on me, so whenever I tried to login it kept redirecting me to the page i was already on, but i fixed it now...... I'm a noob uni student 🙆‍♂️ Anyways, great quality man keep it up, I've been binge watching your playlist for a week now....
@st3n007
@st3n007 3 жыл бұрын
i have the same problem :/ what did you do then?
@nadeemsaif6507
@nadeemsaif6507 3 жыл бұрын
@@st3n007 in "Settings.py" scroll to the end of the file and make sure that this line exists: (LOGIN_URL = "accounts:login") Then go to your "navbar.html" file and update this line from: {% url 'login' as login_url %} To: {% url 'accounts:login' as login_url %} And do the same thing with (url logout)..... . . . Thats only if u have the same problem...
@st3n007
@st3n007 3 жыл бұрын
@@nadeemsaif6507 omg thank you so so much, now it works!!, can i add you? :)
@albythekkedan
@albythekkedan 3 жыл бұрын
@@nadeemsaif6507 Worked mahn Thank You, I was having same issue
@albythekkedan
@albythekkedan 3 жыл бұрын
also i forgot to give accounts:profile as profile_url ,now i corrected it
@Kwatch
@Kwatch 3 жыл бұрын
your explanation is very detailed well done
@swissshooter233
@swissshooter233 3 жыл бұрын
Cannot migrate the project, as I'm getting the following error: Does anybody have an idea on how to fix? ModuleNotFoundError: No module named 'accounts' During handling of the above exception, another exception occurred: django.core.exceptions.ImproperlyConfigured: Cannot import 'accounts'. Check that 'hackershack_website.apps.accounts.apps.AccountsConfig.name' is correct.
@rudyjohari7338
@rudyjohari7338 3 жыл бұрын
I have the same one too did you find a solution? I read up to change the app name to "apps.accounts" instead of "accounts" but it still didn't work :(
@ThEmIsErAbLeGaMeR
@ThEmIsErAbLeGaMeR 2 жыл бұрын
did you end up fixing this?
@Bemam0406
@Bemam0406 2 жыл бұрын
@@ThEmIsErAbLeGaMeR from Django 3.2 to later, In your apps: name = 'Project\folder\accounts'
@alddan098
@alddan098 2 жыл бұрын
@@ThEmIsErAbLeGaMeR Had this same issue. Fixed it by changing the 'name' variable under the apps.py file to: name = 'projectName.folder.accounts' I tried the suggestion that thịnh đồng vĩnh made in another comment but it didn't work. Had to use periods rather than \ or /. So for the example in the video it would be: name = 'hackerhshack_website.apps.accounts'
@darbyblum8027
@darbyblum8027 9 ай бұрын
After reorganizing at the beginning, I can no longer reach my profile page unless I manually type /accounts/profile in the URL. Any tips?
@ilyazlatkin4594
@ilyazlatkin4594 Жыл бұрын
Thank you for the tutorial. I have a question. I want to create an app that has a text field and button. When you hit a button, it runs a third-party-long script (let's say ML). When the script is running, the app should display the "processing-loading," and when it is ready, it should return the script's HTML. Does anyone know any project I can reference or and template?
@murrays1347
@murrays1347 2 жыл бұрын
Thank you for this hands-on tutorial. I've been following along as much as I can and have a couple of questions. Can this application be scaled up to accept files of various formats from users over the web? I'm considering developing an app to track missing people (outside US) and would need to capture information about victims including audio/video, and create links between victims where applicable. Also, what is the purpose of the requirements folder? So far I haven't seen it being used.
@kiaehe6292
@kiaehe6292 3 жыл бұрын
I hate the reorganizing part he is just moving too fast frustrating as hell
@hackershack
@hackershack 3 жыл бұрын
Have to move fast to get through content in a reasonable time. Try slowing the video down to .75 speed
@CitizensCommunity
@CitizensCommunity 2 жыл бұрын
Do this, k, now forget that and do this instead. I get that it is needed to explain the setup and the why, but it is also confusing and doing so really fast makes it worse. Who is this for, is it beginners or a refresher? You are doing a great job explaining things, so I guess we are just wanting to hear you talk even more.
@augustuscall3057
@augustuscall3057 2 жыл бұрын
@@hackershack I have to agree here. The explanations themselves are generally excellent, but you *have* to start doing that with the reorganization on future projects if you haven't already. It's the equivalent of trying to learn a new level or area of mathematics and the professor is not showing their work or explaining what they're actually doing to an equation to simplify it. It added an unnecessary amount of frustration and confusion to what was otherwise a good walkthrough.
@dominiq2345
@dominiq2345 4 жыл бұрын
When I did makemigrations, it says no changes detected even tho I added path in INSTALLED_APPS in settings, help pls
@zavio3199
@zavio3199 3 жыл бұрын
very inforative and helpfl video, thankyou very much
@Calmulification
@Calmulification 3 жыл бұрын
very great tutorial thanks
@miladata6383
@miladata6383 2 жыл бұрын
Hi, I am following your videos step by step, they are really good. However, I have a bug and I can't solve it yet. It is this: Exception Type: NoReverseMatch Exception Value: Reverse for 'login' not found. 'login' is not a valid view function or pattern name. I put the line error here: Ingresar{% endif %} Can you help me, please
@EndlesRidge
@EndlesRidge 2 жыл бұрын
bruh, literally just do the same thing to everything he did to public:stuff but instead with accounts
@yukaihuang1622
@yukaihuang1622 2 жыл бұрын
I have got the same error, but mine was 'Reverse for 'logout' not found.' Did you find the solution? Thank you! dang~ I fixed it. I guess it was on me. Forgot to put
@miladata6383
@miladata6383 2 жыл бұрын
@@yukaihuang1622 Yes, i'm not doing the project now but it was all chaos when change the database to postgres :( i had problems with some packages as psycopg2
@FARAHEED
@FARAHEED 4 жыл бұрын
at the end of the video in the "with" sign make sure to not add space between profile and the equal sign so it should look like smth like this {% with profile=user.profile %} and this {% with website=profile.website|default:"" %}
@renatoacunacornejo6782
@renatoacunacornejo6782 3 жыл бұрын
Thanks!
@jonasholmgaard5464
@jonasholmgaard5464 3 жыл бұрын
black . is not a command when i type into my terminal :((
@mathmeup561
@mathmeup561 3 жыл бұрын
use black file_name.py or black folder_name/
@jonasholmgaard5464
@jonasholmgaard5464 3 жыл бұрын
@@mathmeup561 thank you!! i realized i actually needed to install black, i didn't know that was something you had to do
@mathmeup561
@mathmeup561 3 жыл бұрын
@@jonasholmgaard5464 Yes!! sometimes a lot of details are missing in the videos but overall its good video series for a advanced programer
@dickiefinehuman5269
@dickiefinehuman5269 2 жыл бұрын
yeah you have to brew install it.
@KevinTempelx
@KevinTempelx 4 жыл бұрын
Thank you!
@lyricsmint567
@lyricsmint567 4 жыл бұрын
I had my login implementation straight from documentation, now on I will follow your tutorials
How to make a website with Python and Django - BASICS (E01)
17:45
Hacker Shack
Рет қаралды 292 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 97 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 25 МЛН
How to make a website with Python and Django - LOGIN (E03)
26:03
Hacker Shack
Рет қаралды 26 М.
How to Make a Raspberry Pi Smart Bartender
15:09
Hacker Shack
Рет қаралды 982 М.
Django To Do List App With User Registration & Login
2:12:03
Dennis Ivy
Рет қаралды 342 М.
🚀  TDD, Where Did It All Go Wrong (Ian Cooper)
1:03:55
DevTernity Conference
Рет қаралды 571 М.
Python Django Web Framework - Full Course for Beginners
3:45:41
freeCodeCamp.org
Рет қаралды 4,7 МЛН
How to display Data from any API in Django template | using Requests
4:53
Develop With Coding
Рет қаралды 68 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 97 МЛН