Dambek
that in post func
Dambek
formset = modelformset_factory(Questions_for_check, form = Questionsform, extra=extras )
formset = formset(data=request.POST,files = request.FILES, initial=questions)
Bilal
any one have a slove to this isuue when i deploy to pythonanywhare !
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
error in anyjson setup command: use_2to3 is invalid.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
Lokesh
Anyone received ibm test link?
Ridwan
Sammy
Good day great minds
Please to host a Django project what hosting server would you recommend as the best, efficient and secured
Ridwan
Digital Ocean is good!
Sammy
Okay let me check it out thanks
Ridwan
Cool then. But do note that it's not free, you need to add credit card first.
But once you create account with them, you'll have a free $200 for 60 days.
anvar
hi everyone i have this error ModuleNotFoundError: No module named 'config'
my project:
/backend
/config
init.py
settings.py
urls.py
...
manage.py
Saydullo
anvar
Send Code Settings - Installed Apps?
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# dj-q
# 'django_q',
# my-apps
'main',
]
Ridwan
Ridwan
Oh, I missed this. Thanks for the reminder
anvar
Sent screenshot of the error from your terminal pls
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'config'
Сережа
django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. wtf is that?
Сережа
its not critical... but i wanna fix that
clouded
Rabeeh
one data submit.
then add 2 same data in my db.
am using django rest framework post methord.
anyone can help me
Сережа
clouded
of course
And which part doesn't make sense?
Сережа
You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
Сережа
idk how to do it
clouded
clouded
Did you find the settings object to be used there?
Сережа
what
Сережа
wait...
Сережа
no
clouded
what
You don't know where the settings file is?
Сережа
there not
clouded
No settings file?
Сережа
clouded
Then perhaps share it.
Сережа
https://nekobin.com/pevudalaga
clouded
https://nekobin.com/pevudalaga
Okay, then the settings object is not used in the settings file. So either try to set the environment variable or find the place where the object is being used. If that's a file you want to edit. Otherwise stick to the environment variable.
Сережа
how to create environment variable DJANGO_SETTINGS_MODULE in needed file
clouded
Alex
clouded
Mostly at least.
clouded
Which means it's purpose is to run your project. Which makes me think you are stuck running your project.
clouded
For the first time?
clouded
There's documentation to guide you through those tough times: https://docs.djangoproject.com/en/4.2/intro/tutorial01/#the-development-server
Mukhil
How can be advanced django developer?
Which topic need to cover?
Abdulkhaliq
How to connect MySQL in my project
Hello everyone,
I might be a bit harsh in this message. Why do we ask such simple questions that a quick Google search would answer immediately, with hundreds of explanations and answers available? Asking these types of questions hinders a developer's ability to research and think critically, leading them to rely on direct solutions that might save time but ultimately result in a loss of many skills.
this group should be for posing questions and inquiries that a developer hasn't found a solution to, or for general discussions about new topics, and so on.
anvar
someone can help me.......><><><><><>
anvar
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'config'
about this problem
Lords
about this problem
It seems like import error check once did you forget any where without importing configmodule .You are used config
Raj
does anyone please fix my static files
Raj
it is not connected while giviing {load static
Muflone
Raj
will you please connect to me once ple
NARASIMHA
I have mylti tenant application
We create a new tenant in default database, Which will create a new database for the tenant and apply all migrations..
During runserver, every database is read from default database and added to DATABASES
We have setup different urls, for each tenant.
So in middleware based in the request url we set which db to use
So how do i write my test cases for apis using this structure
Yazan
Good evening. I am building a Django application and using simple jwt. The access token takes 5 minutes after the login process. It becomes ineffective(expired). Can you help me?
Yazan
please
NARASIMHA
Yazan
ACCESS_TOKEN_LIFETIME
"ACCESS_TOKEN_LIFETIME": timedelta(days=10),
"REFRESH_TOKEN_LIFETIME": timedelta(days=20),
"ROTATE_REFRESH_TOKENS": False,
"BLACKLIST_AFTER_ROTATION": True,
NARASIMHA
Add the setting with the value you require
NARASIMHA
Yazan
though its not working?
No, i login in post man and take the generated access token in auth of other api and its work but after 5 minutes try to use the same api
Return:
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid or expired"
}
]
}
NARASIMHA
looks fine,
but why are you mentioning every setting, Just mention the settings which you need to override
Yazan
NARASIMHA
Yazan
Thanks for your ❤️
Dr
Hi, please I need an alternative for django-graphql-auth, as it isn't compatible with django 4
Osondu
Hey everyone, please I need help here.
I’m trying to get real time prices from Binance API and utilize the results for a DRF app (API).
Trying to set it up but I can’t even get the connection to run.
If I use the runserver… it doesn’t give any note of channels having taken over the server.
If I try to run daphne <projectname>.asgi:application
I keep getting
.
.
kind = type.__new__(cls, name, bases, attrs)
TypeError: '_InterfaceMetaClass' object is not iterable
..
.
From Daphne, Zope, twisted.
I’ve tried switching their versions back and forth but I don’t know where I’m getting it wrong, as I’m trying it out for the first time
Fritz Flores
Hey guys I’m trying to deploy on render but I keep getting this error
ValueError:Missing staticfiles manifest entry for ‘image\world. png’
Any suggestions ?
Osondu
Fritz Flores
Ali
#django_channels
Hi
Is Group concept just for chatting applications?
Ex: Group_send or group_add
Raj
File "R:\Project\myenv\lib\site-packages\django\contrib\admin\widgets.py", line 151
'%s=%s' % (k, v) for k, v in params.items(),
^
SyntaxError: Generator expression must be parenthesized
Raj
does anyone this error how to solve
Muflone
Osondu
Yes
And you included
python manage.py collectstatic
In it?
AZAMAT 々
Fritz Flores