Anonymous
like aws , pythonanywhere, ets
Anonymous
*etc
Dilli
How to call AI model in django pls anyone help
sravan
How to call AI model in django pls anyone help
You call inside views.py by importing
Dilli
You call inside views.py by importing
Without django i will call predict to get the result of AI. Like wise how to use in django
Raam Goulikar
Without django i will call predict to get the result of AI. Like wise how to use in django
You need to save the trained model as a pkl file and load the model again and call predict method
Maksim
можно ли как то сделать чтобы ckeditor не изменял шрифт? был только один
Luis
You should provide a User instance... try just using DonorRegister
Luis
Upload your code to pastebin and share it (DonorRegister model, your view, form, etc)
Luis
The problem here is your are trying to store a wrong data type
Luis
Let's see where is the problem
Luis
Sorry. my english sucks...
Shikhar
Suppose I've saved an image url in admin panel how can I use it in my template
Shikhar
Like I declare image_url in models. Then when we have to save post instead of taking file from the system I directly put url on the feild
Anonymous
Just get that image_url from object
Shikhar
I use article as object. " article.image_url " is that correct
Anonymous
In your views.py articals=ModelName.objects.all() In html template {% for artical in articals %} <img src="{{artical.image_url}}"> {% endfor %}
Anonymous
In your views.py articals=ModelName.objects.all() In html template {% for artical in articals %} <img src="{{artical.image_url}}"> {% endfor %}
If you want to get image of specified artical then in views.py artical=modelName.objects.filter(id="artical Id") return render(request,'templateName.html,{'artical':artical}) Then in templateName.html <img src="{{artical.image_url}}" > Then in templateName.html {
Anonymous
In your views.py articals=ModelName.objects.all() In html template {% for artical in articals %} <img src="{{artical.image_url}}"> {% endfor %}
* in views.py you have to render the page like return render(request,'templateName.html',{'articals':articals})
Shikhar
Do I've to use media_root
Anonymous
you just have to modify your views.py and template
Felix
short question… if i have an message model is it better to create a simple Integerfield for senders and recievers ID or should i use two foreignkeys? like this: user_writer = models.ForeignKey('User', related_name='%(class)s_user_writer', on_delete=models.CASCADE, default=None ) user_recipient = models.ForeignKey('User', related_name = '%(class)s_user_recipient', on_delete=models.CASCADE, default=None )
Денис
but related_names are strange. I'd rather use just "messages_written" and "messages_received"
Mikhail
https://github.com/daviddrysdale/python-phonenumbers Who 've been working with this library? I need to add one more template , besides already existing E. G I want to consider number that starts with 8XXXXXXXXXX as valid Not only +1XXXXXXXXXX , that already settled in settings
Денис
https://github.com/daviddrysdale/python-phonenumbers Who 've been working with this library? I need to add one more template , besides already existing E. G I want to consider number that starts with 8XXXXXXXXXX as valid Not only +1XXXXXXXXXX , that already settled in settings
First: this is offtopic and shouldn’t be discussed here. Second: +7/+1/+whatever is a country code while 8 is a workaround for fixed phones to dial certain phone numbers. Say, in Russia you have to dial 8-10-1 on a fixed phone instead of +1 on a cellphone Your proposition will certainly make a total mess.
Logan
I have created the Apis for jwt auth but how i can use it in django or flask just like we use it in react-redux to keep track of the token?
Logan
I Have created the APIs in flask
Raad
https://pastebin.com/fAhWZ9JQ Hello, I need to to fix this error. TypeError: create_superuser() missing 1 required positional argument: 'username'
Raad
I want use email address as a username
SD
Try this user = self.create_user(username=email, password=password)
Raad
Try this user = self.create_user(username=email, password=password)
I tried it before and Pycharm said unexpected argument and got same error
Денис
I want use email address as a username
Probably you want to authenticate using email address as login. It’s different.
SD
I tried it before and Pycharm said unexpected argument and got same error
Check with ACCOUNT_AUTHENTICATION_METHOD ='email'
SD
In setting.py
Raad
Probably you want to authenticate using email address as login. It’s different.
I'm following this example from offical Django docs https://docs.djangoproject.com/en/2.2/topics/auth/customizing/#a-full-example
Raad
Still getting same error
Raad
AUTH_USER_MODEL = 'app.Users' I have line in the setting too
ℕo ℕame
I'm customaizing user model and override it
You should set custom manager With overrided field REQUIRED_FIELDS = []
Raad
You should set custom manager With overrided field REQUIRED_FIELDS = []
I have these lines in the Users model object = UserManager() USERNAME_FIELD = 'email' REQUIRED_FIELD = 'email', 'password', 'phone_no'
Raad
You mean I need to move them to the UserManager model?
raven
user client side programming for that i.e js
Ayomide
Please can anyone help with deploying django apps to heroku?
Doragonsureiyā
Please can anyone help with deploying django apps to heroku?
Please don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello I need help on $z" Just ask about your problem directly! With 43k+ people the probability that someone will help is pretty high. Also please read: http://catb.org/~esr/faqs/smart-questions.html
Ayomide
Who has a very clear explanation on class based views...or where i can learn from
Ayomide
Most tutorials dont cover all the use cases
Денис
Who has a very clear explanation on class based views...or where i can learn from
Docs. Clearest of all explanations. Django by Example will help as well
Ayomide
Docs. Clearest of all explanations. Django by Example will help as well
Ive checked them out..... I still find some use cases that always seem strange again
Денис
Ive checked them out..... I still find some use cases that always seem strange again
I'm not the best explanator, but you're free to share your doubts in this topic
raven
Most tutorials dont cover all the use cases
just django, pretty printed ,documentation and once you are familiar use ccbv.co.uk for reference
Vahe
Hello guys, How can I save text(which contains html tags) in the database and then use it with the tags. For example the following: <h2>title of the text</h2> <p>dnnfjfkifjdnfkfijdj</p>
Doragonsureiyā
Who has a very clear explanation on class based views...or where i can learn from
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
cj
Hello guys, How can I save text(which contains html tags) in the database and then use it with the tags. For example the following: <h2>title of the text</h2> <p>dnnfjfkifjdnfkfijdj</p>
when you're gonna render it on the template, use |safe tag in the field, example: {% model.text_field|safe %} that would make the HTML tags to be applied the way you want
cj
So is it okay to have html tags saved inside db?
if you're sure they won't break your page, you can
Luis
Please, next time don't upload your code here. Use pastebin and share the link. In your model, uname is a ForeignkeyField to User model. In your view you are trying to assign POST['username'] to uname and this is wrong. You should query database for the User (filtering for that username) and use the User instance as uname to create your model.
Anonymous
It is similar to del.dog and hasteb.in
Ghorz
https://duckduckgo.com/?q=what%20is%20pastebin&ia=about
Jigani
Hey guys! Anyone knows how to go about building an e commerce site with Django.... I'm a beginner, just finished successfully building the polls app from the documentation...:-)
Ghorz
Hey guys! Anyone knows how to go about building an e commerce site with Django.... I'm a beginner, just finished successfully building the polls app from the documentation...:-)
Don't post homework questions Hackers are good at spotting homework questions; most of us have done them ourselves. Those questions are for you to work out, so that you will learn from the experience. It is OK to ask for hints, but not for entire solutions. Resist the temptation to close your request for help with semantically-null questions like “Can anyone help me?” or “Is there an answer?” First: if you've written your problem description halfway competently, such tacked-on questions are at best superfluous. Second: because they are superfluous, hackers find them annoying — and are likely to return logically impeccable but dismissive answers like “Yes, you can be helped” and “No, there is no help for you.” In general, asking yes-or-no questions is a good thing to avoid unless you want a yes-or-no answer.
Luis
Hi guys! I'm working with django admin, A model with ManyToManyField (using TabularInLine widget) and m2m_change signal. I found some limitations with this technique 'cause m2m_change is not triggered (https://cutt.ly/0ek67Sn). How can I keep my TabularInLine and trigger from admin m2m_change manually ?
Aleksey
Hello everyone! I have been trying to set mysql for django project. Last time I did it successfully and project worked correctly. But I had to reinstall Windows and now I start project again. So, I face some troubles. At first, django asked me to install mysqlclient. I did it and than next error followed: Microsoft Vissual C±+ is required. I did it too. When I start manage.py runserver Visual Studio are running instead of server working. Could anybody advise how to solve it? I use Python 3.7 (64 bit), Installed with VS
Aleksey
Ok, you need mysqlclient and it requires C++ compiler. You installed all the requirements. So, what error message you are getting right now?
Now I have no error, but instead of usual message Starting development server at http://127.0.0.1:8000/, Visual studio starts with empty window
Aleksey
Yes
Luis
Yes
Does it work?
Aleksey
Does it work?
Unfortunately, no. VS starts working