dmitriy
changed name as you suggested from CalcAdmin to calc_admin
Mirco
So now it should be calc_admin.apps.CalcAdminConfig
Yup, then if you pass the config, you have to write this one inside INSTALLED APPS
Mirco
Use pastebin please
dmitriy
Use pastebin please
command code https://dpaste.org/nTnG
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
Mirco
https://dpaste.org/KmJk
CalcAdmin to calc_admin!
Mirco
and change the import to from admin_calculator.calc_admin.models import ...
dmitriy
CalcAdmin to calc_admin!
same problem https://dpaste.org/JH2R
Mirco
same problem https://dpaste.org/JH2R
Your tree did not change You still have that weird CalcAdmin
dmitriy
Your tree did not change You still have that weird CalcAdmin
sorry forgot to change in tree https://dpaste.org/uvQ5
Mirco
sorry forgot to change in tree https://dpaste.org/uvQ5
Why settings are inside the app ? And where is the manage.py ?
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…”
01101110011010010110001101100101
Am I getting the meaning of is_staff correctly? I mean, those users are not superusers.
01101110011010010110001101100101
01101110011010010110001101100101
Am I getting the meaning of is_staff correctly? I mean, those users are not superusers.
I want them to be able to see only permitted part of admin page
cj
Am I getting the meaning of is_staff correctly? I mean, those users are not superusers.
yes, is_staff allows the user to log in to the admin page... but the error is not saying "You don't have permissions to access admin page"... it's saying "Wrong email/password" so.... ¯\_(ツ)_/¯
01101110011010010110001101100101
wth is going on?
cj
wth is going on?
you're using a wrong email/password ¯\_(ツ)_/¯
01101110011010010110001101100101
Does django have any requirements for the password? The creds look exactly like “test@example.com:test”
01101110011010010110001101100101
you're using a wrong email/password ¯\_(ツ)_/¯
No. I am sure I am using the correct ones.
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
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
oh well... you're setting "password" as password to all your users... weird but meh...
still authenticate returns none https://dpaste.org/vZvm (updated code)
игорь/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
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
Give name to your url and put it as an argument for reverse. Better read the docs about urls. They are clear and beginner friendly
Tipu
Guys, can we use Django default database in Django E-commerce website??
Nwosu
This is not advisable
If you are talking about sqlite though
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
Proton
Doragonsureiyā
Please can anybody help me on how to use django with shopify?
Step 1: Open a browser Step 2: Write down https://google.com or https://duck.com and press Enter Step 3: In the search box, write down the same words you asked here Step 4: Read the first results
Proton
Step 1: Open a browser Step 2: Write down https://google.com or https://duck.com and press Enter Step 3: In the search box, write down the same words you asked here Step 4: Read the first results
I did but the information isn’t enough That’s why I decided to ask here Just maybe someone here has been able to implement it so he could just talk me through it
игорь/igor
Führer
who can help me put up a site
Yogesh
Hi , I have one problem with AWS S3 bucket configuration. My configuration code : AWS_ACCESS_KEY_ID = 'AKIAIT2Z5TDYPX3ARJBA' AWS_SECRET_ACCESS_KEY = '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' AWS_STORAGE_BUCKET_NAME = 'sibtc-static' AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME AWS_S3_OBJECT_PARAMETERS = { 'CacheControl': 'max-age=86400', } AWS_LOCATION = 'static' STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'mysite/static'), ] STATIC_URL = 'https://%s/%s/' % (AWS_S3_CUSTOM_DOMAIN, AWS_LOCATION) STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' Install Apps : boto3, storages, When I try this code for serve static files from S3 bucket is not working. Now my bucket AIM user also have full access. In setting.py file if I give wrong AWS kye and AWS secret key I did not receive any error like invalid key or something like this. It will work when I give public permission for my S3 bucket. But it not recommended to give public permission for S3 bucket. Also I have tried bucket policy. So what I will do please suggest?
Anonymous
hello, how can it? insert into info_profile (id, sex, id_user) VALUES (select id, sex, id_user from info_users);
Doragonsureiyā
who can help me put up a site
Rule 🔟: Job posts are SPAM unless they meet the requirements. Read the rules for details.
Bwaks
Self.request.job? What is that? Where do you set it?
application.user=self.request.user ......this fills the user id filed auto not through the form Now I want to fill job id field auto
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
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)
игорь/igor
Gives an error keyword :"slug"
i don't know how you are redirecting to the page with the form, you should know it yourself
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
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?
Doragonsureiyā
Hiii, can u recommend any tutorial to learn django?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Hari
after installing the rest_framework you should list it to installed app section in settings.py
INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'demoapp', 'rest_framework', ]
игорь/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