Doragonsureiyā
Ok iam sending code
To share code or error tracebacks please use an online pasting service, here is a list of suggested sites:
- https://del.dog
- https://linkode.org
- https://hastebin.com
Abhishek
Abhishek
Abhishek
Data is not save in the database
Abhishek
What happen
Mirco
https://docs.djangoproject.com/en/3.0/topics/forms/modelforms/
Mirco
Read this one and study it, you will find all the answers
Mirco
And basically if you have a ModelForm, if you do form.save() , you will create the instance into your model
Abhishek
How to i get django projects for learning purposes
Abhishek
Is there any website or something else
Anonymous
Anonymous
So when a user registers, a signal is used to register the user profile
Anonymous
https://simpleisbetterthancomplex.com/tutorial/2016/11/23/how-to-add-user-profile-to-django-admin.html
Dhruva
Object of type date is not JSON serializable
vit
hi, in my site i have django 1.9.9
i need to set https last-modified and If-Modified-Since header response, how can i do that?
in my settings I use cache moddleware:
MIDDLEWARE_CLASSES = ('django.middleware.cache.UpdateCacheMiddleware',
) + MIDDLEWARE_CLASSES + (
'django.middleware.cache.FetchFromCacheMiddleware',
'htmlmin.middleware.MarkRequestMiddleware',
)
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
'TIMEOUT': 3600,
'KEY_PREFIX': 'xxx'
},
}
Alex
https://gist.github.com/alxroots/3be1198bbf5a7e1a25b64d8382536a09
Cesar
Alex
Dhruva
Dhruva
I have just made a form where used datefield
Anonymous
Hi all
Where should I add Broker_url =re dis://localhosr:6379/0
Anonymous
To start celery???
Anonymous
Please provide answer
Anonymous
Need a little paid consultation from expirienced developer about:
1)Email sendings
2)Debug=True on production
3)Custom user creation
Write me private message
Anonymous
Yes
Rohan
Anonymous
hello guys I'm new in django and need some help.
Anonymous
I'm trying to make a site and for post models need some thing like draft and published and I made it with choices how can i make a def to work this choices
Anonymous
sorry if my language is bad
inchidi
by doing this you can store when the article published also
Anonymous
Hello all. I have created three models as shown below. I am trying to get all movies which a particular actor is part of. As an example, if I have created three movies with title 'Movie1', 'Movie2' and 'Movie3', and an actor named 'Actor 1' is part of two of the movies, I want to write a query to return these two movie names when the 'role_type' in the Role model is 'ACTOR'. Kindly guide me on how this can be done as I am really struggling to understand how to query data from ManyToManyField. Is there a more simpler way to execute this than what I have created? Below is the models.py code:
https://hastebin.com/opiruhimaf.rb
Fabian
Anonymous
I need beginner Django book
Rohan
Rohan
Let me 🔎 Google that for you:
🔎 django python
Rohan
First link
Anonymous
Pavel
Hi guys! Need help. Who is familiar with the paginator library? Is it possible to display a certain number of pages at the user's request? Example: there are 22 pages, but you do not need to download everything, but let's say only from 4 to 6 pages, from 10 to 5 pages in General, depending on the choice of the query. Is there a method in the paginator library to implement range loading?
Rohan
Rohan
If you're talking about DRF
https://www.django-rest-framework.org/api-guide/pagination/
Pavel
Anonymous
Hii geeks
Anyone knows "how to expire jwt token on inactivity"?
Rohan
Anonymous
I have a stateless webapp that uses a JWT token. Eventually it will expire - which is OK, but I don't want it to expire while the user is working. Instead, I would like the token to expire after a certain time of inactivity.
Rohan
Rohan
Cuz jwt can't be expired on demand
Rohan
They have a lifespan
Rohan
You can expire and reissue them though
Sergey K
Anonymous
Yes you are right but when I do nothing in my app like no activity then I just want to expire it's session then how can I do it if I am wrong then plz corrct me.
Sergey K
Do you understand how access and refresh tokens used?
Anonymous
Hello all, I'm new to Django. I'm trying to work on Django using VSCode on Powershell Terminal but it always gives an error like, bootstrap freeze and some files are Not found when, I created an app and added urls in urls.py and include them in the main folder.
Rohan
Rohan
Also use del.dog for sharing error logs
Anonymous
Sergey K
So on frontend you need to timplement something that interacts with backend using jwt access-refresh flow. And when your user is inactive for 60 mins -> access token is expired, you get a new pair of tokens using saved refresh token -> if refresh token is expired too then your session is expired
Anonymous
Cool thanks got it@PulsatingQuasar @Sergrey K
Ro'zivoyho'ja
hello everyone !!!
i've a problem with django
i cant understan
match = date_re.match(value)
TypeError: expected string or bytes-like object
Ro'zivoyho'ja
how can i solve this
వ్లాదమిర్ పుతిన్
Ro'zivoyho'ja
when i run comand py manage.py migrate
Sergey K
You should send full traceback
Suvojit Barick
can anyone explain me how redirect works
Cesar
Cesar
the same way any redirect works
Sergey K
can anyone explain me how redirect works
1) Client makes http request
2) backend sends http response with status code 301 with header Location
3) client receives response and sees that it's code 301, it makes then another http request to redirecting url
Doragonsureiyā
can anyone explain me how redirect works
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 firsts results
boingo-00
Maybe i don't understand how translation works, but i made all necessary steps from docs and looks like it dont't work
boingo-00
In settings.py
LOCALE_PATHS = [ './' ]
LANGUAGES = [
('ru-ru', _('Russian')),
('en', _('English')), ]
In template (example)
{% blocktrans %}No posts{% endblocktrans %}
.po file created correctly, i translated this, but templates didn't translated
boingo-00
And of course i compiled translations