Anonymous
ok... look when I open the app it's ...
Anonymous
oh ... I can't post screenshots
Anonymous
nevermind... so let's say user1 is logged in
Anonymous
he has/can modify the product_db
Anonymous
then when another user is logged in he is working on the same product_db
Anonymous
but I need it so every user would have it's own product_db: user1 : product_db_1 user2 : product_db_2 ...
cj
then when another user is logged in he is working on the same product_db
because Django is configured to work with the same DB, you can configure more DBs, but I don't know if you can do it dynamically
inchidi
based on the same model
model == table, not db tho whats your reason to separate user product data to multiple db/table instead store them in one table like what everyone else do?
Anonymous
ok thanks
cj
Like a one to one?
One to Many is a better option, one user can have many products... or it's up to the OP to decide the relation, he knows the bussiness
Maz
Okay
Maz
Best design for a video hosting site? plain django or django CMS?
Abhi
Hi everyone! I have a question: I want to create a button in a webpage which onclick will download an mp4 video. The problem is i have to send data using the button to the server and also the page should not reload So, under how can i achieve this? Can i use submit method of form and preventDefault() function?
Abhi
yes, you can do that
So the form will send POST request to server but the page wont reload?
inchidi
yes but you should handle the post by your self. you can also add form target to iframe in that page
inchidi
https://stackoverflow.com/a/28060195
Django Bot
>> Links - GitHub - viewflow/django-material: Material Design for Django - GitHub - rosarior/awesome-django: Repository mirror of GitLab: https://gitl - jcalazan/ansible-django-stack: Ansible Playbook for setting up a Django app
Django Bot
>> Links - zostera/django-bootstrap4: Bootstrap 4 integration with Django. - Let's talk about testing Django apps - Testing Django applications in 2018 - GitHub - aellerton/demo-allauth-bootstrap: Django sample app with users inc
Sanjay Krishnan
How can i implement a time slot booking system in django?
Leshaze
Hi, I know this is a Django community, but maybe some Flask experienced users are around as well. I am currently working on my first flask project and I am looking for some feedback regarding the code. Is it best practice, can something be optimized etc. I am thankful for every feedback https://bitbucket.org/leshaze/platten/src/master/
Meera
i flush my database but when i re enter any new entries it get primary key id from what i left off last time
inchidi
Django Bot
>> Links - “Working with huge data sets in Django”
𝒟𝑜𝓃𝒬𝓊𝒾𝓍𝑜𝓉𝑒
Important notice on a bug (i took 3 days to solve it) with django rest framework's DefaultRouter and HyperlinkedModelSerializer is that if you use a namespace for an application's urls in the main project's urls.py like this: url(r'^api/', include('accounts.urls', namespace='accounts')), url(r'^api/', include('articles.urls', namespace='articles')), you will get 2 errors, the first one is from the reverse function that is expecting the args to have "namespace:view_name" experssion, but DRF is inserting the view name only, the 2nd error will always be the first to appear on the debug mode like in the photo... i simply removed the namespace and it worked fine!!!!
Django Bot
>> Links - Working with huge data sets in Django – Lab Digital
Ио иамз
Hi , how to hide django from wappalyzer ? Because it detects django framework
Django Bot
>> Links - django-vue-template - template is a minimal example for an application usin
Abhi
Hi, my string when passed to html template changes:
Abhi
eg. my string is
Abhi
#in views.py: data_json = '{"token": "0a0db06b-4b52-4de1-bf01-134f7df863b3", "titles": ["Blink 182 - First Date - Drum Cover"]}' render(request,'mypage.html',{'data_json':data_json}) #(it shows in console => type(data_json) is <class 'str'>) #in mypage.html: <script type="text/javascript"> let data_json = {{data_json}} </script> but on console it prints: {&quot;token&quot;: &quot;03ca2f9e-f829-4b8c-a9ee-67eba5641c09&quot;, &quot;titles&quot;: [&Blink 182 - First Date - Drum Cover&quot;]}
Abhi
So what basically happening is : in views.py : the string -> '{"key":"value"}' becomes: {&quot;key&quot;:&quot;value&quot;}
Abhi
in my html after template rendering
Mounikesh
please can you use pastebin
Anonymous
Hi any django developer available for job support?
Anonymous
If yes ping me personally
Django Bot
>> Links - A Brief Intro to Docker for Djangonauts
Anonymous
can any one answer my question in django restframework https://stackoverflow.com/questions/51811922/pass-extra-information-to-serializer-fields-in-django-rest-framework
Maxim
Всем привет, возможно ли получить инстанс юзера при валидации формы?
Maxim
Sorry, missed group :(
Anonymous
>> Blogs - How to Build a Unique Technology for Your Fintech Product with Python
This is by far the Best Not I have seen on telegram. Thanks Guys. Please who created this
Anonymous
its Indentation error. format your code properly and run
Anonymous
maybe you missed a ','
Anonymous
or a )
Rohan
Use screenshot app.
Rohan
Also, you can just copy your traceback.
Maz
hi guys, i have a quick question regarding user model.
Maz
this is my models.py file
Maz
https://dpaste.de/dviV
Maz
this is my adminviews.py file....a view from which the admin can do stuff to students, buses, etc.
Maz
https://dpaste.de/uWy5
Maz
i want to use the 'School' object in a template....
Maz
The admin is a member of staff....how do i show this school object that the admin belongs to in a template?
Maz
Staff.objects.filter(school=school) is not working....
Maz
or should i use request.user.school??
Maz
for example...in my template...i want to show a list of all students belonging to the school the admin works for only...how do i write this query?
Maz
so a listing of all students in the school will be
Maz
students = School.objects.filter(school=request.user.Staff.school) ?
Maz
and how do i list all the students from the admin's school?
Maz
this^
got it....thanks.
Maz
the ORM is still the bane of my existence 😅
inchidi
you can try via shell first, for example you login to school admin with username=school and password=Password123 do it via shell: user=User.objects.get(username="school") if user.check_password('Password123'): print(Student.objects.filter(school=user.staff.school))
inchidi
technically, you will get any error you get from shell
Maz
alright, lemme try this...thanks
Maz
so i'm using 'school_name = request.user.staff.school.name'
Maz
but the error i'm getting is: