Isaías
Ok. Thank you.
Михаил
Hi! I'm validating model in the manager's method. But it doesn't throw validation error for MaxLengthValidator and unique constraint
Михаил
http://dpaste.com/241FVP6
Михаил
Why it doesn't throw validation errors on instance.full_clean()?
Mohit
NoReverseMatch at /
Reverse for 'user_logout' not found. 'user_logout' is not a valid view function or pattern name.
Request Method: POST
Request URL: http://127.0.0.1:8000/
Django Version: 2.2.3
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'user_logout' not found. 'user_logout' is not a valid view function or pattern name.
Mohit
i am getting this error on adding a function
Mohit
def user_logout(request):
#logout(request)
return HttpResponseRedirect(reverse('home'))
Mohit
in view.py function
Mohit
& this in my html file
<a href="{% url 'verveapp:user_logout' %} class='btn display-block font-normal btn-danger'>
<i class='glyph-icon icon-power-off'></i>
gamer_boy
hi guys, i am making django quiz app. in which i want to filter questions which have same quiz name .plz tell me how to write view for that
gamer_boy
class Quiz(models.Model):
title = models.CharField(max_length=20)
description = models.CharField(max_length=100)
def str(self):
return self.title
class Question(models.Model):
set = models.ForeignKey(Quiz,on_delete=models.CASCADE)
question_txt = models.CharField(max_length=100)
def str(self):
return self.question_txt
class Choice(models.Model):
question = models.ForeignKey(Question,on_delete=models.CASCADE)
choice_txt = models.CharField(max_length=20)
boolean = models.BooleanField(default=False)
def str(self):
return self.choice_txt
gamer_boy
i want to show them in one page
gamer_boy
yes
godmode
Here an easy one: How do you do guys to load an static folder in each app and the files inside fo theses static folders would be load separetly... doesn't mayyer if both of them got a style.css file... this one should load for each app...
Mirco
Without reloading page ?
Mirco
ok so you will have values into POST data or if u are using django forms into cleaned_data
Mirco
Share your current code using pastebin or similar
godmode
it's posible two css files with the same name /apps/app1/static/css/style.css and /apps/app2/css/style.css?
Dark Monster
Can anyone tell me where can i learn django and angular together
cj
Dark Monster
I learned django and angular now i want to combine them
Dark Monster
Drf?
cj
Alexey
Drf?
django rest framework
Dark Monster
Ok
Dark Monster
I will learn
Mitesh
How... To use online compiler?
Mean how to embed online compiler in my website as like hackerrank or hackerearth
Anonymous
godmode
Anonymous
How can i do It?
you can have for any app a folder in your template and statics and most use it addres in html files
godmode
Loading the url directed you mean?
Mitesh
Mitesh
Have u visited hackerrank or codechef or hackerearth website..
Anonymous
Mitesh
Ohk..
Mitesh
no but i use python any where
Have u understand my concept..?
I want to develop same as that of hackerrank..
Where there will be multiple challenge. And user can.. Select and..
And choose language " any "and code
Anonymous
Mitesh
Which api?
Mitesh
Send link plz..
cj
🙄
Mr.Robot
How can i use break statement in for loop in template
Mirco
Mr.Robot
Alright
Mr.Robot
How can i do that
godmode
Guys, sometimes i hate django... i made a table and i made an atribbute calle blog_name... makemigrations and migrate , registered in admin and everything is okey... then i change the blog_name for blog_title and i made another makemigration and migrate and know it lets me add this table
godmode
but when i list in admin it's says 'Settings' (it's the name of the Model) has not attribute 'blog_name'
godmode
and i've already know that i changed and i made a migration... i don't understand django sometimes
Mirco
godmode
migrations.RenameField(
model_name='settings',
old_name='blog_name',
new_name='blog_title',
),
godmode
can i remove the migrate file and make a migration?
godmode
and initial one
godmode
an*
godmode
i removed all and it keeps doing me the same
Mirco
Try to include db_column into the new model field
Mirco
And re-run make and migrate
godmode
godmode
'Settings' object has no attribute 'blog_name'
godmode
and it says
godmode
In template C:\Users\godmode\Desktop\django\myvenv\lib\site-packages\django\contrib\admin\templates\admin\base.html, error at line 62
godmode
Fuck
godmode
sorry django it was my fault.... the str method returned the field blog_name
Mirco
😂
godmode
sometimes life makes hard...
godmode
and we make it even harder
godmode
thanks @pyflare
Mirco
thanks @pyflare
Yw 😊
Write tests, so you shouldn't have so many problems like that
godmode
hahaha ok, i'll make it!!
Anonymous
Hi guys i am facing an error
Anonymous
django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
Anonymous
please help me out...
cj
Anonymous
Anonymous
python settings.py runserver
cj
it's with manage.py instead
Anonymous
but i am trying API in python consol