Ismael
If you want to persist changes on a certain variable you have to define it in request.session for example: def your_view(request): if 'my_list' not in request.session: request.session['my_list'] = [1, 2, 3] # Logic on list # Update list on session when you finish your logic request.session['my_list'] = my_list
Ismael
This will keep your list until you logout
Ismael
And it will be a different list for every user connected in the app
Bogdan
@LuchoUY i going to build django project, but my client wont use wordpres CMS. Hi doesn't like all django CMS systems.
Yash
And it will be a different list for every user connected in the app
I don't want that exactly. I want it to be same for every user.
Ismael
The you hace to persist it in db
Ismael
Have*
Yash
I don't want that exactly. I want it to be same for every user.
That's why postgres db works well, but I looking for some alternative
Yash
The you hace to persist it in db
So what can I do in MySQL project
Bogdan
@LuchoUY probelby the best solution use wordpress dhango API.
Ismael
Define a model that contains a charfield for example
Yash
Because it doesn't support array type data
Ismael
And save your list as str(list)
Ismael
Then if i am not wrong you can bring it back with list(charfield attribute)
Yash
Oooo shit silly me
Ismael
If not you always can use split method on "," removing []
Yash
And save your list as str(list)
Thanks, I didn't think of that lol
Ismael
Youre welcome :)
Luis
@LuchoUY probelby the best solution use wordpress dhango API.
Ok, but I can't figureout the DJango rol in your setup...
Bogdan
@LuchoUY django on backend. And CMS system very similar wordpres CMS
Bogdan
@LuchoUY i know about django-wordpres API. But a dont know how use this API with django
Luis
@LuchoUY i know about django-wordpres API. But a dont know how use this API with django
I never used these library... I read the docs and it's used to fetch wordpress information (posts) from DJango app.
Luis
Anyway, do you want to access DJango data from WordPress or WordPress data from DJango? Personally, I don't like this mixing idea...
Bogdan
@LuchoUY i mistacke
Luis
I thought i can use together in one project
I think is not a good idea. You can do it work, but you should write a lot of code at WordPress side and Django side too.
Bogdan
@LuchoUY thenk
Luis
@LuchoUY thenk
You're wellcome
V@RG..
I have a question..!!! how do I get the value of the third relationship??
V@RG..
this is my Model https://dpaste.de/pZRW
V@RG..
help me please
Ghorz
I thought i can use together in one project
Be clear Django and WordPress are two differences entities with different functionality, Django - Framework WordPress - Cms It's possible to mix the two if you know what you're doing and why you're doing it. But it's so so so unnecessary waste of time and thinking logic. It will be logical for you to clone WordPress using Django. Thinking of it, it's not an easy job combining two different platform. I successfully merged scrapy with django last weekend by parsing django form query to scrapy, run scrapy then return results django. https://ghorz.com/jumia-scraper It wasn't an easy task let alone django and WordPress. Goodluck.
John
Hello guys, do I only need to use ForeignKey argument when iam creating a Many-to-one relationship or I can also use it in Many-to-many and One-to-one relationship?. .
Erik
Hello guys. Who worked with django-axes? I have problems with auth through DRF.
The Summer
Guys i want to modify Django's User model
The Summer
https://pastebin.com/jzqgN1zS
The Summer
So how can i do
Anonymous
So how can i do
Import User model Create a model for example User_info. And in this model use models.OneToOne(User)
The Summer
Bharat
Hi, I want one help. I convert .py to .exe using pyinstaller. When i am opening the .exe file it is giving error and automatically closeing. I am not able to see what is error or i am not finding problem. Any one will tell me how to solve this issue.
Tush |
Flutter is the best option for those who want simplicity and don't have a billion simultaneous users...
Why the billion of users clause. Do you think Flutter would be a bad choice for an App like Telegram or WhatsApp messenger
Tush |
Do you think it’s not robust and well developed ?
Anonymous
Actually i am facing a problem- I am using a common app for my homepage, and categories(men, women etc), but they are not perfectly working like men category has 'women/' and women also has 'women/' . i have checked multiple times that men and women names are properly used or not. my main project app's urls: path('', include('main_site.urls')), path('men/', include('main_site.urls')), path('women/', include('main_site.urls')) my main_site app's urls: path('', views.homePageView, name='home'), path('', views.men, name='men'), path('', views.women, name='women') my main_site app's views: def homePageView(request): return render(request, 'main_site/index.html') def men(request): return render(request, 'main_site/products.html') def women(request): return render(request, 'main_site/products.html')
Anonymous
should i make a different app for categories or i am doing something wrong?
Anonymous
In my main_site.views.py , i am using different urls for same url. But i want to choose them on the basis of url.
Master
First and most obvious, you should use same URL but different querysets
Anonymous
Actually, in my {% url men %} ... It is displaying 'localhost/women/' and in case women name url tag also.
Anonymous
First and most obvious, you should use same URL but different querysets
Yeah.. but my homepage is also in the same app. Should i make another app?
Anonymous
Or is there any way to check for the url and then calling the appropriate method?
Master
You rendering same page for men and for women. 'main_site/products.html'
Master
So I failed to see any difference.
Anonymous
Yeah.. actually , i will edit that after connecting it to my db . I will use jinja2 templating.
Anonymous
You rendering same page for men and for women. 'main_site/products.html'
Actually, i tried doing this with two different html files also but the same result.
Master
What is your Categories? Only URLs?
Anonymous
What is your Categories? Only URLs?
My categories are men, women..
Master
Children, kats, Cthulhu - whatever. How this works in your models?
Anonymous
Prasanthari
U need to set path for men and women separate
Prasanthari
I haven't made models.py till now.
Make models and add fields so that u can show data as per users
Master
So URLS only. Then fix this lines: path('men/', include('main_site.urls')), path('women/', include('main_site.urls'))
Anonymous
Make models and add fields so that u can show data as per users
Ohkk.. thanks... I will make my model file now. :)
Master
Because you have same URLs for men and women
Anonymous
This will fix
Ohkk.. i am gonna try this.
Anonymous
Because you have same URLs for men and women
Yeah.. that's the problem here.
Anonymous
I want to assign methods using the the urls on which it was previously working. I mean- Localhost/men/ I am here... So for men.. it should be nothing more in this url so empty url string.. But if i include 'men/' , it will mean localhost/men/men/..