Chikal
Hello everyone, I'm Chikal.. I'm new with Django.. I have practical exam project for my college, so I made an ecommerce website with reseller-admin system also including airwaybill check for delivery.. But I have a difficulty to have a 'Web Push Notification System' and I want to make each time the goods progress for delivery changed, it sent a notification.. but I tried so many and always fail.. Do you have any recommendation to learn?
Chikal
for notifications you can use firebase cloud messaging
Thats a good idea, I will try it, thank you my Prince 👍
noneofurfuckinbusiness
When u save name in imagefile object it automatically stores in media path, no need to mention media in name.
It's me
how I can authenticate my created modules in login
منتظر
is there no problem if I run manage.py without activating the virtual environment
Agent Q
is there no problem if I run manage.py without activating the virtual environment
No problem. Depends on whether the packages are installed or not
منتظر
thanx
Mirco
is there no problem if I run manage.py without activating the virtual environment
No, but you should create a virtualenv for every project in Python
Rajesh
Anybody help me how to write code multiple login like in e-commerce website here three users 1. Customer 2. Seller 3. Admin at same browser with different sessions and cookies
Rajesh
Inheritance AbstractUser
I'm using AbstractUser but login method not working
Rajesh
I'm using AbstractUser but login method not working
After authentication in login I'm using request.session[customer] but I'm not able to login as is_authentication method return false
DJHM
Hello All, where to star to know the base of django and frameworks? I know about other technologies but how do you get a fast curve of learning, what’s the best way to choose? Any recommendations are welcome!
Doragonsureiyā
Hello All, where to star to know the base of django and frameworks? I know about other technologies but how do you get a fast curve of learning, what’s the best way to choose? Any recommendations are welcome!
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Daniel
Anyone worked with django and mongodb?
DJHM
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Thank you! I saw this but my question is what kind of project should I do to get a better curve of knowledge, or if anyone can give a project where I can contribute and learn about it. Will be great create something real where I can help! Don’t doubt to get in touch, will be great to learn and help!👍
Doragonsureiyā
Anyone worked with django and mongodb?
https://daniel.feldroy.com/when-to-use-mongodb-with-django.html
Daniel
Getting object type <Model name> is not JSON serializable
DJHM
Check out these amazing topics: https://github.com/topics
Cool, I appreciate your help! That’s great!👍 Thanks!
noneofurfuckinbusiness
Anyone worked with django and mongodb?
Don't, waste of time. Django is made to work efficiently with relational databases. There are multiple packages to work with mongodb, but u end up writing lots of custom code which will consume lots of time. You can build almost any website using postgres or any other relational databases much more efficiently.
noneofurfuckinbusiness
I like mongodb becoz it is simple, less rules, less chance of errors. It is very tempting to use it, but again not for django.
noneofurfuckinbusiness
Why somebody need to connect to momgodb instead of work with postgres? I think one microservices or API can help a lot.🤔
True, api are better, these days single page applications(SPA) are more preferred, esp react js. Django can be used to make APIs.
noneofurfuckinbusiness
Message me for details
M
Do you have an example? I ask for the link?
not exactly, I am not frontend expert on django, i use django for APIs i am fulltime on backend but i will try to help u
꧁❦ I'm Farooq ❦꧂
how to prevent back button after logout from website
noneofurfuckinbusiness
how to prevent back button after logout from website
2 ways I know of, the common thing is force browser to make request. 1. Look for js back event and add event listener, more code. https://stackoverflow.com/questions/25806608/how-to-detect-browser-back-button-event-cross-browser 2. Use @cache_control decorator, way less code. https://stackoverflow.com/questions/6923027/disable-browser-back-button-after-logout#:~:text=You%20may%20find%20you%20need,stop%20any%20back%20button%20viewing.&text=and%20now%20Firefox%20backs%20up%20to%20the%20login%20screen.&text=Finally%2C%20I%20found%20the%20solution,This%20will%20work%20for%20sure.
Anonymous
I have created a customuser model like this - https://pastebin.com/46swsh87
Anonymous
While a manager with create_user like this - https://pastebin.com/nqxBKQJE
Anonymous
the problem is i have onetoone field for phone in Usermodel
Anonymous
which should also be created in createuser in django
Anonymous
but it says ""UserProfile.phone_no" must be a "PhoneModel" instance. "
Enigma
and PhoneModel model
Anonymous
actually its not views its about test
Anonymous
send views
let me send you the test
Enigma
actually its not views its about test
send me the error screen shot
Anonymous
I am using django rest framework
M
This is not the best example but just take the idea lol, I overwritten the admin index template, and I took the same form to send it to the index template, so u can do the same in you view create several forms and send it to the template. Look https://ibb.co/GfD4f4b https://ibb.co/tQbkxGt https://ibb.co/y6jfxQQ
Anonymous
No forms
noneofurfuckinbusiness
No forms
Ok, not a problem. When u r taking ph no input, first save phone number in PhoneModel by using PhoneModel.objects.create(), then assign the above instance to UserProfile instance phone attribute, then call save() on UserProfile instance
noneofurfuckinbusiness
Sure
Anonymous
Let me explain you there
Allwin Anto Franklin
Is there any handlers which can redirect to login page if any guest user (not logined user) try to access @login_required page??
🏁 🏁 🏁
I make the path in 'urls.py' as "index / books", but because of this, django looks for the css file in "index / static .." and not in "static". How to fix?
Allwin Anto Franklin
Set REDIRECT_URL variable in settings.py to ur login page url.
Thanks for your help bro. Sorry I did not make the point clear. I need a specific functionality. Now, if an unknown url is requested it will show a 404.html page. Likewise when a guest user tries to request a login_required page it should show login required page(content : visit login page or new user sign up). Is there any handlers for this??
🏁 🏁 🏁
development
𒂵𒐊𒍝𒊏
hi how i can convert django app to desktop app
𒂵𒐊𒍝𒊏
How can the virtual environment be activated continuously without restarting it when the project is reopened?
Allwin Anto Franklin
Ok, I'll check that out. Thanks for your help
noneofurfuckinbusiness
I make the path in 'urls.py' as "index / books", but because of this, django looks for the css file in "index / static .." and not in "static". How to fix?
Create a static folder in ur app, then create a folder in static folder with app's name, then put css folder or files in it. In development, django serves the static files, it looks for a static folder inside app.
noneofurfuckinbusiness
hi how i can convert django app to desktop app
Well, there r few software which automatically converts ur web applications to platform specific desktop apps, but they will compromise on lots of web app functionality
noneofurfuckinbusiness
hi how i can convert django app to desktop app
U can learn kivy, python based software, which can make app on any platform.
noneofurfuckinbusiness
Or use platform specific programming language to create app.
noneofurfuckinbusiness
Or learn react-native or similar software solutions which can make cross platform apps
Ggl
What is the best udemy course to learn Django
Anki|Important texts only
what should i add to my .gitignore in my Django project , there are lots and lots of file which are getting committed and pushed , i guess these are pip or V-environment files i cant add the screen short or the gitignore file to the chat,if you want to see the gitiggnore file i will share personally do HELP me!
Anki|Important texts only
ok i will try this
Mirco
ok i will try this
Just copy and paste what it will generate
Anki|Important texts only
go here gitignore.io and type for Python and your OS name
😁🙏 from 1k+ files to 7 😅 files ....worked ...thanks