Re: Media files

2018-06-19 Thread Cody “theultimatecasual” Davis
Thank you so much. Sent from my iPhone > On Jun 19, 2018, at 16:56, Jason wrote: > > https://docs.djangoproject.com/en/2.0/howto/static-files/#serving-files-uploaded-by-a-user-during-development > -- > You received this message because you are subscribed to the Google Groups > "Django users"

Re: Media files

2018-06-19 Thread Jason
https://docs.djangoproject.com/en/2.0/howto/static-files/#serving-files-uploaded-by-a-user-during-development -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to dja

Re: Media files

2018-06-19 Thread Cody “theultimatecasual” Davis
Well i have that. My problem really is i can’t find anywhere in the docs that says i need to add that. I’m really just looking for the documentation on it. Sent from my iPhone > On Jun 19, 2018, at 08:06, Akshay Gaur wrote: > > Maybe there is an issue with the way django is serving the docs.

Re: Forms in Bootstrap 4 Modals?

2018-06-19 Thread Alexander Joseph
Thanks very much! I've followed a few tutorials and had mixed results - This tutorial I got the closest with https://simpleisbetterthancomplex.com/tutorial/2016/11/15/how-to-implement-a-crud-using-ajax-and-json.html I got to the point where it says " The data was invalid. No hard refresh no anyt

Re: Forms in Bootstrap 4 Modals?

2018-06-19 Thread C. Kirby
What do you seem to be having trouble with? -Showing the form in a modal? -Dynamically loading a form based on how the modal is launched? -Using the modal to handle ajax loaded/submitted forms? -Generally building abootstrap4 modal? I have done this and am happy to help, just give me some directi

Re: channels 2 message type handler in different consumer

2018-06-19 Thread ILia Hopa
i think i found the issue - seems like i can't use a custom channel name. async_to_sync(self.channel_layer.group_add)("cli0-group", "custom_channel_name") changing it to self.channel_name helped. On Tuesday, June 19, 2018 at 4:12:41 PM UTC-4, itsnate_b wrote: > > can you please show what's

Re: channels 2 message type handler in different consumer

2018-06-19 Thread itsnate_b
can you please show what's in your routing.py? How are you routing to command_status_all? On Tuesday, June 19, 2018 at 4:01:32 PM UTC-4, ILia Hopa wrote: > > Here, relevant code: > Want a clients connected to Cli0Consumer to receive a message. > > class Cli0Consumer(JsonWebsocketConsumer): >

Re: channels 2 message type handler in different consumer

2018-06-19 Thread ILia Hopa
Here, relevant code: Want a clients connected to Cli0Consumer to receive a message. class Cli0Consumer(JsonWebsocketConsumer): def connect(self): try: async_to_sync(self.channel_layer.group_add)("cli0-group", "custom_channel_name") except Exception as e:

Re: channels 2 message type handler in different consumer

2018-06-19 Thread ILia Hopa
Here, relevant code: *1 consumer* (want it to receive message) class Cli0Consumer(JsonWebsocketConsumer): def connect(self): try: async_to_sync(self.channel_layer.group_add)("cli0-group", "custom_channel_name") except Exception as e: logging.error(sys.

Re: channels 2 message type handler in different consumer

2018-06-19 Thread ILia Hopa
Here, relevant code: *1 consumer* (want it to receive message) class Cli0Consumer(JsonWebsocketConsumer): def connect(self): try: async_to_sync(self.channel_layer.group_add)("cli0-group", server_name) except Exception as e: logging.error(sys.exc_info()

Forms in Bootstrap 4 Modals?

2018-06-19 Thread Alexander Joseph
I've posted this before but havent gotten any response. If more information is needed let me know and I'll get you anything I can. I basically want to use forms in Bootstrap 4 modals for my CRUD operations but cant really find a good tutorial or references to work from. I'm newer to Django stil

Re: Installation issue

2018-06-19 Thread MTS BOUR
Hello Make sure you can import django from python shell And check the python version you are using with you python files You can use the full path to python But that is not fun to do everytime For more check here https://stackoverflow.com/questions/312549/no-module-named-django-core

Re: Help with context_processor

2018-06-19 Thread Mikkel Kromann
Thank you so much Andreas. This is very helpful. I wasn't able to figure that from the documentation (not sure who to blame, though ;) So I relied on various stackoverflow posts, which were quite confusing to say the least. Now, is there anyway I can loop over the items in the dictionary? In th

Re: channels 2 message type handler in different consumer

2018-06-19 Thread itsnate_b
Post some code please and I can try to help. On Tuesday, June 19, 2018 at 11:21:31 AM UTC-4, ILia Hopa wrote: > > hello! is it possible to set the handler of the group message in the > different consumer (from the one from which message was dispatched). > > ex: I have 2 consumers: `cli0consumer`

Installation issue

2018-06-19 Thread Dhruv Mahajan
Hi I just started working on Django. I am unable to get django-admin command to work properly. Initially I was getting an error that django-admin could not be located. I created a symlink for the same in the /use/local/bin folder. Now I am getting the following error: File "/usr/local/bin/djang

Re: How to assign multiple model in a single html form in Django class based view?

2018-06-19 Thread Akshay Gaur
You may want to try inline formsets . On Tuesday, June 19, 2018 at 8:45:14 AM UTC-5, Sunil Kothiyal wrote: > > > I am new in Django. I am working on Django 2.0. I need to show multiple > model forms(user profile, ad

channels 2 message type handler in different consumer

2018-06-19 Thread ILia Hopa
hello! is it possible to set the handler of the group message in the different consumer (from the one from which message was dispatched). ex: I have 2 consumers: `cli0consumer` and `cli1consumer`. there is a method in a class called from `cli0consumer` which is sending a message to the group 'g

Re: Media files

2018-06-19 Thread Akshay Gaur
Maybe there is an issue with the way django is serving the docs. Try the following: - in your base urls.py, add the following: if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) In case this doesn't work, would it be possible for you to p

Re: I am trying to create polls project as mentiioned in the django website

2018-06-19 Thread itsnate_b
Syed, I really suggest you follow the Django Tutorial found here: https://docs.djangoproject.com/en/2.0/intro/tutorial01/ Go through *all* of the parts of the tutorial (there are 7 parts), line by line. Start with a completely new project. Jumping in and out of other tutorials is really not rec

How to assign multiple model in a single html form in Django class based view?

2018-06-19 Thread Sunil Kothiyal
I am new in Django. I am working on Django 2.0. I need to show multiple model forms(user profile, additional details) in a single HTML form and save it on one click. *form.py file is here* class BusinessProfileForm(forms.ModelForm): class Meta: model = StUserDetails fields = ('user_

Django Channels 2.0 - How to init and persist/communicate with only one instance of background worker for every channel_layer.send?

2018-06-19 Thread itsnate_b
I am using Django 2.0.5, Python 3.6.2, Django Channels 2.1.1, aiohttp 3.1.3. I have created a background worker class which is initialized on a route to the appropriate event/function. Problem is that it initializes a *new* instance of the class on every triggered call, meaning that I cannot acc

Re: Django Channels 2.0 websocket crashing & blocking while using aiohttp

2018-06-19 Thread itsnate_b
I managed to resolve the cascading crash issue by doing some more asyncio reading and using: self.t1 = asyncio.run_coroutine_threadsafe(self.listen(), loop=loop) instead of: t1 = asyncio.ensure_future(self.listen(), loop=loop) await t1 This makes it run concurrently with the main asyncio channe

Regarding Multiple Databases

2018-06-19 Thread RASHMIT PANKHANIA
hi i m here first time, my doubt is regarding using multiple(two) databases and i want to create particular table in only one database but after migrating it happens on both.you can follow the code on https://dpaste.de/arP9 -- You received this message because you are subscribed to the Google

Regarding Multiple Databases

2018-06-19 Thread RASHMIT PANKHANIA
Hello: I am Rashmit Pankhania and my doubt is regarding using multiple(two) databases and i want to create particular table in only one database but after migrating it happens on both.Also after migrating it show only django-migration table in second database.you can follow the code on https://

Media files

2018-06-19 Thread Cody Davis
Hey everyone. New to Django here i apologize is this question is already answered somewhere. So i have read the FileField docs and 50 times. I have defined my MEDIA_URL and MEDIA_ROOT. When i upload an image through the admin, i can see the file goes where i directed it to inside of Django. If

Re: I am trying to create polls project as mentiioned in the django website

2018-06-19 Thread Sujad Syed
Hi Nathan, I am really confused starting up with my website i have gone through couple of Videos and sites to start with, in one of the sites, it was mentioned to make changes in urls.py and then in views.py and in settings.py [Installed Apps] to have the site worked. unfortunately i dont see vi

Re: How to auto fill latitude and longitude fields in Django2.0.6?

2018-06-19 Thread prateek gupta
It seems for this I need to use API key from google. Have you heard about this python package- from location_field.models.plain import PlainLocationField? I tried with this one but getting some issues- Issue while using PlainLocationField