Mirco
INSTALLED_APPS = [
"calc_admin",
'grappelli',
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.sites",
"django.contrib.contenttypes",
'background_task',
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
]
So now it should be calc_admin.apps.CalcAdminConfig
dmitriy
changed name as you suggested from CalcAdmin to calc_admin
Mirco
Use pastebin please
dmitriy
problem with models import
Mirco
problem with models import
make that AdminCalculator in snake case first of all, it's a file not a class
and seconded add the full tree inside that pastebin
dmitriy
Mirco
and change the import to from admin_calculator.calc_admin.models import ...
Abdulloh
dmitriy
Mr.FAkE
How to validate start_date and end_date
01101110011010010110001101100101
Hi everyone! I’ve got a pretty dumb question but still. I have some “test” users in my django project with is_staff set to True. But when I try to log in with their credentials to an admin page I get an error saying “Wrong email/password…”
cj
01101110011010010110001101100101
Am I getting the meaning of is_staff correctly? I mean, those users are not superusers.
01101110011010010110001101100101
01101110011010010110001101100101
01101110011010010110001101100101
wth is going on?
01101110011010010110001101100101
Does django have any requirements for the password? The creds look exactly like “test@example.com:test”
01101110011010010110001101100101
cj
No. I am sure I am using the correct ones.
did you customized the authentication flow? because django uses username, not email to authenticate users ¯\_(ツ)_/¯ ... so maybe you moved something that is breaking Django's auth feature
01101110011010010110001101100101
Yes, I have a custom User model
01101110011010010110001101100101
01101110011010010110001101100101
So are there any ways to fix the issue?
Davide
hi everyone, I tried to use local storage with django, the set and the get work correctly (you can see it from the console) but when you reload the page the django views overwrite the local storage. do you know any solution? Thank you
shubham
игорь/igor
still authenticate returns none https://dpaste.org/vZvm (updated code)
Put
breackpoint()
on line 69 in login function, enter your credentials in browser and head to console. There you can try different things live. Like:
request.POST
or
user = authenticate(request, email=email, password=password)
user
etc
You can type q and press enter to quit debugging mode
A
Reverse for 'update.html' not found. 'update.html' is not a valid view function or pattern name.
can anyone tell how to resolve this error
игорь/igor
Tipu
Guys, can we use Django default database in Django E-commerce website??
Nwosu
Nwosu
I suggest you go for a better database like postgresql or mysql
Bwaks
hello guys this code is giving a {{ keyerror : 'slug' }} ------------------>class AddApplicationView(CreateView):
model =Application
form_class=ApplicationForm
template_name ='applications/add_application.html'
def form_valid(self,form):
job = Job.objects.get(Job, slug=self.kwargs['slu'])
application =form.save(commit=False)
application.user = self.request.user
application.instance.job = self.request.job
application.save()
application.save_m2m()
return super(AddApplicationView,self).form_valid(form) <<-------- i want the 'job_slug' field be auto filed with the current job slug to which this application is made to
Bwaks
Proton
Proton
игорь/igor
игорь/igor
игорь/igor
Führer
who can help me put up a site
Anonymous
hello, how can it?
insert into info_profile (id, sex, id_user) VALUES (select id, sex, id_user from info_users);
Bwaks
Doragonsureiyā
игорь/igor
игорь/igor
Bwaks
Auto, not from the form, but from where?
Let me put it this way you have objects(jobs) in listview click one of the objects you go to the detailview(job) of the chosen object now in this detail view I have a button that takes me to application form now in the application table which gets details from the application form there are two fields user_id and job_id now how fill the job_id with the current job id
Yogesh
https://linkode.org/#hcGV76ZJSPzOi9bSqZkwo7
Please check the code and provide useful information.
Ali
did you tried to set up media root etc
игорь/igor
игорь/igor
игорь/igor
игорь/igor
def form_valid(self,form):
job = Job.objects.get(slug=self.kwargs['slug'])
application =form.save(commit=False)
application.user = self.request.user
application.instance.job = job
application.save()
application.save_m2m()
return super(AddApplicationView,self).form_valid(form)
Bwaks
Bwaks
Hari
Import "rest_framework" could not be resolved
Hari
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'demoapp',
'rest_framework',
]
Hari
pip list
Package Version
--------------------------------- -------
asgiref 3.4.1
autopep8 1.5.7
backports.entry-points-selectable 1.1.0
distlib 0.3.2
Django 3.2.7
django-filter 21.1
djangorestframework 3.12.4
filelock 3.0.12
Markdown 3.3.4
pip 21.3.1
platformdirs 2.3.0
pycodestyle 2.7.0
pytz 2021.1
setuptools 57.4.0
six 1.16.0
sqlparse 0.4.1
toml 0.10.2
virtualenv 20.7.2
Hari
cannot import restframework
игорь/igor
How do I get the id
https://stackoverflow.com/questions/63855518/django-form-valid-error-can-anyone-find-the-error
Maybe this will give you an idea. But honestly, if you are not familiar with url and routes and slug etc you should firstly try to learn all of these concepts and only then take a project and do some job
Hari
Nazrul Islam
I got this error
after installing the rest_framework you should list it to installed app section in settings.py
😶
Hi!
I have some problem with django + graphene (graphQL) , in particular with subscriptions
Has anyone figured it out?
Mr
Hiii, can u recommend any tutorial to learn django?
игорь/igor
игорь/igor
Activate
Hari
Load your virtual env
pip list
Package Version
--------------------------------- -------
asgiref 3.4.1
autopep8 1.5.7
backports.entry-points-selectable 1.1.0
distlib 0.3.2
Django 3.2.7
django-filter 21.1
djangorestframework 3.12.4
filelock 3.0.12
Markdown 3.3.4
pip 21.3.1
platformdirs 2.3.0
pycodestyle 2.7.0
pytz 2021.1
setuptools 57.4.0
six 1.16.0
sqlparse 0.4.1
toml 0.10.2
virtualenv 20.7.2