Skip to content
Advertisement

Tag: django

python manage.py collectstatic error: cannot find rest_framework bootstrap.min.css.map (from book ‘Django for APIs’)

I am reading the book ‘Django for APIs’ from ‘William S. Vincent’ (current edition for Django 4.0) In chapter 4, I cannot run successfully the command python manage.py collectstatic. I get the following error: I have the exact same settings like in the book in settings.py: I couldn’t find any explanation for it. maybe someone can point me in the

How do I solve django.db.utils.IntegrityError: UNIQUE constraint failed?

How do I solve django.db.utils.IntegrityError: UNIQUE constraint failed? error code is django.db.utils.IntegrityError: UNIQUE constraint failed: Movies_comment.user_id, Movies_comment.tv_or_movie_id. This error occurs Comment(comment=form.cleaned_data[“comment”],user=request.user,stars=form.cleaned_data[“stars”],tv_or_movie=tv_or_movie_object).save() views.py models.py helper_views.py Answer tv_or_movie before saving i.e.

python manage.py collectstatic not working: TypeError: sequence item 0: expected str instance, NoneType found

I have been following this video on Youtube: https://www.youtube.com/watch?v=inQyZ7zFMHM1 My project so far is working fine with static files and all the files load and work properly. So, now I have to deploy the website on Heroku and for that, I uploaded the database on Amazon AWS using this video. After bucket creation, I did the configurations as mentioned in

Django – fresh database and no such table

I’m using my complex jobs app in production and it works fine, with sqlite database. I’m trying to create new database from scratch and I cannot do that nor using migrations nor trying to make them once again: When I’m trying to reuse my migrations: When I’ve tried to remove all migration files: How can I investigate what is going

Django test uses wrong database in some cases

I try to setup my Django tests, and I noticed that when I run all tests TestRunner uses correct test database (for all aliases): docker-compose exec my_project python manage.py test –keepdb But when I run tests for specific module, it uses the original database: docker-compose exec my_project python manage.py test –keepdb apps.my_module What is the reason of such behavior? Using

Django multiple params link

I have this urls.py first path with one args works good with reverse func in some file how i can do this -> from …/calendar/2020-01-01 to …/calendar/2020-01-01/100 in template without using context and 2 args like url ” ” date arg2 something like <a href = “{% url ‘schedule’ *** %}> tries reverse full path with two args Answer If

Advertisement