Udasi
TypeError at /cart/ expected string or bytes-like object
I would try checking which line is causing that error in the view method, using print statements or something
Jb
I would try checking which line is causing that error in the view method, using print statements or something
order, created = Order.objects.get_or_create( customer=customer, complete=False)
Bunty chhatri wala..
Can i make api request on heroku? Using requests library? I tried in pyanywhere but it was not whitelisted on their server.
Aizwal
Did you updated your Django in the Middle of project?
Muthu
No
Aizwal
Check you database and try migration again
Muthu
https://del.dog/eaphaceger.txt
Muthu
I already tried
Muthu
It work for non foreign key
Udasi
order, created = Order.objects.get_or_create( customer=customer, complete=False)
probably is about the Order model. the customer field or complete field needs string
Udasi
Did you import Sneaker class?
it's Item sorry lol
Anonymous
I'm beginniner on djngo // have any suggestions for me
D
Guys anyone ????
Deploying to Heroku can be painfull (first time) My cheat-sheet includes following bits: — do you have gunicorn (or another server) in pipfile? — did you migrate DB? — does it have all required ENVs? — does it start in production? (provide full error if you want some help)
Anonymous
Need someone now it's a paid task for 20 dollar
Anonymous
5 questions of python
Anonymous
Anyone here
Jesus
if I am going to create a full api-based web application, wouldn't be Flask better than Django? I read on internet Flask has a better performance over Django but I wanted to ask you guys, as I am currently using Django but without API implementation.
D
As I get it, Django has more buit-in tools, but I'm jr.)
Sandeep
Guys can we create multiple email servers in Django?
Bakhtiyar
https://www.linkedin.com/posts/keibynguyen_nguyen-dang-khoa-cv-update-ugcPost-6676049853304438784-ipop
Jesus
Ya, flask is faster than django but it wont have as many inbuilt functions as of django. Like Models , users panels , admin panel
I see, I think I will probably split the whole application, using Flask for those bits that needs better performance
Anonymous
Done already sorry brother
Gil
Hi, I have problems with Django tests, my db is postgres and I can't start django_test because table auth not created during test start. Any idea or experience configuring tests in local or other db? Or how to solve that? I have executed migrate auth but nothing better.....
Gil
I'm not sure, but have you created test DB itself? createdb test_db_name
I think that it is done in startup test django. I would like to change the test db for another
Gil
I think that it is done in startup test django. I would like to change the test db for another
If i inspect db, the db is created, there s a problem with relation auth_user
Gil
Did you use postgres in development? If not how hard is the migration from sqlite to postgres as I plan to try soon?
You need to first construct all db and tables, and then migrate all data, you can use dumpdata and loaddata. There are manuals at google
D
Did you use postgres in development? If not how hard is the migration from sqlite to postgres as I plan to try soon?
I had it on Rails, and transition was a bit painful, so I decided to always use same as production set for dev)
Anonymous
👍👍
bahaa eddine
please I want to ask you what's the best way to apply an idea of a website ? 1-Alone 2-Team
ROG 💻
Hello friends, how can I have an audit of my django models?
ROG 💻
yesterday I tried to do with a base model, which I was importing in all my models from my app, but nevertheless I get an error when doing migrations
ROG 💻
this would be the mistake when doing the migrations
ROG 💻
only in one of my models could he create the fields of the base model
Abba
Any one work with openvino and django?
Abba
How to integrate an Image Recognition Apparel Prediction Web App using Convolutional Neural Network(CNN), with django?
Manish
Hello, I have one issue.. I am trying to save record 4m form to admin panel. But only one record can be created. If I tried to create another record with same user then it could not create
Anonymous
Hii guys When I try to makemigration it's not applying ,it's only displaying select options ..
Anonymous
Help me
محمد دلشاد
Hii guys When I try to makemigration it's not applying ,it's only displaying select options ..
first of all its makemigrations and lastly to apply migrations you have to run migrate command like python manage.py migrate
Anonymous
Ok
Prakash
guys I have a question when to use view's create function when to use serializer's create function?
Prakash
class ToDoViewSet(viewset): queryset = ToDo.objects.all() serializer = ToDoSerializer def create(): when to use this********** class ToDoSerializer(viewset): class Meta: model = ToDo fields = 'all' def create(): when to use this*********
Abba
So how do you have the web app set up?
Landing page and simple form for uploading images
b
hey guys, I've built a website that sends mass emails to list of emails. I've set login, registration and decorators. I wanna do something like, when a new user register, it will have their own new data as they use the site, but I'm not sure hot to do that, help me out here. I'll post code if required.
wanderer
I deployed django web app to heroku but the js files are not working I gave followed the white noise documentation steps as well the css is working after that But js files are still not working
wanderer
Now i realised actually the css is also not working The page i was on had been styled in the .html itself
wanderer
How do i get these static files up and running
wanderer
# Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.0/howto/static-files/ STATIC_URL = '/static/' STATICFILES_DIRS =[ os.path.join(BASE_DIR,'static'), ] STATIC_ROOT = os.path.join(BASE_DIR,"staticfiles") STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
wanderer
MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ]
wanderer
this is my settings.py
Alex
Hey guys, I created permission and use it in user, user.user_permission.add(myperm) then when I check using user.has_perm(myperm) it retunring False you know why? thanks
Shubham
Did you give the used that permission?
wanderer
start your search from here
wanderer
it will help in restriction of users to access certain view fns
b
can I share my code here?
wanderer
ive add all those
whats the isssue then?