Anonymous
Then Django
inchidi
>>> UserProfile.objects.create(user=usr, ...) What's this for? And when should I use it?
after you done creating you UserProfile model, migrate it. you can add the data to database via shell
Yashwant
Ohh in shell, ok!
inchidi
Ohh in shell, ok!
but make sure you done with the migration thingy first
Yashwant
I think you need to learn python first
We have to submit this project in the coming 2-3 days, and we've only been taught till functions in the language of Python.
Yashwant
And this is a 4 member project, of which I'm working alone.
Anonymous
Yes.
That's shit
Anonymous
What are your teacher expecting from you.
Yashwant
That's shit
BlameTheSystem ;__;
Davo
Yeah!
So are you supposed to do it in web2py or was that just recommended?
Yashwant
That's why I'm kinda relying on you guys to help me out.
Davo
Ohhh
inchidi
at least you are not wrong in choosing django for your one week project
inchidi
Recommended.
did you know another recommended things? move on to python3 :3
Yashwant
did you know another recommended things? move on to python3 :3
Yeah that's what I'll be doing after I'm done with this 😂
Yashwant
Hey umm @DimasInchidi can I PM you?
inchidi
Hey umm @DimasInchidi can I PM you?
just ask here, no problem even if its simple/could be dumb question as long as its about django
Yashwant
Ok!
Yashwant
Fuck!
Yashwant
Ok
Anonymous
first of all. Stop using python2
Yashwant
I'm in the middle of a project man, I'd love to do that but not right now. 😓
Yashwant
And also, if anyone can contribute I'd be more than greatful https://github.com/Y45HW4N7/profile-management/tree/wip
Anonymous
the hierarchy of you project is pretty fucked up
Anonymous
you shouldn't have used django at first
Yashwant
Not knowing web development/frameworks, that was the best option I had.
Anonymous
you should have used flask
Anonymous
Btw what's your project about?
inchidi
just change birthdate="1987-12-17"
Yashwant
Btw what's your project about?
It's a Personal Profile Management System. It allows the user to add/edit/view their data, which is protected by a username & a password.
Anonymous
it's only a small project
Anonymous
no production
inchidi
with user and login function, with django you can do this with less than 10 lines of code tho
Yashwant
it's only a small project
For you, but for a guy with not even half the knowledge of python maybe not?
Yashwant
inchidi
Still the same error
same error? weird. screen shot please
inchidi
but you are not change anything yet there
inchidi
just change birthdate="1987-12-17"
i told you this^ you forgot the "
Yashwant
i told you this^ you forgot the "
Ohh have to give it as a string?
inchidi
lol yes
Yashwant
😅
Yashwant
👌🏼
inchidi
because you are using python2. use __unicode__ instead __str__
inchidi
move on to python3. its not take much time, just install python3
inchidi
Yashwant
move on to python3. its not take much time, just install python3
I don't mess things up in the midst of this already messy project. But seriously tho I soo wanna move to python3. Just waiting to finish this and I'm done with 2.
inchidi
ah okay i think the return must be return str(self.age) + '-' + str(self.location)
inchidi
but am not sure, i never use py2
Yashwant
Yes!
Yashwant
@DimasInchidi a question. Should I just use the Django interface for the user (not the admin) to enter their details in and for the user to login/edit/view? Instead of creating a HTML page using urlpatterns? And also wouldn't that make it easier?
Yashwant
with user and login function, with django you can do this with less than 10 lines of code tho
Here, you said that user & login functions can be done in a few lines. So what I'm asking is, can I use the Django's template for user sign up/login/edit/view, instead of creating an entirely new template for the user?
Yashwant
Ohh ok
inchidi
but django provide login logout register views which is python function
Yashwant
So best way is to create a template using the urlpatterns & go in that direction?
inchidi
you can use those function and make it pretty with your template
Yashwant
with user and login function, with django you can do this with less than 10 lines of code tho
And also what exactly did you mean by the 10 lines (approx) of code?
inchidi
i can give you example about that but later
Yashwant
Ok sure! Whenever you are free.
Yashwant
Is it possible to create a template, and then link that up with Django/the database? For example, I need to create a entry form which takes in details of the user & I do that using a bootstrap builder. How can I connect these two (the database and the frontend/form template)?
Ghazwan
Create a list and detail views
Ghazwan
in your html template <a href='{% url 'yourapp_namespace:your_detail_name pk=object.pk' %}<li>{{object}}</li></a>
Ghazwan
after iterating through your {{object_list}} using for
Ghazwan
you will be using some weird-looking regex in your urls.py too url(r'^(?P<pk>\d)/$', views.EntryDetailView.as_view(), name='detail')
Yashwant
ok will try this
Anonymous
Okay, I installed django. But it doesn't appear!