Muflone
a field is not related to a 404 message
Anonymous
In the create, for GET there is no form, u type form.CreatePollForm, must be form = CreatePollForm
Anonymous
😉
Mahesh
Hi Team, I am trying to learn the microservices using django is there any blogs or tutorials to understand the logic with implementing api gateway. Kindly post some useful stuff.
Mahesh
Have you tried google? Thank you
Yes,but not getting proper doc on api gateway implementation
Shaun
Anonymous
Hi. I need hosting for django with postagesql
Anonymous
Guys i have question
Anonymous
Could I learn django on pycharm
Anonymous
no
What should I use
Doragonsureiyā
What should I use
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Anonymous
Bro I want your suggestion. I study at cyber security. I finished Python basics. Now i want to improve my knowledge by learning Django. What do you think could django might be useful to person who is coming to cyber security? Please answer
cj
Django is OWASP compliant, so you can learn a lot of things on how to protect your website from certain attacks
raven
Hi. I need hosting for django with postagesql
I'll say go for heroku it provides easy deployment along with postgres add-on .
Gil
Could I learn django on pycharm
pycharm is a developing tool, not learning program. But yes, pycharm has helpfully assitance writting for django framework
Anonymous
pycharm is a developing tool, not learning program. But yes, pycharm has helpfully assitance writting for django framework
Noo bro you didn't understand me. I wanted to know could i run it could i code it on pycharm!!
Gil
Noo bro you didn't understand me. I wanted to know could i run it could i code it on pycharm!!
Jetbraians has a lot of how to: https://www.jetbrains.com/help/pycharm/creating-and-running-your-first-django-project.html#
Anonymous
Can someone refer me or explain, how can I add a URL with optional parameter, using path()... I want to invoke the same view with sites/ and sites/<site_id>, has been googling and testing, and nothing work for me 😒
Anonymous
**somebody 😃
Anonymous
Multiple views... No optional parameter
raven
Can someone refer me or explain, how can I add a URL with optional parameter, using path()... I want to invoke the same view with sites/ and sites/<site_id>, has been googling and testing, and nothing work for me 😒
handle both url with same view. path('/', your_view), path('/<int:site_id>', your_view) in your view pass a default value as None
Anonymous
OK, will try that... In class based views, must set the default value inside def get... really!?
raven
https://stackoverflow.com/questions/14351048/django-optional-url-parameters
raven
👍
Anonymous
that is with url() doesn't work exactly with path() 😔 and with FBV, how can i do that, with CBV ?? set a default value for some GET parameter
Anonymous
this parameters, are in kargs 🤔
Anonymous
May I, populate a form in a TemplateView CBV!??
Sweetie
I have many models in my app. Is there some inbuilt way to allow model crud automatically by users? Or I have to code all 4 C, R, U, D url path and views for each model seperately?
Ghorz
Could I learn django on pycharm
Please have different views. As for me, start with text editor like note pad or emacs or vim, even nano. After mastering coding with 0 syntax assistance, move on to an advanced editor like Atom, Vscode, sublime,..... I started off coding C on Vim then move to nano. It helped me alot, I'm a Linux server admin and learning to use such editor is profitable.
Anonymous
Hi. I have project deployed by python 2.7 and django 1.1
Anonymous
I want upgrade to python 3.7 and django 1.1 is that save or I need to update django to last version also
Anonymous
And what is save way to do this update
myii
I want upgrade to python 3.7 and django 1.1 is that save or I need to update django to last version also
Look at the chart and table here: https://www.djangoproject.com/download/. You need to upgrade.
myii
And I really hope for your sake that you mean 1.11 and not 1.1...
Anonymous
There is some article whith Django good practices, like coding format, how to refractor better, about reuse code...
cj
There is some article whith Django good practices, like coding format, how to refractor better, about reuse code...
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/
Anonymous
👍🏻 Tks
Anonymous
i'm using same template for many views, because the logic is very similar, just the model and form change, and, the urls for reverse, i'm passing the url, as string, from view to template, as kargs, all fine, but in the template, the pycharm mark this variable 'cause url expect a view name between '', there is some better way to do this!?
Anonymous
in the view i have kwargs['view_url'] = 'sites-list' and in the view i'm calling like {% url view_url element.id %}
Anonymous
and in the template... 😅
Melvin
at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=macekart.herokuapp.com request_id=26068b7c-75dc-4363-827f-612bd293753e fwd="137.97.75.97" dyno= connect= service= status=503 bytes= protocol=https
Melvin
my django app is succesfully deployed to heroku. But wheni try to access it i get application error and this is what i got from the log. Can someone please help me.
Melvin
I do have a procfile with web: gunicorn <myappname>.wsgi
Anonymous
It's a good idea to use the jinja2 template engine instead Django!?
cj
Jinja2 was made to give other libraries the power of Django Templates
Anonymous
Oh, OK, Thks again 😉
Shreehari
https://del.dog/uleacungub.txt code here is not working as i want it to. i have stored count and count_date in db and so after few days, say 30 , i want count value to reset to 0 and it should continue the same for every 30 days. can anyone please help me with this
Jaydeep
Hello folks, Is there any good django course available to learn making websites. So can you share video tutorials link how to create website using django. Plz share it. Thank you
Doragonsureiyā
Hello folks, Is there any good django course available to learn making websites. So can you share video tutorials link how to create website using django. Plz share it. Thank you
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Jaydeep
Thank you
Xnihpue
[django-channels] Keeping track of users in "rooms" TL;DR \- How do I maintain a list of users in each room so that I can send that data to the front-end to display a list of participants in this room. I'm designing a collaborative web application that uses django-channels for websocket communication between the browser and the server. A room can be joined by more than one user and every user should be aware of every other user in the room. How would I go about achieving this using django-channels (v2)? I already went through the documentation and a few example projects available online but none of them have added a similar functionality. I also know about django-channels-presence but the project doesn't seem to be actively maintained so I didn't really bother looking into examples using that. Here's what I've come up with so far: \- For every room, I create an object in the database and those objects can keep track of the users that are in the room. So for e.g in the WS consumer's connect() method I could do a get_or_create_room() call and room.add_participant(self.user_name) (or fetch this from the scope) and in the disconnect() method I could remove myself from the room. The problem with this, however, is that I might end up creating race conditions? I think? Also since I'm fetching objects from the ORM, I have to make sure that every time, before using this object I have to re-fetch it from the DB because it can (and will) become outdated quickly. This doesn't seem ideal at all. \- Another way I can think of is attaching data to self.channel_layer in the consumer where I can do something like setattr(self.channel_layer, f'users_{room_id}', {}) and maintain this dictionary for every user entering and leaving. This again doesn't sound very safe and I didn't see anyone using this so I'm unsure. Any help regarding this would be appreciated. I'd also like to be able to see how existing applications do this if anyone can point me to one?
Xnihpue
[django-channels] Keeping track of users in "rooms" TL;DR \- How do I maintain a list of users in each room so that I can send that data to the front-end to display a list of participants in this room. I'm designing a collaborative web application that uses django-channels for websocket communication between the browser and the server. A room can be joined by more than one user and every user should be aware of every other user in the room. How would I go about achieving this using django-channels (v2)? I already went through the documentation and a few example projects available online but none of them have added a similar functionality. I also know about django-channels-presence but the project doesn't seem to be actively maintained so I didn't really bother looking into examples using that. Here's what I've come up with so far: \- For every room, I create an object in the database and those objects can keep track of the users that are in the room. So for e.g in the WS consumer's connect() method I could do a get_or_create_room() call and room.add_participant(self.user_name) (or fetch this from the scope) and in the disconnect() method I could remove myself from the room. The problem with this, however, is that I might end up creating race conditions? I think? Also since I'm fetching objects from the ORM, I have to make sure that every time, before using this object I have to re-fetch it from the DB because it can (and will) become outdated quickly. This doesn't seem ideal at all. \- Another way I can think of is attaching data to self.channel_layer in the consumer where I can do something like setattr(self.channel_layer, f'users_{room_id}', {}) and maintain this dictionary for every user entering and leaving. This again doesn't sound very safe and I didn't see anyone using this so I'm unsure. Any help regarding this would be appreciated. I'd also like to be able to see how existing applications do this if anyone can point me to one?
OP: https://stackoverflow.com/q/61242243/4591121
Shreehari
how can i use model x values as choices for model y ? for eg: class countries(models.Model): country = models.CharField(max_length=200) def str(self): return self.country class User(AbstractUser): """User model.""" full_name = models.CharField(_("Full Name"), max_length=50, default="Full Name") country_choices = models.CharField(choices=countries
Shreehari
Define choices into country model or use an Enum Then you can use that choices in another model
the thing is i will be adding/updating countries from admin panel. all those countries should be used as choices in User model
Anonymous
I can deployed project using python 2.7 and django 1.11 to herkou
Anonymous
Good afternoon everyone. I need your suggestion. I have finished Python basics. Going to django is right choice?
Anonymous
Phillip
Hey, I'm using django forms to upload data but my image doesn't not seem to be uploaded ,but everything else goes through, any help
Sweetie
I have a Hugo static landing page at example.com And a django app at app.example.com The home page opens a dashboard specific for user so ther is no public page. I want my full django website to be login required how to do that?
Mirco
Is important or not
Python 2 is dead, what do you think about ?
Anonymous
Python 2 is dead, what do you think about ?
I have old project using python 2
Adonis
hi there. does someone has a good doc for Shuup platform (build with django)
Adonis
at least a getting started tutorial
Mirco
I have old project using python 2
It's time to upgrade it
Anonymous
AM
I guys can you help me... i am sending data through ajax from my template using get method and also i seen the data in console but can’t receive the data in views
Dinesh
Hi, I'm new to python. I have created a Django project using visual studio
Dinesh
I'm looking for help