Maksim
share the full traceback
Traceback (most recent call last): File "C:\Users\makcu\PycharmProjects\bookmarks\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner response = get_response(request) File "C:\Users\makcu\PycharmProjects\bookmarks\venv\lib\site-packages\django\core\handlers\base.py", line 115, in _get_response response = self.process_exception_by_middleware(e, request) File "C:\Users\makcu\PycharmProjects\bookmarks\venv\lib\site-packages\django\core\handlers\base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\Users\makcu\PycharmProjects\bookmarks\account\views.py", line 78, in user_profile user = User.objects.get(username=username) File "C:\Users\makcu\PycharmProjects\bookmarks\venv\lib\site-packages\django\db\models\manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "C:\Users\makcu\PycharmProjects\bookmarks\venv\lib\site-packages\django\db\models\query.py", line 408, in get self.model._meta.object_name django.contrib.auth.models.User.DoesNotExist: User matching query does not exist.
Master
pdb before this line in views.py and check what exactly username is. Your pastebin doens't related to this problem
Master
user = User.objects.get(username=username)
Naveen
teamviewer
Maksim
print shows my nickname
Master
If there is everything will be ok, this line doesnt appear in your traceback.
Master
https://docs.djangoproject.com/en/2.2/ref/models/instances/#django.db.models.Model.DoesNotExist
Master
And this is single line in your traceback which not a django package.
Maksim
I made everything right
Maksim
but it doesnt work
Naveen
you need to use
Naveen
request.user.username
Maksim
i made it
Maksim
it didnt help me
Maksim
Anyone help me??
inchidi
and? I dont understandt
can you find the file specified in that error?
Maksim
yes
Maksim
def user_profile(request, username): user = User.objects.get(username=username) return render(request, 'account/profile.html', {'user': user})
Maksim
no
Maksim
user exists
Maksim
i have another form and it works
Maksim
image_create page shows me username.
inchidi
https://stackoverflow.com/questions/40222268/valueerror-in-django-when-running-the-python-manage-py-migrate-command
inchidi
this is my question
inchidi
plz forward it to the group
inchidi
i have another form and it works
then try print the username (before User.objects.get) and check whether passed username already correct
inchidi
user exists
how can you so sure? you need to check it first
Maksim
all correct
inchidi
Maksim
I'm sure that this nickname exists, because I have detail page of user and edit page one
Maksim
and there everything works
Maksim
it must works this is mystic
inchidi
it must works this is mystic
dont assume, check it
Maksim
what???
Maksim
I did it
Maksim
it shows me my nickname + i use login_required in my view
Maksim
console print nickname
Maksim
I broke django
inchidi
it shows me my nickname + i use login_required in my view
which view you check? user_profile or image_upload?
Maksim
both
inchidi
def user_profile(request, username): user = User.objects.get(username=username) return render(request, 'account/profile.html', {'user': user})
focus on this view, the error raised in this view. you are passing username from url and user with that username doesn't exists
Maksim
I tried to create a new user and I got a mistake: save() prohibited to prevent data loss due to unsaved related object 'user'.
inchidi
request.user.username != username
Naveen
deleting everything datase migrations and all cache files
Naveen
then migrate again
Naveen
it may be database error if and only if everything at your end is correct
inchidi
I tried to create a new user and I got a mistake: save() prohibited to prevent data loss due to unsaved related object 'user'.
i dont have sixth sense, cant help you without full traceback. this error different with error you provide earlier. please know your own error first
أمجد☄
I keep the default theme
Well i can create my own theme using html css, so can i link it so that the theme is only from me but all the backend is based on the django admin panel
Ashutosh
Hello beginner here
Ashutosh
Can I share my small project here
Ashutosh
And can anyone solve my CSS file error
Master
Put your project on github, error in pastebin and share links with us
Mirco
You can share the error here using pastebin or similar
Ярик
hey guys, i have a problem, hope you'll help me i have a django app deployed on the server, it has only an admin pannel there is a model in it and i've already made more than 150 posts to it admin pannel shows only 100 posts on 1 page and if you i want to see more or all of them, there are buttons down bellow the problem is that theese buttons are now working on my site, also sorting by model field, search field and other staff is now working what can cause the issue? (there are no errors in trace report on debug=true and there are no messeges in js console)
Ярик
pressing on any button refreshes the page, besides "add a post" and delete post choice, they are working correctly
OUHBOY
hi guys am getting permission denied while trying to runserver django what could be issue here??
Muflone
Read only database?
Ivan Putra
How to load image from media on views to variable
Ivan Putra
I hv been searching and everything doesn't work
Anonymous
hi guys i looking for a unit test writing tutorial
Anonymous
Django doc
Dmitry
Hi How to update object with custom primary key (string value) from Django Rest Framework
Ivan Putra
How to load image from folder media on my project media to views.py
diproger
Hello guys)
diproger
http://dpaste.com/1B7ZCAG
diproger
http://dpaste.com/1B7ZCAG
who can help me pls?
Anonymous
Hey did anyone try this wq.io