Re: Drop Down Menu in Django Forms not working.

2017-08-05 Thread lemme smash
name is a ForeignKey field? If not, you shouldn't use queryset attribute 
there. Use choices instead.
If you want to render all available choices from db, you can get it like 
Model.objects.filter(...).values_list('name', flat=True)

On Friday, August 4, 2017 at 8:07:24 PM UTC+3, Arun S wrote:
>
> Hi,
>
> I am trying to have a drop down menu for a field in my form but seems like 
> its not working as required.
>
> This is my form: forms.py
>
> eval_states = [
> ('ACTIVE',EvalState.objects.filter(name='ACTIVE')),
> ('INACTIVE',EvalState.objects.filter(name='INACTIVE')),
> ('DELETE',EvalState.objects.filter(name='DELETE')),
> ]
>
> class EvalForm(forms.ModelForm):
> def __init__(self, *args, **kwargs):
> super(EvalForm, self).__init__(*args, **kwargs)
> self.fields['name'].queryset = EvalState.objects.filter(
> Q(name = 'ACTIVE') | Q(name = 'INACTIVE') | Q(name = 
> 'DELETE'))
>
> class Meta:
> model = EvalState
> fields = ('name',)
>
> my html : abc.html
>
> {% csrf_token %}
> 
> 
> Eval State:
> 
> {{ eval_form.name }}
> 
> 
> 
> 
> 
>
> view.py
> eval_form = None
> eval_form = atlas_forms.EvalForm(request.POST, EvalState)
> if eval_form.is_valid():
> print eval_form.errors
> eval_form.save()
> else:
> print eval_form.errors
>
>
> What am i missing?
> Basically requirement is that, i would need a drop down in the HTML and 
> whenever the Value is set and saved, I want it to be updated in the DB.
> But i am not able to get through the first step of getting the options in 
> the HTML.
>
> Any Help on this would be great.
>
> Thanks
> cheers
> Arun.
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/569250aa-3644-47b6-a952-e857247e966b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: a hard question about django ORM

2017-08-06 Thread lemme smash
what the problem here?
you can get all your Feeds by
feeds = Feed.objects.filter(user=me)
 and then all the comments for each feed
comments = feed.comment_set.exclude(user=me)
or what?
if you want to get only comments, you can do
comments = Comment.objects.filter(feed__in=feeds).exclude(user=me)



On Sunday, August 6, 2017 at 1:06:56 PM UTC+3, 时空路由器 wrote:
>
> there are three classes
>
> class User(models.Model):
>   name = models.CharField()
>
> class Feed(models.Model):
>   user = models.ForeignKey(User)
>
> class Comment(models.Model):
>   user = models.ForeignKey(User)
>   feed = models.ForeignKey(Feed)
>
>
> How to get all my feeds and all the coments of them, but the user of 
> comment are not mine
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/aca52eae-b227-4b31-b0be-70434bab9e01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: module object has no attribute after using different version of Python

2017-08-06 Thread lemme smash
it's a very strange way of import. if your forms and models are in the same 
python module, you can do
from . import models



On Saturday, August 5, 2017 at 11:01:01 PM UTC+3, Prithviraj Mitra wrote:
>
> I have both versions python 2.7 and 3.4 installed. I am using some code 
> which is developed under 2.7 but I am using under 3.4. So after compiling 
> using the following command
>
> python manage.py runserver
>
> I get the following error -
>
>  File "C:\pyprojects\focus\site\general\forms.py", line 26, in Meta model = 
> models.UserProfile AttributeError: 'module' object has no attribute 
> 'UserProfile'
>
> As models.py and forms.py is under same directory(general) so I have imported 
> the model in forms.py in this way
>
>
> from .models import models
>
> Now in models.py I have defined the class 
>
> class UserProfile(models.Model, HashedPk): user = models.OneToOneField(User, 
> unique=True) is_pro = models.BooleanField(default=False, blank=True) 
> ..
>
> In forms.py the code is 
>
> class UserProfileForm(forms.ModelForm): class Meta: model = 
> models.UserProfile .
>
> Is there any special way to call the model in python 3.4.
>
> Any help is highly appreciated.
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a70b1f1e-14ca-4028-8706-cf03f3da5dfe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Drop Down Menu in Django Forms not working.

2017-08-06 Thread lemme smash
so, you can maybe show you models structure here?
also, if it is a ForeignKey, why you trying to filter qs by string values? 
I mean Q(name = 'ACTIVE')
it's shouldn't work


On Sunday, August 6, 2017 at 5:22:21 AM UTC+3, Arun S wrote:
>
> Yes, name is a foreign key here.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/34570842-a7f9-4043-8bfc-a1a893a71020%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Drop Down Menu in Django Forms not working.

2017-08-07 Thread lemme smash
i meant EvalState model
if name attribute on it is a ForeignKey you should get corresponding 
queryset of model it links to
if it's charfield, you should use text choices 

On Monday, August 7, 2017 at 6:22:50 AM UTC+3, Arun S wrote:
>
> The Models Look like this :
>
> stage_state = models.ForeignKey(EvalState, verbose_name="Eval State")
> class Bundle(AtlasAuditModel, AtlasBaseHelper):^M
> """^M
> Represents the bundle purchased by the customer. The bundle^M
> contains a reference identifier which remains the same if the^M
> the bundle is either upgraded or entended.^M
> A bundle can have 0 or more features.^M
> """^M
> bundle_id = models.CharField(verbose_name="Bundle ID",^M
>  max_length=32,^M
>  unique=True)^M
> 
> 
> 
> stage_state = models.ForeignKey(*EvalState*, verbose_name="Eval 
> State")
>
>
> atlas_bundle;
> atlas_bundle | CREATE TABLE `atlas_bundle` (
>   `id` int(11) NOT NULL AUTO_INCREMENT,
>  ...
> 
> ...
>   *`stage_state_id` int(11) NOT NULL,*
>   PRIMARY KEY (`id`),
>   *KEY `atlas_bundle_36c1765e` (`stage_state_id`)*
> ) ENGINE=InnoDB AUTO_INCREMENT=1408 DEFAULT CHARSET=latin1 
> ROW_FORMAT=DYNAMIC |
> 19 rows in set (0.01 sec)
>
> desc *evalstate*;
> +---+--+--+-+-++
> | Field | Type | Null | Key | Default | Extra  |
> +---+--+--+-+-++
> | id| int(11)  | NO   | PRI | NULL| auto_increment |
> | name  | varchar(32)  | NO   | UNI | NULL||
> | friendly_name | varchar(32)  | NO   | UNI | NULL||
> | description   | varchar(255) | YES  | | NULL||
> +---+--+--+-+-----++
> 4 rows in set (0.00 sec)
>
> Whats the Difference in having qs when there is a foriegn Key value? 
>
> Arun
>
> On Sunday, August 6, 2017 at 7:48:11 PM UTC+5:30, lemme smash wrote:
>>
>> so, you can maybe show you models structure here?
>> also, if it is a ForeignKey, why you trying to filter qs by string 
>> values? I mean Q(name = 'ACTIVE')
>> it's shouldn't work
>>
>>
>> On Sunday, August 6, 2017 at 5:22:21 AM UTC+3, Arun S wrote:
>>>
>>> Yes, name is a foreign key here.
>>
>>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/acdd7ce3-0b42-4808-a6de-f6023ca3275f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Drop Down Menu in Django Forms not working.

2017-08-07 Thread lemme smash
you didn't show me a model structure, you just showed another model, so I 
can't give you example without picture of what's going on there

On Monday, August 7, 2017 at 1:39:49 PM UTC+3, Arun S wrote:
>
> Can you just give an Example for this taking a Query.
>
>
>
> On Monday, August 7, 2017 at 3:37:04 PM UTC+5:30, lemme smash wrote:
>>
>> i meant EvalState model
>> if name attribute on it is a ForeignKey you should get corresponding 
>> queryset of model it links to
>> if it's charfield, you should use text choices 
>>
>> On Monday, August 7, 2017 at 6:22:50 AM UTC+3, Arun S wrote:
>>>
>>> The Models Look like this :
>>>
>>> stage_state = models.ForeignKey(EvalState, verbose_name="Eval State")
>>> class Bundle(AtlasAuditModel, AtlasBaseHelper):^M
>>> """^M
>>> Represents the bundle purchased by the customer. The bundle^M
>>> contains a reference identifier which remains the same if the^M
>>> the bundle is either upgraded or entended.^M
>>> A bundle can have 0 or more features.^M
>>> """^M
>>> bundle_id = models.CharField(verbose_name="Bundle ID",^M
>>>  max_length=32,^M
>>>  unique=True)^M
>>> 
>>> 
>>> 
>>> stage_state = models.ForeignKey(*EvalState*, verbose_name="Eval 
>>> State")
>>>
>>>
>>> atlas_bundle;
>>> atlas_bundle | CREATE TABLE `atlas_bundle` (
>>>   `id` int(11) NOT NULL AUTO_INCREMENT,
>>>  ...
>>> 
>>> ...
>>>   *`stage_state_id` int(11) NOT NULL,*
>>>   PRIMARY KEY (`id`),
>>>   *KEY `atlas_bundle_36c1765e` (`stage_state_id`)*
>>> ) ENGINE=InnoDB AUTO_INCREMENT=1408 DEFAULT CHARSET=latin1 
>>> ROW_FORMAT=DYNAMIC |
>>> 19 rows in set (0.01 sec)
>>>
>>> desc *evalstate*;
>>> +---+--+--+-+-++
>>> | Field | Type | Null | Key | Default | Extra  |
>>> +---+--+--+-+-++
>>> | id| int(11)  | NO   | PRI | NULL| auto_increment |
>>> | name  | varchar(32)  | NO   | UNI | NULL||
>>> | friendly_name | varchar(32)  | NO   | UNI | NULL||
>>> | description   | varchar(255) | YES  | | NULL||
>>> +---+--+--+-+-++
>>> 4 rows in set (0.00 sec)
>>>
>>> Whats the Difference in having qs when there is a foriegn Key value? 
>>>
>>> Arun
>>>
>>> On Sunday, August 6, 2017 at 7:48:11 PM UTC+5:30, lemme smash wrote:
>>>>
>>>> so, you can maybe show you models structure here?
>>>> also, if it is a ForeignKey, why you trying to filter qs by string 
>>>> values? I mean Q(name = 'ACTIVE')
>>>> it's shouldn't work
>>>>
>>>>
>>>> On Sunday, August 6, 2017 at 5:22:21 AM UTC+3, Arun S wrote:
>>>>>
>>>>> Yes, name is a foreign key here.
>>>>
>>>>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f0016136-3478-4af3-8509-28b964397090%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't install mysqlclient

2018-10-25 Thread lemme smash
you sure you have mysql server installed?
also, if you plan to start development, i recommend you to seriously think 
about learning linux. it's a way more fit developers needs

On Thursday, October 25, 2018 at 2:27:43 PM UTC+3, Rabil Abdullahi wrote:
>
>  
>
> I received error message while trying to download mysqlclient using---pip 
> install mysqlclient. Please help me out.
>
> Sent from Mail  for 
> Windows 10
>
>  
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9b0c0310-5d5e-4dab-be5d-3ebb6e185520%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ANYONE!!! Django ai working

2019-10-04 Thread lemme smash
wut?

On Saturday, September 14, 2019 at 7:01:13 AM UTC+3, nitin kumar wrote:
>
> How does make application to understand a document!

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2aafb6a8-68ec-45db-9f1d-6364001ee736%40googlegroups.com.


Re: Django bootstrap calendar

2019-10-04 Thread lemme smash
it's more about client, so you probably want to look for calendar libraries 
and then JUST make an api for it.

On Tuesday, September 24, 2019 at 12:47:37 AM UTC+3, Perceval Maturure 
wrote:
>
> Is there anyone with a step by step procedure of doing this app in a 
> Django 2.1 environment For newbies like some of us in Django
> Regards
> Perceval
> -- 
> Sent from Gmail Mobile
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/61987203-8111-48ea-8214-df1a4cdbc157%40googlegroups.com.


Re: creating school year

2019-10-04 Thread lemme smash
you probably may want to figure out what you actually need to do first

On Tuesday, September 24, 2019 at 5:54:12 PM UTC+3, Rain wrote:
>
> i have a question how to create school year with start date and end date 
> all transaction must under this year. Thanks..
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/102aa82f-444f-4934--6de6d7cfb42a%40googlegroups.com.


Re: Widgets not working for dynamically added formset forms

2019-10-04 Thread lemme smash
and you have no errors in browser console?

On Tuesday, October 1, 2019 at 11:41:28 PM UTC+3, Dmitri S. wrote:
>
> I have a formset with fields with Select2 widgets and a calendar 
> (date-picker) from django app.
>
> And I use dynamic addition of formset forms.
>
>
> When I render a template for the first time, all widgets work fine. *But 
> when I add new formset form, widgets of this new form don't work.*
>
>
> I think, this 
> 
>  ('formset:add') 
> is somehow related to my problem, but I can't figure how to use it.
>
> I also found this: 
>
> $('.django-select2').djangoSelect2();
>
> With this line dropdowns start working, but they become empty.
>
>
> For adding new form I use 'empty form' and this jQuery:
>
> 
> $('.buttons').on('click', '#add_form', function() {
> var form_idx = $('#id_resolution_set-TOTAL_FORMS').val();
> $('#form_set').append($('#empty_form').html().replace(/__prefix__/g, 
> form_idx));
> $('#id_resolution_set-TOTAL_FORMS').val(parseInt(form_idx) + 1);
> });
> 
>
>
> Form in HTML:
>
> {% if mat_id == None %}
>  enctype="multipart/form-data" method="post">
> {% else %}
>  enctype="multipart/form-data" method="post">
> {% endif %}
>
> {% csrf_token %}
> 
> {% for field in form_matter %}
> 
> {% if field.errors %}
> {{ field.errors }}
> {% endif %}
> {{ field.label_tag }}
> {{ field }}
> 
> {% endfor %}
> 
> RESOLUTIONS
>
> 
> {{ formset_resolutions.management_form }}
> {% for form in formset_resolutions %}
> 
> {% for hidden in form.hidden_fields %}
> {{ hidden }}
> {% endfor %}
> {% for field in form.visible_fields %}
> 
> {% if field.errors %}
> {{ field.errors }}
> {% endif %}
> {{ field.label_tag 
> }}
> {{ field }}
> 
> {% endfor %}
> 
> {% endfor %}
> 
> 
> ADD
> SAVE
> 
> 
> 
> {% for field in formset_resolutions.empty_form.visible_fields %}
> 
> {% if field.errors %}
> {{ field.errors }}
> {% endif %}
> {{ field.label_tag }}
> {{ field }}
> 
> {% endfor %}
> 
> 
> 
>
>
> Other scripts:
>
> 
> 
>
> {{ form_matter.media.js }}
>
>
> {{ form_matter.media.js }} are:
>
> 
>
> 
>  src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/js/select2.min.js">
>  src="/static/admin/js/admin/DateTimeShortcuts.js">
> 
>  src="/static/django_select2/django_select2.js">
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/06f8709b-8ee1-4dba-a9cf-ae4a9d0e81db%40googlegroups.com.


Re: Widgets not working for dynamically added formset forms

2019-10-06 Thread lemme smash
okay, but what you actually mean by "widgets don't work"?
also, from my experience I can say that when you have to work with some 
dynamic forms is't much better to use pure js on client and only validate 
it on backend

On Tuesday, October 1, 2019 at 11:41:28 PM UTC+3, Dmitri S. wrote:
>
> I have a formset with fields with Select2 widgets and a calendar 
> (date-picker) from django app.
>
> And I use dynamic addition of formset forms.
>
>
> When I render a template for the first time, all widgets work fine. *But 
> when I add new formset form, widgets of this new form don't work.*
>
>
> I think, this 
> 
>  ('formset:add') 
> is somehow related to my problem, but I can't figure how to use it.
>
> I also found this: 
>
> $('.django-select2').djangoSelect2();
>
> With this line dropdowns start working, but they become empty.
>
>
> For adding new form I use 'empty form' and this jQuery:
>
> 
> $('.buttons').on('click', '#add_form', function() {
> var form_idx = $('#id_resolution_set-TOTAL_FORMS').val();
> $('#form_set').append($('#empty_form').html().replace(/__prefix__/g, 
> form_idx));
> $('#id_resolution_set-TOTAL_FORMS').val(parseInt(form_idx) + 1);
> });
> 
>
>
> Form in HTML:
>
> {% if mat_id == None %}
>  enctype="multipart/form-data" method="post">
> {% else %}
>  enctype="multipart/form-data" method="post">
> {% endif %}
>
> {% csrf_token %}
> 
> {% for field in form_matter %}
> 
> {% if field.errors %}
> {{ field.errors }}
> {% endif %}
> {{ field.label_tag }}
> {{ field }}
> 
> {% endfor %}
> 
> RESOLUTIONS
>
> 
> {{ formset_resolutions.management_form }}
> {% for form in formset_resolutions %}
> 
> {% for hidden in form.hidden_fields %}
> {{ hidden }}
> {% endfor %}
> {% for field in form.visible_fields %}
> 
> {% if field.errors %}
> {{ field.errors }}
> {% endif %}
> {{ field.label_tag 
> }}
> {{ field }}
> 
> {% endfor %}
> 
> {% endfor %}
> 
> 
> ADD
> SAVE
> 
> 
> 
> {% for field in formset_resolutions.empty_form.visible_fields %}
> 
> {% if field.errors %}
> {{ field.errors }}
> {% endif %}
> {{ field.label_tag }}
> {{ field }}
> 
> {% endfor %}
> 
> 
> 
>
>
> Other scripts:
>
> 
> 
>
> {{ form_matter.media.js }}
>
>
> {{ form_matter.media.js }} are:
>
> 
>
> 
>  src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/js/select2.min.js">
>  src="/static/admin/js/admin/DateTimeShortcuts.js">
> 
>  src="/static/django_select2/django_select2.js">
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/09b7bf10-beb4-4a5d-8f27-3d597c9d18f8%40googlegroups.com.


Re: Widgets not working for dynamically added formset forms

2019-10-08 Thread lemme smash
okay, i think i got it. you probably need to provide some snippet to reload 
list of  choices to newly added form. try to look some examples of using 
django-select2 with formsets...
by pure js i mean not necessarily vanila js, but pure client code, without 
rendering templates on server. all the problems you have partially (and 
it's not only my opinion) happens because you trying to combine server-side 
approach with client code pieces which is always buggy and hard to 
implement and maintain.  

On Tuesday, October 1, 2019 at 11:41:28 PM UTC+3, Dmitri S. wrote:
>
> I have a formset with fields with Select2 widgets and a calendar 
> (date-picker) from django app.
>
> And I use dynamic addition of formset forms.
>
>
> When I render a template for the first time, all widgets work fine. *But 
> when I add new formset form, widgets of this new form don't work.*
>
>
> I think, this 
> 
>  ('formset:add') 
> is somehow related to my problem, but I can't figure how to use it.
>
> I also found this: 
>
> $('.django-select2').djangoSelect2();
>
> With this line dropdowns start working, but they become empty.
>
>
> For adding new form I use 'empty form' and this jQuery:
>
> 
> $('.buttons').on('click', '#add_form', function() {
> var form_idx = $('#id_resolution_set-TOTAL_FORMS').val();
> $('#form_set').append($('#empty_form').html().replace(/__prefix__/g, 
> form_idx));
> $('#id_resolution_set-TOTAL_FORMS').val(parseInt(form_idx) + 1);
> });
> 
>
>
> Form in HTML:
>
> {% if mat_id == None %}
>  enctype="multipart/form-data" method="post">
> {% else %}
>  enctype="multipart/form-data" method="post">
> {% endif %}
>
> {% csrf_token %}
> 
> {% for field in form_matter %}
> 
> {% if field.errors %}
> {{ field.errors }}
> {% endif %}
> {{ field.label_tag }}
> {{ field }}
> 
> {% endfor %}
> 
> RESOLUTIONS
>
> 
> {{ formset_resolutions.management_form }}
> {% for form in formset_resolutions %}
> 
> {% for hidden in form.hidden_fields %}
> {{ hidden }}
> {% endfor %}
> {% for field in form.visible_fields %}
> 
> {% if field.errors %}
> {{ field.errors }}
> {% endif %}
> {{ field.label_tag 
> }}
> {{ field }}
> 
> {% endfor %}
> 
> {% endfor %}
> 
> 
> ADD
> SAVE
> 
> 
> 
> {% for field in formset_resolutions.empty_form.visible_fields %}
> 
> {% if field.errors %}
> {{ field.errors }}
> {% endif %}
> {{ field.label_tag }}
> {{ field }}
> 
> {% endfor %}
> 
> 
> 
>
>
> Other scripts:
>
> 
> 
>
> {{ form_matter.media.js }}
>
>
> {{ form_matter.media.js }} are:
>
> 
>
> 
>  src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/js/select2.min.js">
>  src="/static/admin/js/admin/DateTimeShortcuts.js">
> 
>  src="/static/django_select2/django_select2.js">
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/132d7efe-3060-430c-826c-0aa5d6eaabae%40googlegroups.com.


Re: ListView from 2 model

2019-10-08 Thread lemme smash
you probably may want to implement `get_context_data` method like:
def get_context_data(self):
context = super(BlogView, self).get_context_data()
context.update({
'authors': 
Author.objects.filter(posts__isnull=False).distinct(),
'tags': Tag.objects.all(),
  })
return context



On Thursday, October 3, 2019 at 12:52:34 AM UTC+3, Yann Mbella wrote:
>
> hi everyone,
> I got a problem in listing two models from a listview that is,  a list of 
> one model and another model together (eg Books and Authors)
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e19dcec9-258b-4411-b14b-d1152772be53%40googlegroups.com.


Re: filter search from 2 models

2019-10-10 Thread lemme smash
suggestion:
it's better to post code snippets as text (i.e. use `code` markup)
about your question: what you mean by "i want to do a combination"? you 
what to display both filters and both lists on the same page? in that case 
you want to setup custom view.

On Thursday, October 10, 2019 at 1:48:52 AM UTC+3, sotiris moustogiannis 
wrote:
>
> I want to do dynamic filter search from 2 different models 
>
> i have 2 models
>
> [image: md1.png]
>
> [image: md2.png]
>
>
>
> i have this filters.py file to find shops and dates
>
>
> [image: fi.png]
>
>
> and this shop listview
>
> [image: li.png]
>
>
>
> i can only show the results of shopfilter and i want to do a combination 
> of shops and appointments model
>
>
>
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e5549cf5-7160-4d77-95de-37609e35c18a%40googlegroups.com.


Re: Templates rendering problem

2019-10-10 Thread lemme smash
so, it's not reproducing when you run it locally?
also, can you provide an example of string where you have "strange" 
character? most probably you store it in database.

On Thursday, October 10, 2019 at 1:48:52 AM UTC+3, Boris Romero wrote:
>
> Hi! 
>
> I recently update Django from 1.11 to 2.2.6 and I have a serious problem 
> with the templates rendering when i put on production my site (Nginx + 
> uWSGI + Django). The problem is a lot of '/n' and strangers characters that 
> appears when I render any page, that obviuosly suggest is a encoding 
> problem, but I can't find the exact configuration problem. It just happen 
> when the app is deployed, that is, when DEBUG = False.
>
> Any help?
>
> Thanks!
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3914c6cc-d7e0-4f9a-a479-176d59b53958%40googlegroups.com.


Re: filter search from 2 models

2019-10-11 Thread lemme smash
just create custom view and add those two querysets to context. if you want 
to do search by one input in both querysets, you'll need to create custom 
filter as well, or just filter it in a view by query from input

On Thursday, October 10, 2019 at 1:48:52 AM UTC+3, sotiris moustogiannis 
wrote:
>
> I want to do dynamic filter search from 2 different models 
>
> i have 2 models
>
> [image: md1.png]
>
> [image: md2.png]
>
>
>
> i have this filters.py file to find shops and dates
>
>
> [image: fi.png]
>
>
> and this shop listview
>
> [image: li.png]
>
>
>
> i can only show the results of shopfilter and i want to do a combination 
> of shops and appointments model
>
>
>
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d8f0ed77-2076-4995-bf7e-838557b01bf4%40googlegroups.com.


Re: Micro Service Architecture

2019-10-12 Thread lemme smash
go
^^)

On Friday, October 11, 2019 at 8:39:33 PM UTC+3, Uzama Zaid Mohammed Jaward 
wrote:
>
> Hi all
>
> What are the tech stack is good for micro service architecture in Django
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7a283541-e2d8-4d9b-9428-5a1d4c00d619%40googlegroups.com.


Re: page redirecting only home page

2019-10-12 Thread lemme smash
why you have type="button" on anchor?)

On Saturday, October 12, 2019 at 7:07:48 AM UTC+3, narendra thapa wrote:
>
> i have two template load_page.html and ask_questions.html while i am 
> linking a ask_questions.html through load_page.html via a anchor tag i am 
> not getting ask_questions.html but i am getting a same page load_page.html. 
> programmed is in screenshot please find in attachment
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fe1773da-9372-4c92-b08c-d89040cb1db6%40googlegroups.com.


Re: Templates rendering problem

2019-10-16 Thread lemme smash
it's really hard to help here without understanding whats going on there. 
when i ask for example I meant not only piece of page screenshot to see 
what you mean, but whole stack of how you pass data in a view and how you 
render it in a template

On Tuesday, October 15, 2019 at 9:31:26 PM UTC+3, Boris Romero wrote:
>
> Any help or ideas? Thanks!
>
> On Thursday, October 10, 2019 at 12:15:42 PM UTC-3, Boris Romero wrote:
>>
>> Hi! Yes, it's reproducing when I run it locally, but with DEBUG=FALSE and 
>> with nginx and uwsgi. And no, it's not a database encoding problem, it just 
>> involves the templates, because the same database, with diferents instances 
>> of the app (with the upload and without it) not make any differences.
>>
>> Thanks for the ideas!
>>
>>
>> On Thursday, October 10, 2019 at 11:38:48 AM UTC-3, lemme smash wrote:
>>>
>>> so, it's not reproducing when you run it locally?
>>> also, can you provide an example of string where you have "strange" 
>>> character? most probably you store it in database.
>>>
>>> On Thursday, October 10, 2019 at 1:48:52 AM UTC+3, Boris Romero wrote:
>>>>
>>>> Hi! 
>>>>
>>>> I recently update Django from 1.11 to 2.2.6 and I have a serious 
>>>> problem with the templates rendering when i put on production my site 
>>>> (Nginx + uWSGI + Django). The problem is a lot of '/n' and strangers 
>>>> characters that appears when I render any page, that obviuosly suggest is 
>>>> a 
>>>> encoding problem, but I can't find the exact configuration problem. It 
>>>> just 
>>>> happen when the app is deployed, that is, when DEBUG = False.
>>>>
>>>> Any help?
>>>>
>>>> Thanks!
>>>>
>>>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c61ff412-474a-4027-8cac-ea4d3f434399%40googlegroups.com.


Re: Templates rendering problem

2019-10-16 Thread lemme smash
okay, but it's even harder to guess what is a problem there without ability 
to see relevant code pieces. btw, you may want to check this 
https://www.geeksforgeeks.org/important-differences-between-python-2-x-and-python-3-x-with-examples/#Unicode
 as 
you most probably had to migrate python as well

On Wednesday, October 16, 2019 at 6:39:53 PM UTC+3, Boris Romero wrote:
>
> Thanks for the answer Lemme! As I said, my problems appear exactly when I 
> update django from 1.11 to django 2.2.x. With this change a lot of 
> libraries need to update, and now I was trying to remove some of them and 
> proving if they are the reason of this strange behavior. Before update 
> django, all works perfectly. 
>
> Libraries who update with djnago 2.2.x are: channels, daphne, attrs, 
> django-allauth, djnago-crispy-forms, djnago-extensions, django-taggit, 
> psycopg2, djangorestframework, and subdomains (using a pull request for 
> compatibility).
>
> The problems happens with DEBUG=False, and using nginx and uwsgi, using 
> the same configuration for django 1.11 and django 2.2.x
>
> Greetings! 
>
> On Wednesday, October 16, 2019 at 8:59:21 AM UTC-3, lemme smash wrote:
>>
>> it's really hard to help here without understanding whats going on there. 
>> when i ask for example I meant not only piece of page screenshot to see 
>> what you mean, but whole stack of how you pass data in a view and how you 
>> render it in a template
>>
>> On Tuesday, October 15, 2019 at 9:31:26 PM UTC+3, Boris Romero wrote:
>>>
>>> Any help or ideas? Thanks!
>>>
>>> On Thursday, October 10, 2019 at 12:15:42 PM UTC-3, Boris Romero wrote:
>>>>
>>>> Hi! Yes, it's reproducing when I run it locally, but with DEBUG=FALSE 
>>>> and with nginx and uwsgi. And no, it's not a database encoding problem, it 
>>>> just involves the templates, because the same database, with diferents 
>>>> instances of the app (with the upload and without it) not make any 
>>>> differences.
>>>>
>>>> Thanks for the ideas!
>>>>
>>>>
>>>> On Thursday, October 10, 2019 at 11:38:48 AM UTC-3, lemme smash wrote:
>>>>>
>>>>> so, it's not reproducing when you run it locally?
>>>>> also, can you provide an example of string where you have "strange" 
>>>>> character? most probably you store it in database.
>>>>>
>>>>> On Thursday, October 10, 2019 at 1:48:52 AM UTC+3, Boris Romero wrote:
>>>>>>
>>>>>> Hi! 
>>>>>>
>>>>>> I recently update Django from 1.11 to 2.2.6 and I have a serious 
>>>>>> problem with the templates rendering when i put on production my site 
>>>>>> (Nginx + uWSGI + Django). The problem is a lot of '/n' and strangers 
>>>>>> characters that appears when I render any page, that obviuosly suggest 
>>>>>> is a 
>>>>>> encoding problem, but I can't find the exact configuration problem. It 
>>>>>> just 
>>>>>> happen when the app is deployed, that is, when DEBUG = False.
>>>>>>
>>>>>> Any help?
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cd732510-2dd6-47ba-a939-9aa28e357ed0%40googlegroups.com.


Re: unable to validate and save modelform data into mysql database...

2019-10-21 Thread lemme smash
it's quite expected behavior. if you want to check if job exists, you 
better use Job.objects.filter(name=job_name).exists()

On Monday, October 21, 2019 at 3:49:01 PM UTC+3, Gourab Mahapatra wrote:
>
> Traceback:
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\core\handlers\exception.py"
>  
> in inner
>   34. response = get_response(request)
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\core\handlers\base.py"
>  
> in _get_response
>   115. response = self.process_exception_by_middleware(e, 
> request)
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\core\handlers\base.py"
>  
> in _get_response
>   113. response = wrapped_callback(request, 
> *callback_args, **callback_kwargs)
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\contrib\auth\decorators.py"
>  
> in _wrapped_view
>   21. return view_func(request, *args, **kwargs)
>
> File "C:\Users\Admin\PycharmProjects\autotask\autotask\dashboard\views.py" 
> in add_job
>   41. if form.is_valid():
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\forms\forms.py"
>  
> in is_valid
>   185. return self.is_bound and not self.errors
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\forms\forms.py"
>  
> in errors
>   180. self.full_clean()
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\forms\forms.py"
>  
> in full_clean
>   381. self._clean_fields()
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\forms\forms.py"
>  
> in _clean_fields
>   402. value = getattr(self, 'clean_%s' % name)()
>
> File "C:\Users\Admin\PycharmProjects\autotask\autotask\dashboard\forms.py" 
> in clean_job
>   46. job_db = Job.objects.get(job_name=job)
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\db\models\manager.py"
>  
> in manager_method
>   82. return getattr(self.get_queryset(), name)(*args, 
> **kwargs)
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\db\models\query.py"
>  
> in get
>   408. self.model._meta.object_name
>
> Exception Type: DoesNotExist at /dashboard/add_job/
> Exception Value: Job matching query does not exist.
>
> but when i use the query on cmd prompt then it works fine.
> How to fix this? plz help
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/42bfb6a9-963e-4cb8-a2d9-8e2cf540bffa%40googlegroups.com.


Re: Bug or Feature: Trailing Slash appended to two places in a URL

2019-10-21 Thread lemme smash
i'm not sure, but i can say that it's quite strange not to have trailing 
slash on `include` path. you want to have something like `api/v1case`?

On Sunday, October 20, 2019 at 1:07:48 AM UTC+3, Conor wrote:
>
> Hi All,
>
> I'm not sure whether this is a feature or a bug, so I thought it best to 
> air it here before filing a bug report.
>
> In short I have a URL which will be '/api/v1/case/' if APPEND_SLASH false 
> True, or '/api/v1 case' if APPEND_SLASH = False.
>
> To reproduce this, I have a project urls.py file with the following
>
>  path('api/v1', include('api.urls')) - (note there is no trailing slash)
>
> And an api/urls.py with the following
>
> path('case', CasesView.as_view(), name='all-cases'),
>
> What I assume is happening is that my complete URL is made up of two URLs, 
> namely the first URL from the project urls.py file and the second URL from 
> api/urls.py, and that the method that append's a slash to URLs is appending 
> a slash to both of them. If you have APPEND_SLASH to True, then the URL is 
> accessible via '/api/v1/case/' or '/api/v1/case', but if it APPEND_SLASH is 
> False, then the URL becomes '/api/v1 case'
>
> The thing that makes me think that perhaps this isn't a bug, is that I 
> seemingly just didn't configure Django properly. It could be as simple as 
> that.
>
> However, the reason I think this is a bug, is that the behaviour, at least 
> to me is non-obvious. That's not to say when you stop and think about it 
> that it isn't perhaps logical, if indeed there are two URLs which have 
> slashes appended to them in order to make the final URL, but on first 
> glance when I read about Django's APPEND_SLASH feature, I think of the 
> final URL, the one that the user will see, not of two separate URLs  that 
> are being put together to make the final product.
>
> Please let me know your thoughts and if you think it is a bug or not.
>
> Cheers,
>
> Conor
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/24348c6b-4fb5-4e9c-b039-04f5f51faf80%40googlegroups.com.


Re: unable to validate and save modelform data into mysql database...

2019-10-22 Thread lemme smash
okay, man. seems like you need to read and repeat everything you know about 
python and django. i highly recommend you to go through django tutorial.

On Monday, October 21, 2019 at 3:49:01 PM UTC+3, Gourab Mahapatra wrote:
>
> Traceback:
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\core\handlers\exception.py"
>  
> in inner
>   34. response = get_response(request)
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\core\handlers\base.py"
>  
> in _get_response
>   115. response = self.process_exception_by_middleware(e, 
> request)
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\core\handlers\base.py"
>  
> in _get_response
>   113. response = wrapped_callback(request, 
> *callback_args, **callback_kwargs)
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\contrib\auth\decorators.py"
>  
> in _wrapped_view
>   21. return view_func(request, *args, **kwargs)
>
> File "C:\Users\Admin\PycharmProjects\autotask\autotask\dashboard\views.py" 
> in add_job
>   41. if form.is_valid():
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\forms\forms.py"
>  
> in is_valid
>   185. return self.is_bound and not self.errors
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\forms\forms.py"
>  
> in errors
>   180. self.full_clean()
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\forms\forms.py"
>  
> in full_clean
>   381. self._clean_fields()
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\forms\forms.py"
>  
> in _clean_fields
>   402. value = getattr(self, 'clean_%s' % name)()
>
> File "C:\Users\Admin\PycharmProjects\autotask\autotask\dashboard\forms.py" 
> in clean_job
>   46. job_db = Job.objects.get(job_name=job)
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\db\models\manager.py"
>  
> in manager_method
>   82. return getattr(self.get_queryset(), name)(*args, 
> **kwargs)
>
> File 
> "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\db\models\query.py"
>  
> in get
>   408. self.model._meta.object_name
>
> Exception Type: DoesNotExist at /dashboard/add_job/
> Exception Value: Job matching query does not exist.
>
> but when i use the query on cmd prompt then it works fine.
> How to fix this? plz help
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bbb58f0a-3b59-493f-9c64-8aad911b78fd%40googlegroups.com.


Re: DJANGO, MySQL, NGINX stack for a production hosting server in Digital Ocean droplet

2019-11-05 Thread lemme smash
i'm recommend you to consider docker setup like
https://docs.docker.com/machine/examples/ocean/
https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/#nginx

On Tuesday, November 5, 2019 at 1:27:55 AM UTC+3, Ram wrote:
>
> Hi,
> Please let me know if anyone has setup this stack in your hosting server 
> with Digital Ocean? I appreciate if you can share the appropriate working 
> steps.
> thanks,
> ~Ram
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2fe5f56b-7dd4-45c7-b6a6-e8f5227a3c22%40googlegroups.com.


Re: Django DEBUG magic, and a bizarre bug under django-extra-views

2019-12-16 Thread lemme smash
i feel for you, but from this description there is no way to figure out how 
to help. it's way too abstract. so you probably may want to provide code 
piece and traceback to get any kind of help here.

On Saturday, December 7, 2019 at 2:08:41 AM UTC+3, Alaina Rowe wrote:
>
> I have not been able to reproduce the bug I am about to describe when 
> DEBUG is True, whether in production on Apache or locally on the Django dev 
> server. So my first question is: What is all the magic that Django DEBUG 
> does behind the scenes? The documentation doesn't have very much 
> information about this.
>
> Now for the bug. I understand that the following description is too 
> bare-bones for anyone to reproduce, but I have IP to protect, and I don't 
> have much hope of the error being reproduced anyway.
>
> Suppose I have a Django project with at least two apps, app alice with 
> model A and app bob with model B.
>
> I am using UpdateWithInlinesView from django-extra-views. The error occurs 
> when this view constructs a formset from instances of model A. In my email 
> about the 500, I get a message like this:
>
> FieldError at /some/url/
> Cannot resolve keyword 'field_of_A' into field. Choices are: field_of_B_1, 
> field_of_B_2, field_of_B_3
>
> I've gotten this type of error before. It normally happens when you tell a 
> form "I'm using model C" and "I'm using a field called debbie" and model C 
> doesn't have a field called debbie. That part makes sense. But this error 
> makes it look like it's checking against the field names of model B when it 
> should be checking model A. I have been racking my brain trying to figure 
> out how in the world the construction of a form from one model would 
> consult a different model from a different app.
>
> Furthermore, this doesn't happen most of the time, it goes away on server 
> restart, and it doesn't happen under DEBUG = True. So I'm wondering if it's 
> an app registry issue, some sort of race condition that gets the registry 
> out of whack. If so, then I might get somewhere by either understanding the 
> app registry better or understanding what DEBUG does.
>
> Any thoughts?
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a3d0924d-b3d1-4385-9d02-b0fae9defc07%40googlegroups.com.


Re: How to request data from an open source website such as Reddit or Github and display on the Local Django Website ?

2019-12-27 Thread lemme smash
you've really did the great, but in order to receive data from reddit 
you'll need to research on their api and it's not very related to django.

On Thursday, December 26, 2019 at 4:05:14 PM UTC+3, Shaurya Sharma wrote:
>
> Hey there ,  I am quite a newbie to Django and I am trying to understand 
> how API calls and requests work in Django. I have a simple Django website 
> that has User login and authentication system. I want a user to save the 
> top ten reddit posts and display them on their respective login system. I 
> have seen the request method in Python and some web-crawling methods. I am 
> unable to figure out a way to request data from Reddit . 
> Here is the code I have written so far : 
> https://github.com/darthvedder17/Django-Website-Reddit
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/07a182a6-c316-4081-906a-11523581234f%40googlegroups.com.


Re: angular setup for django (routes not working)

2019-12-27 Thread lemme smash
you doing something strange.
usually, when you want to setup angluar with django, you just using `ng 
serve` to handle all the interface, and just use django for data and api. 
it's not a good idea to render angular app with django

On Thursday, December 26, 2019 at 4:05:14 PM UTC+3, nitish kumar wrote:
>
> Hi 
>
>
> I am trying to integrate angular8 with Django (2.2.4).
>
>
> *Django side*:
>
> URL and view will load angular 'index.html'
>
> *angular:*
>
> some router-links.
> based on URL pattern page is getting loaded.
>
>
> *problem statement:*
>
> *if host only angular code using 'ng serve' router-link only load's 
> particular component instead of loading all links in the index.html file*
> *but when I host in Django router-link is loading the entire page again (i 
> can see this in developers tools network tab)*
>
> *can some please help..*
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b312fb36-f64b-4047-ba12-8f34867e369d%40googlegroups.com.