Re: Cannot deploy Django project on Heroku from a Ubuntu 18.04 laptop

2018-10-24 Thread Mo-rema07
Thanks, I installed cheetah3 and I am no longer getting the same error 
message. However, regardless of the python version in my pipfile or 
requirements.txt Hereku installs python-3.6.5 What could be the reason for 
this?

On Monday, October 22, 2018 at 7:24:51 PM UTC+2, Andréas Kühne wrote:
>
> The problem you are having has nothing to do with the python version. What 
> heroku is saying is that you should change to python 3.6.6 which you do by 
> adding a file to the project - see 
> https://devcenter.heroku.com/articles/deploying-python.
>
> The problem you are getting (and that hinders you from installing your 
> application) is that you are using a python 2.7 compatible plugin (Cheetah) 
> - that doesn't have any python 3 code. The error is that the code is not 
> python 3 compatible. (the syntax error you are getting at the end shows 
> this) - to install a Cheetah that you can use, install cheetah3.
>
> Regards,
>
> Andréas
>
>
> Den mån 22 okt. 2018 kl 14:21 skrev Mo-rema07  >:
>
>> Hello people,
>>
>> Can I please get help? I am a noob using a Lenovo V110 running Ubuntu 
>> 18.04. I am getting an  error that I am using python 3.6.5 instead of 
>> 3.6.6. However when I check the python version using "python3 --version" I 
>> find that my version is 3.6.6. Can someone please help I have been 
>> struggling with this issue for about 2 weeks and I cannot find the solution 
>> online.
>>
>> Thank you
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/7dc30e45-81f9-4ce0-8635-814651c3e340%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/2c7db603-e5a4-4f4c-98ad-666760e70d4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django unit testing and pk's changing

2018-10-24 Thread David
Hi

When I run tests on my app they run through fine.

When I run tests just using "manage.py test" the app mentioned above 
contains failures.

Example code:

def test_lumpsum_get_absolute_url(self):
lumpsum = LumpSum.objects.get()
self.assertEquals(lumpsum.get_absolute_url(),
  reverse('estates:lumpsum', kwargs={
  'case_pk': self.case.pk,
  'client_pk': self.client.pk,
  })
  )


Traceback (most recent call last):
  File "path\test_models.py", line 541, in test_lumpsum_get_absolute_url
'client_pk': lumpsum.client.pk,
AssertionError: '/estates/53/lumpsum/98/' != '/estates/113/lumpsum/98/'
- /estates/53/lumpsum/98/
?  ^
+ /estates/113/lumpsum/98/
?  

The case.pk (53 and 113 above) changes, yet the client.pk (98) does not.

I understand that setUp is run for each test, so expect the pk to rise, but 
I cannot fathom why only one of the PKs is changing.

In setUp:

self.case = Case.objects.create(
name='example case',
adviser=self.adviser,
meeting_date='2018-01-01',
urgency='N',
assignment_trust='N',
expression_wishes='N',
lifetime_planning='N',
home_savings='Y',
marriage_death='N',
inheritance_tax='Y',
inheritance_creditors='N',
inheritance_divorce='Y',
further_iht='N',
comment='just another comment',
)

self.client = Client.objects.create(
case=self.case,
prefix='Mr',
first_name='first name',
last_name='last name',
date_of_birth='1900-01-01',
gender='M',
residence='EN',
address_1='10 C',
city='city',
postcode='SOL',
telephone='0211 11',
marital_status='SI',
have_will='N',
existing_poa='N',
dependant='N',
share_house='N',
)

-- 
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/05ea3e16-0cba-446c-8166-00454ded503e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django unit testing and pk's changing

2018-10-24 Thread David
The issue was my using incorrect def get_absolute_url's in my model  My 
error.

On Wednesday, 24 October 2018 12:24:07 UTC+1, David wrote:
>
> Hi
>
> When I run tests on my app they run through fine.
>
> When I run tests just using "manage.py test" the app mentioned above 
> contains failures.
>
> Example code:
>
> def test_lumpsum_get_absolute_url(self):
> lumpsum = LumpSum.objects.get()
> self.assertEquals(lumpsum.get_absolute_url(),
>   reverse('estates:lumpsum', kwargs={
>   'case_pk': self.case.pk,
>   'client_pk': self.client.pk,
>   })
>   )
>
>
> Traceback (most recent call last):
>   File "path\test_models.py", line 541, in test_lumpsum_get_absolute_url
> 'client_pk': lumpsum.client.pk,
> AssertionError: '/estates/53/lumpsum/98/' != '/estates/113/lumpsum/98/'
> - /estates/53/lumpsum/98/
> ?  ^
> + /estates/113/lumpsum/98/
> ?  
>
> The case.pk (53 and 113 above) changes, yet the client.pk (98) does not.
>
> I understand that setUp is run for each test, so expect the pk to rise, 
> but I cannot fathom why only one of the PKs is changing.
>
> In setUp:
>
> self.case = Case.objects.create(
> name='example case',
> adviser=self.adviser,
> meeting_date='2018-01-01',
> urgency='N',
> assignment_trust='N',
> expression_wishes='N',
> lifetime_planning='N',
> home_savings='Y',
> marriage_death='N',
> inheritance_tax='Y',
> inheritance_creditors='N',
> inheritance_divorce='Y',
> further_iht='N',
> comment='just another comment',
> )
>
> self.client = Client.objects.create(
> case=self.case,
> prefix='Mr',
> first_name='first name',
> last_name='last name',
> date_of_birth='1900-01-01',
> gender='M',
> residence='EN',
> address_1='10 C',
> city='city',
> postcode='SOL',
> telephone='0211 11',
> marital_status='SI',
> have_will='N',
> existing_poa='N',
> dependant='N',
> share_house='N',
> )
>

-- 
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/f72902ab-9dd3-4cfc-8b05-f9dc090d0a8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


I Suck

2018-10-24 Thread Edson Rodrigues
This is just an outburst. I have been trying to learn Django for months and 
I do not learn. I already paid for a course at Udemy, followed tutorials on 
YouTube, followed the Django Project tutorial and nothing worked to me. I 
am a failure as a programmer / developer. :(

-- 
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/15ac9bcf-7b41-40a0-ae59-46fc915e03d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: new to django

2018-10-24 Thread Aditya Bohra


On Thursday, October 18, 2018 at 2:51:02 PM UTC+5:30, shubham...@gmail.com 
wrote:
>
> "django-admin startproject mysite" i tried to run this in cmd propmt but it 
> is not working showing "django-admin' is not recognized as an internal or 
> external command," what to do?
>
> Is it working now

-- 
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/64032c27-c402-4f42-8530-12b2ca56ad5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I Suck

2018-10-24 Thread vineeth sagar
Hi,

This kind of attitude gets you no where my man, Programming is supposed to
be hard. You pick-up things every day. First focus on your weaknesses and
then work your way up. If you don't have good python experience learn
python first and then comeback to django. If there is some part of django
you don't understand read the docs like a thousand times or even post it
here people are glad to help. try this as a last resort
https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django Be
patient no one masters something by doing a udemy course or a week or a
month. See this video https://www.youtube.com/watch?v=hIJdFxYlEKE



On Wed, Oct 24, 2018 at 8:05 PM Edson Rodrigues 
wrote:

> This is just an outburst. I have been trying to learn Django for months
> and I do not learn. I already paid for a course at Udemy, followed
> tutorials on YouTube, followed the Django Project tutorial and nothing
> worked to me. I am a failure as a programmer / developer. :(
>
> --
> 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/15ac9bcf-7b41-40a0-ae59-46fc915e03d2%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAMMZq8MincB3mJkJ2PDz8NTQAMmwq9vYSDRYjuRLyer7r3tyiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: new to django

2018-10-24 Thread Ing.Daniel Bojorge
Thanks for tell us.


Dios L@s Bendiga

Saludos,



[image: --]

daniel.bojorge
[image: http://]about.me/daniel.bojorge

 *Curso Django 2.1 (Course of Django 2.1)* 
Mi Blog 
Nicaragua

"Si ustedes permanecen unidos a mí, y si permanecen fieles a mis
enseñanzas, pidan lo que quieran y se les dará.
(Juan 15:7 DHH)
Bendito el varón que se fía en el SEÑOR, y cuya confianza es el SEÑOR.
(Jeremías 17:7 RV2000)



El mié., 24 oct. 2018 a las 8:35, Aditya Bohra ()
escribió:

>
>
> On Thursday, October 18, 2018 at 2:51:02 PM UTC+5:30, shubham...@gmail.com
> wrote:
>>
>> "django-admin startproject mysite" i tried to run this in cmd propmt but it 
>> is not working showing "django-admin' is not recognized as an internal or 
>> external command," what to do?
>>
>> Is it working now
>
> --
> 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/64032c27-c402-4f42-8530-12b2ca56ad5d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAMQeQjZRi_rnCmT2RHoVDnjLrWVb2pmnc-XuiNhSLgXbKDM2cg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I Suck

2018-10-24 Thread Ing.Daniel Bojorge
Try to learn with an case or problem that you want to resolv.  Try to
automatize some task, and then You can go learning with the practice.

Code is hard, but is beautifull!!!


Dios L@s Bendiga

Saludos,



[image: --]

daniel.bojorge
[image: http://]about.me/daniel.bojorge

 *Curso Django 2.1* 
Mi Blog 
Nicaragua

"Si ustedes permanecen unidos a mí, y si permanecen fieles a mis
enseñanzas, pidan lo que quieran y se les dará.
(Juan 15:7 DHH)
Bendito el varón que se fía en el SEÑOR, y cuya confianza es el SEÑOR.
(Jeremías 17:7 RV2000)



El mié., 24 oct. 2018 a las 8:47, vineeth sagar ()
escribió:

> Hi,
>
> This kind of attitude gets you no where my man, Programming is supposed to
> be hard. You pick-up things every day. First focus on your weaknesses and
> then work your way up. If you don't have good python experience learn
> python first and then comeback to django. If there is some part of django
> you don't understand read the docs like a thousand times or even post it
> here people are glad to help. try this as a last resort
> https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django Be
> patient no one masters something by doing a udemy course or a week or a
> month. See this video https://www.youtube.com/watch?v=hIJdFxYlEKE
>
>
>
> On Wed, Oct 24, 2018 at 8:05 PM Edson Rodrigues 
> wrote:
>
>> This is just an outburst. I have been trying to learn Django for months
>> and I do not learn. I already paid for a course at Udemy, followed
>> tutorials on YouTube, followed the Django Project tutorial and nothing
>> worked to me. I am a failure as a programmer / developer. :(
>>
>> --
>> 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/15ac9bcf-7b41-40a0-ae59-46fc915e03d2%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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/CAMMZq8MincB3mJkJ2PDz8NTQAMmwq9vYSDRYjuRLyer7r3tyiQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAMQeQjbb%3DmigRTOhncNtnA4nrrTqzW6MxAqoO8cWnKx7yuQa1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django auto-deletes field related to MySQL Transactions

2018-10-24 Thread RyanW
Hi Matthew and Joel. Thanks for your help.

I'm attaching the models.py, views.py and templates for your reference.  
I'm drawing a blank on the implementation that could trigger a delete.

Thanks again

On Tuesday, October 23, 2018 at 11:54:17 AM UTC-5, Matthew Pava wrote:
>
> And make sure your form is posting to the save view and not the delete 
> view.  Maybe show us your template.
>
>  
>
> *From:* django...@googlegroups.com  [mailto:
> django...@googlegroups.com ] *On Behalf Of *Joel
> *Sent:* Tuesday, October 23, 2018 11:32 AM
> *To:* django...@googlegroups.com 
> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>
>  
>
> You could have a signal which captures all these and logs its origin.
>
>  
>
> On Tue, 23 Oct, 2018, 9:35 PM RyanW, > 
> wrote:
>
> Yes, I honestly don't see how Django could be doing this either.  The only 
> I could think of was user deletion, but no one has claimed to have done so.
>
>  
>
> No other apps are connected.
>
>  
>
> Thanks for the tip!!
>
>
> On Tuesday, October 23, 2018 at 10:05:51 AM UTC-5, Matthew Pava wrote:
>
> It doesn’t seem like Django would be doing this.
>
> Do you have any other apps connected to the database?
>
> You’ll probably want to surround your URL in quotation marks.   url ‘epedelete’ epe.id %}”>
>
>  
>
>  
>
> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On 
> Behalf Of *RyanW
> *Sent:* Tuesday, October 23, 2018 9:33 AM
> *To:* Django users
> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>
>  
>
> I have a button to delete a record by the user, displayed inside a 
> template as:
>
>  
>
>  type="button" value="Delete" />
>
>
> and the function in views.py
>
>  
>
> def delete(request, part_id=None):
>
> obj = epe.objects.get(id=part_id)
>
> obj.delete()
>
> return HttpResponseRedirect(reverse('epe_home'))
>
>
> Other than that, I have some ForeignKey restraints on_delete to preserve 
> integrity, like so:
>
> epe_ani2 = models.ForeignKey(
>
> Subjects,
>
> on_delete=models.PROTECT,
>
> null=True,
>
> blank=True
>
> )
>
>
> As for the authentication backend, I'm using the default provided by 
> Django:
>
> ['django.contrib.auth.backends.ModelBackend']
>
>  
>
> Thank you for the help!
>
>
> On Tuesday, October 23, 2018 at 9:16:24 AM UTC-5, Matthew Pava wrote:
>
> Check your source code for any delete commands.
>
> This might also be your authentication backend.  Which one are you using?
>
>  
>
> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On 
> Behalf Of *RyanW
> *Sent:* Monday, October 22, 2018 7:55 PM
> *To:* Django users
> *Subject:* Django auto-deletes field related to MySQL Transactions
>
>  
>
> I have a Django site I'm developing, which I've connected to a MySQL db.  
> I haven't deployed into production yet, as I'm still working on a couple of 
> things, however I leave the server running in development for initial data 
> entry. 
>
>  
>
> I've noticed that some of the records already inputted gets deleted, 
> seemingly randomly. I enabled logging on MySQL and found logs like the 
> following:
>
>  
>
> 6798 Connect
> rya...@cobb.eyes.uab.edu on downswebdb2
>
> 6798 Query
> SET NAMES utf8
>
> 6798 Query
> set autocommit=0
>
> 6798 Query
> set autocommit=1
>
> 6798 Query
> SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
>
> 6798 Query
> SELECT `Epe_epe`.`id`, `Epe_epe`.`epe_type`, `Epe_epe`.`epe_type2_id`, 
> `Epe_epe`.`epe_date`, `Epe_epe`.`epe_ani`, `Epe_epe`.`epe_ani2_id`, 
> `Epe_epe`.`epe_apn`, `Epe_epe`.`epe_apn2_id`, `Epe_epe`.`epe_weight`, 
> `Epe_epe`.`epe_drug_type1`, `Epe_epe`.`epe_drug1`, `Epe_epe`.`epe_dose1`, 
> `Epe_epe`.`epe_amount1`, `Epe_epe`.`epe_route1`, `Epe_epe`.`epe_time1`, 
> `Epe_epe`.`epe_drug_type2`, `Epe_epe`.`epe_drug2`, `Epe_epe`.`epe_dose2`, 
> `Epe_epe`.`epe_amount2`, `Epe_epe`.`epe_route2`, `Epe_epe`.`epe_time2`, 
> `Epe_epe`.`epe_drug_type3`, `Epe_epe`.`epe_drug3`, `Epe_epe`.`epe_dose3`, 
> `Epe_epe`.`epe_amount3`, `Epe_epe`.`epe_route3`, `Epe_epe`.`epe_time3`, 
> `Epe_epe`.`epe_drug_type4`, `Epe_epe`.`epe_drug4`, `Epe_epe`.`epe_dose4`, 
> `Epe_epe`.`epe_amount4`, `Epe_epe`.`epe_route4`, `Epe_epe`.`epe_time4`, 
> `Epe_epe`.`epe_drug_type5`, `Epe_epe`.`epe_drug5`, `Epe_epe`.`epe_dose5`, 
> `Epe_epe`.`epe_amount5`, `Epe_epe`.`epe_route5`, `Epe_epe`.`epe_time5`, 
> `Epe_epe`.`epe_drug_type6`, `Epe_epe`.`epe_drug6`, `Epe_epe`.`epe_dose6`, 
> `Epe_epe`.`epe_amount6`, `Epe_epe`.`epe_route6`, `Epe_epe`.`epe_time6`, 
> `Epe_epe`.`epe_iso_start`, `Epe_epe`.`epe_iso_end`, `Epe_epe`.`epe_o2_end`
> , `Epe_epe`.`epe_start1`, `Epe_epe`.`epe_start2`, `Epe_epe`.`epe_start3`, 
> `Epe_epe`.`epe_start4`, `Epe_epe`.`epe_start5`, `Epe_epe`.`epe_start6`, 
> `Epe_epe`.`epe_start7`, `Epe_epe`.`epe_start8`, `Epe_epe`.`epe_hr1`, 
> `Epe_epe`.`epe_hr2`, `Epe_epe`.`epe_hr3`, `Epe_epe`.`epe_hr4`, `Epe_epe`.
> `epe_hr5`, `Epe_epe`.`epe_hr6`, `Epe_epe`.`epe_hr7`, `Epe_epe`.`

Re: I Suck

2018-10-24 Thread Ishtiaq Ahsan
I also did suck. I think it was worse than yours. It was just few months
ago. Now I am pretty comfortable with almost any backend framework.

So asking you few questions:

Q1: Do you know python?
Q2: Are you familiar with MVC or similar architectural concepts?
Q3: Do you know any other backend framework (like Laravel/Flusk/Express.js)?


Regards
Ishtiaq


On Wed, 24 Oct 2018 at 8:35 PM, Edson Rodrigues 
wrote:

> This is just an outburst. I have been trying to learn Django for months
> and I do not learn. I already paid for a course at Udemy, followed
> tutorials on YouTube, followed the Django Project tutorial and nothing
> worked to me. I am a failure as a programmer / developer. :(
>
> --
> 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/15ac9bcf-7b41-40a0-ae59-46fc915e03d2%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Best regards,

Ishtiaq
(+88) 016 1000 1101

-- 
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/CAPhY7UNjOkRuwguFDhxN2%3DB7K6L6bN-s_1jMfkbif_iQ4VHyzQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: Django auto-deletes field related to MySQL Transactions

2018-10-24 Thread Matthew Pava
I can’t see anything wrong with what you’ve presented.  Try generating a new 
database and using that.  See if you still get random deletes on that database.

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of RyanW
Sent: Wednesday, October 24, 2018 9:51 AM
To: Django users
Subject: Re: Django auto-deletes field related to MySQL Transactions

Hi Matthew and Joel. Thanks for your help.

I'm attaching the models.py, views.py and templates for your reference.  I'm 
drawing a blank on the implementation that could trigger a delete.

Thanks again

On Tuesday, October 23, 2018 at 11:54:17 AM UTC-5, Matthew Pava wrote:
And make sure your form is posting to the save view and not the delete view.  
Maybe show us your template.

From: django...@googlegroups.com 
[mailto:django...@googlegroups.com] On Behalf Of Joel
Sent: Tuesday, October 23, 2018 11:32 AM
To: django...@googlegroups.com
Subject: Re: Django auto-deletes field related to MySQL Transactions

You could have a signal which captures all these and logs its origin.

On Tue, 23 Oct, 2018, 9:35 PM RyanW, > wrote:
Yes, I honestly don't see how Django could be doing this either.  The only I 
could think of was user deletion, but no one has claimed to have done so.

No other apps are connected.

Thanks for the tip!!

On Tuesday, October 23, 2018 at 10:05:51 AM UTC-5, Matthew Pava wrote:
It doesn’t seem like Django would be doing this.
Do you have any other apps connected to the database?
You’ll probably want to surround your URL in quotation marks.  http://epe.id> %}”>


From: django...@googlegroups.com [mailto:django...@googlegroups.com] On Behalf 
Of RyanW
Sent: Tuesday, October 23, 2018 9:33 AM
To: Django users
Subject: Re: Django auto-deletes field related to MySQL Transactions

I have a button to delete a record by the user, displayed inside a template as:



and the function in views.py

def delete(request, part_id=None):
obj = epe.objects.get(id=part_id)
obj.delete()
return HttpResponseRedirect(reverse('epe_home'))

Other than that, I have some ForeignKey restraints on_delete to preserve 
integrity, like so:
epe_ani2 = models.ForeignKey(
Subjects,
on_delete=models.PROTECT,
null=True,
blank=True
)

As for the authentication backend, I'm using the default provided by Django:

['django.contrib.auth.backends.ModelBackend']

Thank you for the help!

On Tuesday, October 23, 2018 at 9:16:24 AM UTC-5, Matthew Pava wrote:
Check your source code for any delete commands.
This might also be your authentication backend.  Which one are you using?

From: django...@googlegroups.com [mailto:django...@googlegroups.com] On Behalf 
Of RyanW
Sent: Monday, October 22, 2018 7:55 PM
To: Django users
Subject: Django auto-deletes field related to MySQL Transactions

I have a Django site I'm developing, which I've connected to a MySQL db.  I 
haven't deployed into production yet, as I'm still working on a couple of 
things, however I leave the server running in development for initial data 
entry.

I've noticed that some of the records already inputted gets deleted, seemingly 
randomly. I enabled logging on MySQL and found logs like the following:

6798 Connect
rya...@cobb.eyes.uab.edu on downswebdb2
6798 Query
SET NAMES utf8
6798 Query
set autocommit=0
6798 Query
set autocommit=1
6798 Query
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
6798 Query
SELECT `Epe_epe`.`id`, `Epe_epe`.`epe_type`, `Epe_epe`.`epe_type2_id`, 
`Epe_epe`.`epe_date`, `Epe_epe`.`epe_ani`, `Epe_epe`.`epe_ani2_id`, 
`Epe_epe`.`epe_apn`, `Epe_epe`.`epe_apn2_id`, `Epe_epe`.`epe_weight`, 
`Epe_epe`.`epe_drug_type1`, `Epe_epe`.`epe_drug1`, `Epe_epe`.`epe_dose1`, 
`Epe_epe`.`epe_amount1`, `Epe_epe`.`epe_route1`, `Epe_epe`.`epe_time1`, 
`Epe_epe`.`epe_drug_type2`, `Epe_epe`.`epe_drug2`, `Epe_epe`.`epe_dose2`, 
`Epe_epe`.`epe_amount2`, `Epe_epe`.`epe_route2`, `Epe_epe`.`epe_time2`, 
`Epe_epe`.`epe_drug_type3`, `Epe_epe`.`epe_drug3`, `Epe_epe`.`epe_dose3`, 
`Epe_epe`.`epe_amount3`, `Epe_epe`.`epe_route3`, `Epe_epe`.`epe_time3`, 
`Epe_epe`.`epe_drug_type4`, `Epe_epe`.`epe_drug4`, `Epe_epe`.`epe_dose4`, 
`Epe_epe`.`epe_amount4`, `Epe_epe`.`epe_route4`, `Epe_epe`.`epe_time4`, 
`Epe_epe`.`epe_drug_type5`, `Epe_epe`.`epe_drug5`, `Epe_epe`.`epe_dose5`, 
`Epe_epe`.`epe_amount5`, `Epe_epe`.`epe_route5`, `Epe_epe`.`epe_time5`, 
`Epe_epe`.`epe_drug_type6`, `Epe_epe`.`epe_drug6`, `Epe_epe`.`epe_dose6`, 
`Epe_epe`.`epe_amount6`, `Epe_epe`.`epe_route6`, `Epe_epe`.`epe_time6`, 
`Epe_epe`.`epe_iso_start`, `Epe_epe`.`epe_iso_end`, `Epe_epe`.`epe_o2_end`, 
`Epe_epe`.`epe_start1`, `Epe_epe`.`epe_start2`, `Epe_epe`.`epe_start3`, 
`Epe_epe`.`epe_start4`, `Epe_epe`.`epe_start5`, `Epe_epe`.`epe_start6`, 
`Epe_epe`.`epe_start7`, `Epe_epe`.`epe_start8`, `Epe_epe`.`epe_hr1`, 
`Epe_epe`.`epe_hr2`, `Epe_epe`.`epe_hr3`, `Epe_epe`.`epe_hr4`, 
`Epe_epe`.`epe_hr5`, `Epe_epe`.`epe_hr6`, `Epe_epe`.`epe_hr7`, 
`Epe_epe`.`epe_hr8`, `Epe_epe`.`epe_spo2_1`, `E

Re: Django auto-deletes field related to MySQL Transactions

2018-10-24 Thread RyanW
I've tried two separate MySQL db's on two separate servers.  They both have 
given me deletes.  What's strange is that I've set up a local copy on my 
laptop with both a local Postgres DB and MySQL connection, and I don't get 
the same deletes.

I've narrowed it down that it must be something the users are doing to 
trigger these deletes, based on logs that would've put them active during a 
time of a delete.

On Wednesday, October 24, 2018 at 10:03:00 AM UTC-5, Matthew Pava wrote:
>
> I can’t see anything wrong with what you’ve presented.  Try generating a 
> new database and using that.  See if you still get random deletes on that 
> database.
>
>  
>
> *From:* django...@googlegroups.com  [mailto:
> django...@googlegroups.com ] *On Behalf Of *RyanW
> *Sent:* Wednesday, October 24, 2018 9:51 AM
> *To:* Django users
> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>
>  
>
> Hi Matthew and Joel. Thanks for your help.
>
>  
>
> I'm attaching the models.py, views.py and templates for your reference.  
> I'm drawing a blank on the implementation that could trigger a delete.
>
>  
>
> Thanks again
>
>
> On Tuesday, October 23, 2018 at 11:54:17 AM UTC-5, Matthew Pava wrote:
>
> And make sure your form is posting to the save view and not the delete 
> view.  Maybe show us your template.
>
>  
>
> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On 
> Behalf Of *Joel
> *Sent:* Tuesday, October 23, 2018 11:32 AM
> *To:* django...@googlegroups.com
> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>
>  
>
> You could have a signal which captures all these and logs its origin.
>
>  
>
> On Tue, 23 Oct, 2018, 9:35 PM RyanW,  wrote:
>
> Yes, I honestly don't see how Django could be doing this either.  The only 
> I could think of was user deletion, but no one has claimed to have done so.
>
>  
>
> No other apps are connected.
>
>  
>
> Thanks for the tip!!
>
>
> On Tuesday, October 23, 2018 at 10:05:51 AM UTC-5, Matthew Pava wrote:
>
> It doesn’t seem like Django would be doing this.
>
> Do you have any other apps connected to the database?
>
> You’ll probably want to surround your URL in quotation marks.   url ‘epedelete’ epe.id %}”>
>
>  
>
>  
>
> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On 
> Behalf Of *RyanW
> *Sent:* Tuesday, October 23, 2018 9:33 AM
> *To:* Django users
> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>
>  
>
> I have a button to delete a record by the user, displayed inside a 
> template as:
>
>  
>
>  type="button" value="Delete" />
>
>
> and the function in views.py
>
>  
>
> def delete(request, part_id=None):
>
> obj = epe.objects.get(id=part_id)
>
> obj.delete()
>
> return HttpResponseRedirect(reverse('epe_home'))
>
>
> Other than that, I have some ForeignKey restraints on_delete to preserve 
> integrity, like so:
>
> epe_ani2 = models.ForeignKey(
>
> Subjects,
>
> on_delete=models.PROTECT,
>
> null=True,
>
> blank=True
>
> )
>
>
> As for the authentication backend, I'm using the default provided by 
> Django:
>
> ['django.contrib.auth.backends.ModelBackend']
>
>  
>
> Thank you for the help!
>
>
> On Tuesday, October 23, 2018 at 9:16:24 AM UTC-5, Matthew Pava wrote:
>
> Check your source code for any delete commands.
>
> This might also be your authentication backend.  Which one are you using?
>
>  
>
> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On 
> Behalf Of *RyanW
> *Sent:* Monday, October 22, 2018 7:55 PM
> *To:* Django users
> *Subject:* Django auto-deletes field related to MySQL Transactions
>
>  
>
> I have a Django site I'm developing, which I've connected to a MySQL db.  
> I haven't deployed into production yet, as I'm still working on a couple of 
> things, however I leave the server running in development for initial data 
> entry. 
>
>  
>
> I've noticed that some of the records already inputted gets deleted, 
> seemingly randomly. I enabled logging on MySQL and found logs like the 
> following:
>
>  
>
> 6798 Connect
> rya...@cobb.eyes.uab.edu on downswebdb2
>
> 6798 Query
> SET NAMES utf8
>
> 6798 Query
> set autocommit=0
>
> 6798 Query
> set autocommit=1
>
> 6798 Query
> SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
>
> 6798 Query
> SELECT `Epe_epe`.`id`, `Epe_epe`.`epe_type`, `Epe_epe`.`epe_type2_id`, 
> `Epe_epe`.`epe_date`, `Epe_epe`.`epe_ani`, `Epe_epe`.`epe_ani2_id`, 
> `Epe_epe`.`epe_apn`, `Epe_epe`.`epe_apn2_id`, `Epe_epe`.`epe_weight`, 
> `Epe_epe`.`epe_drug_type1`, `Epe_epe`.`epe_drug1`, `Epe_epe`.`epe_dose1`, 
> `Epe_epe`.`epe_amount1`, `Epe_epe`.`epe_route1`, `Epe_epe`.`epe_time1`, 
> `Epe_epe`.`epe_drug_type2`, `Epe_epe`.`epe_drug2`, `Epe_epe`.`epe_dose2`, 
> `Epe_epe`.`epe_amount2`, `Epe_epe`.`epe_route2`, `Epe_epe`.`epe_time2`, 
> `Epe_epe`.`epe_drug_type3`, `Epe_epe`.`epe_drug3`, `Epe_epe`.`epe_dose3`, 
> `Epe_epe`.`epe_amount3`, `Epe_epe`.`epe_rou

RE: Django auto-deletes field related to MySQL Transactions

2018-10-24 Thread Matthew Pava
In that case, is there something in a template that is possibly calling the 
delete view based on some user trigger, i.e. some Javascript function?

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of RyanW
Sent: Wednesday, October 24, 2018 10:11 AM
To: Django users
Subject: Re: Django auto-deletes field related to MySQL Transactions

I've tried two separate MySQL db's on two separate servers.  They both have 
given me deletes.  What's strange is that I've set up a local copy on my laptop 
with both a local Postgres DB and MySQL connection, and I don't get the same 
deletes.

I've narrowed it down that it must be something the users are doing to trigger 
these deletes, based on logs that would've put them active during a time of a 
delete.

On Wednesday, October 24, 2018 at 10:03:00 AM UTC-5, Matthew Pava wrote:
I can’t see anything wrong with what you’ve presented.  Try generating a new 
database and using that.  See if you still get random deletes on that database.

From: django...@googlegroups.com 
[mailto:django...@googlegroups.com] On Behalf Of RyanW
Sent: Wednesday, October 24, 2018 9:51 AM
To: Django users
Subject: Re: Django auto-deletes field related to MySQL Transactions

Hi Matthew and Joel. Thanks for your help.

I'm attaching the models.py, views.py and templates for your reference.  I'm 
drawing a blank on the implementation that could trigger a delete.

Thanks again

On Tuesday, October 23, 2018 at 11:54:17 AM UTC-5, Matthew Pava wrote:
And make sure your form is posting to the save view and not the delete view.  
Maybe show us your template.

From: django...@googlegroups.com [mailto:django...@googlegroups.com] On Behalf 
Of Joel
Sent: Tuesday, October 23, 2018 11:32 AM
To: django...@googlegroups.com
Subject: Re: Django auto-deletes field related to MySQL Transactions

You could have a signal which captures all these and logs its origin.

On Tue, 23 Oct, 2018, 9:35 PM RyanW,  wrote:
Yes, I honestly don't see how Django could be doing this either.  The only I 
could think of was user deletion, but no one has claimed to have done so.

No other apps are connected.

Thanks for the tip!!

On Tuesday, October 23, 2018 at 10:05:51 AM UTC-5, Matthew Pava wrote:
It doesn’t seem like Django would be doing this.
Do you have any other apps connected to the database?
You’ll probably want to surround your URL in quotation marks.  http://epe.id> %}”>


From: django...@googlegroups.com [mailto:django...@googlegroups.com] On Behalf 
Of RyanW
Sent: Tuesday, October 23, 2018 9:33 AM
To: Django users
Subject: Re: Django auto-deletes field related to MySQL Transactions

I have a button to delete a record by the user, displayed inside a template as:



and the function in views.py

def delete(request, part_id=None):
obj = epe.objects.get(id=part_id)
obj.delete()
return HttpResponseRedirect(reverse('epe_home'))

Other than that, I have some ForeignKey restraints on_delete to preserve 
integrity, like so:
epe_ani2 = models.ForeignKey(
Subjects,
on_delete=models.PROTECT,
null=True,
blank=True
)

As for the authentication backend, I'm using the default provided by Django:

['django.contrib.auth.backends.ModelBackend']

Thank you for the help!

On Tuesday, October 23, 2018 at 9:16:24 AM UTC-5, Matthew Pava wrote:
Check your source code for any delete commands.
This might also be your authentication backend.  Which one are you using?

From: django...@googlegroups.com [mailto:django...@googlegroups.com] On Behalf 
Of RyanW
Sent: Monday, October 22, 2018 7:55 PM
To: Django users
Subject: Django auto-deletes field related to MySQL Transactions

I have a Django site I'm developing, which I've connected to a MySQL db.  I 
haven't deployed into production yet, as I'm still working on a couple of 
things, however I leave the server running in development for initial data 
entry.

I've noticed that some of the records already inputted gets deleted, seemingly 
randomly. I enabled logging on MySQL and found logs like the following:

6798 Connect
rya...@cobb.eyes.uab.edu on downswebdb2
6798 Query
SET NAMES utf8
6798 Query
set autocommit=0
6798 Query
set autocommit=1
6798 Query
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
6798 Query
SELECT `Epe_epe`.`id`, `Epe_epe`.`epe_type`, `Epe_epe`.`epe_type2_id`, 
`Epe_epe`.`epe_date`, `Epe_epe`.`epe_ani`, `Epe_epe`.`epe_ani2_id`, 
`Epe_epe`.`epe_apn`, `Epe_epe`.`epe_apn2_id`, `Epe_epe`.`epe_weight`, 
`Epe_epe`.`epe_drug_type1`, `Epe_epe`.`epe_drug1`, `Epe_epe`.`epe_dose1`, 
`Epe_epe`.`epe_amount1`, `Epe_epe`.`epe_route1`, `Epe_epe`.`epe_time1`, 
`Epe_epe`.`epe_drug_type2`, `Epe_epe`.`epe_drug2`, `Epe_epe`.`epe_dose2`, 
`Epe_epe`.`epe_amount2`, `Epe_epe`.`epe_route2`, `Epe_epe`.`epe_time2`, 
`Epe_epe`.`epe_drug_type3`, `Epe_epe`.`epe_drug3`, `Epe_epe`.`epe_dose3`, 
`Epe_epe`.`epe_amount3`, `Epe_epe`.`epe_route3`, `Epe_epe`.`epe_time3`, 
`Epe_epe`.`epe_drug_type4`, `Epe_epe`.`epe_drug4`, `Epe_ep

Re: new to django

2018-10-24 Thread Mamadou Harouna Diallo
Hello, Are you active your virtuel env ?
You must active the virtuel env

Le jeu. 18 oct. 2018 à 09:20,  a écrit :

> "django-admin startproject mysite" i tried to run this in cmd propmt but it 
> is not working showing "django-admin' is not recognized as an internal or 
> external command," what to do?
>
> --
> 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/843b5648-de8b-49a7-99da-965a1c64e871%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAO73PDoE41eBESrZ_gwmhddStkV_OaZ8_OY6CX6t-_Hh7AsVBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


I Suck

2018-10-24 Thread PARTH PATIL
Hey don't get disheartened,  even i faced the same problem when i was learning 
django for the first time. I will just you don't rush things. Just try doing 
some small things first. You can change a few lnes from example code and see 
how it affects the system. This kind of things really help.

Also you can try referring to this YouTube series 

Django Web Development with Python: 
https://www.youtube.com/playlist?list=PLQVvvaa0QuDeA05ZouE4OzDYLHY-XH-Nd

I found this one very useful, i have watched this 20 30 times and every time i 
learn something new must try
Also never give up you will learn it eventually, every one has a different 
learning pace nothing to be ashamed of

-- 
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/44b020f4-a064-4dfe-851f-c49edfc7d569%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: new to django

2018-10-24 Thread maunish dave
Chech if you have installed django or not
Type this command on cmd ' django pip install'

On Wed 24 Oct, 2018, 8:05 PM Aditya Bohra,  wrote:

>
>
> On Thursday, October 18, 2018 at 2:51:02 PM UTC+5:30, shubham...@gmail.com
> wrote:
>>
>> "django-admin startproject mysite" i tried to run this in cmd propmt but it 
>> is not working showing "django-admin' is not recognized as an internal or 
>> external command," what to do?
>>
>> Is it working now
>
> --
> 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/64032c27-c402-4f42-8530-12b2ca56ad5d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CALpJ3u%2Bpcqad6Mz3%2B4Tk_XSxjNOfFg2cZfNhNn93x-KvF5Tcmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I Suck

2018-10-24 Thread Vineet Kothari
We all suck, give it a go

On Wed 24 Oct, 2018, 10:49 PM PARTH PATIL,  wrote:

> Hey don't get disheartened,  even i faced the same problem when i was
> learning django for the first time. I will just you don't rush things. Just
> try doing some small things first. You can change a few lnes from example
> code and see how it affects the system. This kind of things really help.
>
> Also you can try referring to this YouTube series
>
> Django Web Development with Python:
> https://www.youtube.com/playlist?list=PLQVvvaa0QuDeA05ZouE4OzDYLHY-XH-Nd
>
> I found this one very useful, i have watched this 20 30 times and every
> time i learn something new must try
> Also never give up you will learn it eventually, every one has a different
> learning pace nothing to be ashamed of
>
> --
> 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/44b020f4-a064-4dfe-851f-c49edfc7d569%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAAcanstV4kp88H8sCQxupbEbeYVrH0UGz%2BOHTatJyV%2BS_nf4fQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I Suck

2018-10-24 Thread Ryan Gedwill
I felt the same as you while learning django, and I already had some
professional experience.

It is extremely overwhelming to learn something like this on your own. Even
people who go to college and get internships don't have to go through it.

Pick something you want to make, and break it down into as tiny of pieces
as you can. You want to make a blog? Start with registering a user from the
command line. Make a login form. Make the homepage. Make the navbar. Extend
the login form to send a confirmation email. Extend the registration form
to ask and store their address, or security questions. Make a page where
only logged in users can access. Just a blank page. Always work in small
steps like these. If I can't break them down like this, I usually try to
make a graphic on a piece of paper to help me visualize it.

Don't be afraid of the command line, it will allow you to test miniature
pieces of your code. Instead of trying to display something on a web page,
just try printing it to the console, usually getting it to the 'frontend'
(on a web page) is a whole separate step.

The #1 rule is to break everything down into tiny pieces that are
manageable.

On Wed, Oct 24, 2018 at 7:35 AM Edson Rodrigues 
wrote:

> This is just an outburst. I have been trying to learn Django for months
> and I do not learn. I already paid for a course at Udemy, followed
> tutorials on YouTube, followed the Django Project tutorial and nothing
> worked to me. I am a failure as a programmer / developer. :(
>
> --
> 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/15ac9bcf-7b41-40a0-ae59-46fc915e03d2%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CALG8KeAdnuHg5e%2Bfqbitph%2B6LrydRx4cCcxO%2BCNZrhT%2BMpgDBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: new to django

2018-10-24 Thread SHUBHAM .SINGH. RATHORE
First you createsuperuser than runserver

On Thu 18 Oct, 2018 2:50 pm ,  wrote:

> "django-admin startproject mysite" i tried to run this in cmd propmt but it 
> is not working showing "django-admin' is not recognized as an internal or 
> external command," what to do?
>
> --
> 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/843b5648-de8b-49a7-99da-965a1c64e871%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CALkhXJUwwL8GZTnGn6FfAm1GxWEhqkqsyRR%2Bsc4CXbvVRnVdQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django auto-deletes field related to MySQL Transactions

2018-10-24 Thread C. Kirby
Is this happening to production users? It is probably because their browser 
is doing pre-fetch of links to speed up their UX. GET request are 
considered by the browser to be safe (non-destructive) and ideally 
idempotent. YOu should _never_ put a destructive action behind a GET, it 
should always be behind a POST or (even better if you are going the full 
REST route) DELETE. 

On Wednesday, October 24, 2018 at 11:10:33 AM UTC-4, RyanW wrote:
>
> I've tried two separate MySQL db's on two separate servers.  They both 
> have given me deletes.  What's strange is that I've set up a local copy on 
> my laptop with both a local Postgres DB and MySQL connection, and I don't 
> get the same deletes.
>
> I've narrowed it down that it must be something the users are doing to 
> trigger these deletes, based on logs that would've put them active during a 
> time of a delete.
>
> On Wednesday, October 24, 2018 at 10:03:00 AM UTC-5, Matthew Pava wrote:
>>
>> I can’t see anything wrong with what you’ve presented.  Try generating a 
>> new database and using that.  See if you still get random deletes on that 
>> database.
>>
>>  
>>
>> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On 
>> Behalf Of *RyanW
>> *Sent:* Wednesday, October 24, 2018 9:51 AM
>> *To:* Django users
>> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>>
>>  
>>
>> Hi Matthew and Joel. Thanks for your help.
>>
>>  
>>
>> I'm attaching the models.py, views.py and templates for your reference.  
>> I'm drawing a blank on the implementation that could trigger a delete.
>>
>>  
>>
>> Thanks again
>>
>>
>> On Tuesday, October 23, 2018 at 11:54:17 AM UTC-5, Matthew Pava wrote:
>>
>> And make sure your form is posting to the save view and not the delete 
>> view.  Maybe show us your template.
>>
>>  
>>
>> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On 
>> Behalf Of *Joel
>> *Sent:* Tuesday, October 23, 2018 11:32 AM
>> *To:* django...@googlegroups.com
>> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>>
>>  
>>
>> You could have a signal which captures all these and logs its origin.
>>
>>  
>>
>> On Tue, 23 Oct, 2018, 9:35 PM RyanW,  wrote:
>>
>> Yes, I honestly don't see how Django could be doing this either.  The 
>> only I could think of was user deletion, but no one has claimed to have 
>> done so.
>>
>>  
>>
>> No other apps are connected.
>>
>>  
>>
>> Thanks for the tip!!
>>
>>
>> On Tuesday, October 23, 2018 at 10:05:51 AM UTC-5, Matthew Pava wrote:
>>
>> It doesn’t seem like Django would be doing this.
>>
>> Do you have any other apps connected to the database?
>>
>> You’ll probably want to surround your URL in quotation marks.  > href=”{% url ‘epedelete’ epe.id %}”>
>>
>>  
>>
>>  
>>
>> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On 
>> Behalf Of *RyanW
>> *Sent:* Tuesday, October 23, 2018 9:33 AM
>> *To:* Django users
>> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>>
>>  
>>
>> I have a button to delete a record by the user, displayed inside a 
>> template as:
>>
>>  
>>
>> > type="button" value="Delete" />
>>
>>
>> and the function in views.py
>>
>>  
>>
>> def delete(request, part_id=None):
>>
>> obj = epe.objects.get(id=part_id)
>>
>> obj.delete()
>>
>> return HttpResponseRedirect(reverse('epe_home'))
>>
>>
>> Other than that, I have some ForeignKey restraints on_delete to preserve 
>> integrity, like so:
>>
>> epe_ani2 = models.ForeignKey(
>>
>> Subjects,
>>
>> on_delete=models.PROTECT,
>>
>> null=True,
>>
>> blank=True
>>
>> )
>>
>>
>> As for the authentication backend, I'm using the default provided by 
>> Django:
>>
>> ['django.contrib.auth.backends.ModelBackend']
>>
>>  
>>
>> Thank you for the help!
>>
>>
>> On Tuesday, October 23, 2018 at 9:16:24 AM UTC-5, Matthew Pava wrote:
>>
>> Check your source code for any delete commands.
>>
>> This might also be your authentication backend.  Which one are you using?
>>
>>  
>>
>> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On 
>> Behalf Of *RyanW
>> *Sent:* Monday, October 22, 2018 7:55 PM
>> *To:* Django users
>> *Subject:* Django auto-deletes field related to MySQL Transactions
>>
>>  
>>
>> I have a Django site I'm developing, which I've connected to a MySQL db.  
>> I haven't deployed into production yet, as I'm still working on a couple of 
>> things, however I leave the server running in development for initial data 
>> entry. 
>>
>>  
>>
>> I've noticed that some of the records already inputted gets deleted, 
>> seemingly randomly. I enabled logging on MySQL and found logs like the 
>> following:
>>
>>  
>>
>> 6798 Connect
>> rya...@cobb.eyes.uab.edu on downswebdb2
>>
>> 6798 Query
>> SET NAMES utf8
>>
>> 6798 Query
>> set autocommit=0
>>
>> 6798 Query
>> set autocommit=1
>>
>> 6798 Query
>> SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
>>
>> 67

Re: Cannot deploy Django project on Heroku from a Ubuntu 18.04 laptop

2018-10-24 Thread Andréas Kühne
Hi again,

Great that you get it running.

The reason for it not upgrading the python version is that you need to
specify it in a special way on Heroku. I had the same problem - you just
need to look at the following:
https://devcenter.heroku.com/articles/python-runtimes#selecting-a-runtime

Add a file called runtime.txt, add the following contents:

python-3.6.6


Regards,

Andréas


Den ons 24 okt. 2018 kl 12:27 skrev Mo-rema07 :

> Thanks, I installed cheetah3 and I am no longer getting the same error
> message. However, regardless of the python version in my pipfile or
> requirements.txt Hereku installs python-3.6.5 What could be the reason for
> this?
>
> On Monday, October 22, 2018 at 7:24:51 PM UTC+2, Andréas Kühne wrote:
>>
>> The problem you are having has nothing to do with the python version.
>> What heroku is saying is that you should change to python 3.6.6 which you
>> do by adding a file to the project - see
>> https://devcenter.heroku.com/articles/deploying-python.
>>
>> The problem you are getting (and that hinders you from installing your
>> application) is that you are using a python 2.7 compatible plugin (Cheetah)
>> - that doesn't have any python 3 code. The error is that the code is not
>> python 3 compatible. (the syntax error you are getting at the end shows
>> this) - to install a Cheetah that you can use, install cheetah3.
>>
>> Regards,
>>
>> Andréas
>>
>>
>> Den mån 22 okt. 2018 kl 14:21 skrev Mo-rema07 :
>>
>>> Hello people,
>>>
>>> Can I please get help? I am a noob using a Lenovo V110 running Ubuntu
>>> 18.04. I am getting an  error that I am using python 3.6.5 instead of
>>> 3.6.6. However when I check the python version using "python3 --version" I
>>> find that my version is 3.6.6. Can someone please help I have been
>>> struggling with this issue for about 2 weeks and I cannot find the solution
>>> online.
>>>
>>> Thank you
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@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/7dc30e45-81f9-4ce0-8635-814651c3e340%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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/2c7db603-e5a4-4f4c-98ad-666760e70d4d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAK4qSCcbyg%3DJ%2BLFXWgDj2Nzu2c8x8o0ZNtpDqPTOJg%2BmB8xJuA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I Suck

2018-10-24 Thread Mark Phillips
Are you working on a project now? What is the project, and where are you
stuck? What specifically are you trying to get to work with django?

Let us know the specifics of your project and where you are stuck so we can
help!

You aren't alone in this - the purpose of this list is to help each other!

Mark

On Wed, Oct 24, 2018 at 10:43 AM Ryan Gedwill  wrote:

> I felt the same as you while learning django, and I already had some
> professional experience.
>
> It is extremely overwhelming to learn something like this on your own.
> Even people who go to college and get internships don't have to go through
> it.
>
> Pick something you want to make, and break it down into as tiny of pieces
> as you can. You want to make a blog? Start with registering a user from the
> command line. Make a login form. Make the homepage. Make the navbar. Extend
> the login form to send a confirmation email. Extend the registration form
> to ask and store their address, or security questions. Make a page where
> only logged in users can access. Just a blank page. Always work in small
> steps like these. If I can't break them down like this, I usually try to
> make a graphic on a piece of paper to help me visualize it.
>
> Don't be afraid of the command line, it will allow you to test miniature
> pieces of your code. Instead of trying to display something on a web page,
> just try printing it to the console, usually getting it to the 'frontend'
> (on a web page) is a whole separate step.
>
> The #1 rule is to break everything down into tiny pieces that are
> manageable.
>
> On Wed, Oct 24, 2018 at 7:35 AM Edson Rodrigues 
> wrote:
>
>> This is just an outburst. I have been trying to learn Django for months
>> and I do not learn. I already paid for a course at Udemy, followed
>> tutorials on YouTube, followed the Django Project tutorial and nothing
>> worked to me. I am a failure as a programmer / developer. :(
>>
>> --
>> 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/15ac9bcf-7b41-40a0-ae59-46fc915e03d2%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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/CALG8KeAdnuHg5e%2Bfqbitph%2B6LrydRx4cCcxO%2BCNZrhT%2BMpgDBg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAEqej2NkVtx%2BF60TMD2od-sp5pkAFS%2BBmKcAmyePXZaBdjt0LQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


new Django website with old mysql database

2018-10-24 Thread Thibaud MONTAGNON
Hello,
I got some problems to join my mysql database to django.

I install mysqlclient and I configure :

#settings.py
->
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'OPTIONS': {
'read_default_file': '/path/my.cnf',
}
}
}

#my.cnf
->
[client]
database = ddb_event
user = root
password = 
default-character-set = utf8

but when I run : python manage.py migrate

I got 

C:\Django\venv\mysite>python manage.py migrate

Traceback (most recent call last):
  File "C:\Program 
Files\Python37\lib\site-packages\django\db\backends\mysql\base.py", line 
15, in 
import MySQLdb as Database
  File "C:\Program Files\Python37\lib\site-packages\MySQLdb\__init__.py", 
line 18, in 
import _mysql
ImportError: DLL load failed: Le module spécifié est introuvable.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "manage.py", line 15, in 
execute_from_command_line(sys.argv)
  File "C:\Program 
Files\Python37\lib\site-packages\django\core\management\__init__.py", line 
381, in execute_from_command_line
utility.execute()
  File "C:\Program 
Files\Python37\lib\site-packages\django\core\management\__init__.py", line 
357, in execute
django.setup()
  File "C:\Program Files\Python37\lib\site-packages\django\__init__.py", 
line 24, in setup
apps.populate(settings.INSTALLED_APPS)
  File "C:\Program 
Files\Python37\lib\site-packages\django\apps\registry.py", line 112, in 
populate
app_config.import_models()
  File "C:\Program Files\Python37\lib\site-packages\django\apps\config.py", 
line 198, in import_models
self.models_module = import_module(models_module_name)
  File "C:\Program Files\Python37\lib\importlib\__init__.py", line 127, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1006, in _gcd_import
  File "", line 983, in _find_and_load
  File "", line 967, in _find_and_load_unlocked
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File "C:\Program 
Files\Python37\lib\site-packages\django\contrib\auth\models.py", line 2, in 

from django.contrib.auth.base_user import AbstractBaseUser, 
BaseUserManager
  File "C:\Program 
Files\Python37\lib\site-packages\django\contrib\auth\base_user.py", line 
47, in 
class AbstractBaseUser(models.Model):
  File "C:\Program 
Files\Python37\lib\site-packages\django\db\models\base.py", line 101, in 
__new__
new_class.add_to_class('_meta', Options(meta, app_label))
  File "C:\Program 
Files\Python37\lib\site-packages\django\db\models\base.py", line 305, in 
add_to_class
value.contribute_to_class(cls, name)
  File "C:\Program 
Files\Python37\lib\site-packages\django\db\models\options.py", line 203, in 
contribute_to_class
self.db_table = truncate_name(self.db_table, 
connection.ops.max_name_length())
  File "C:\Program Files\Python37\lib\site-packages\django\db\__init__.py", 
line 33, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "C:\Program Files\Python37\lib\site-packages\django\db\utils.py", 
line 202, in __getitem__
backend = load_backend(db['ENGINE'])
  File "C:\Program Files\Python37\lib\site-packages\django\db\utils.py", 
line 110, in load_backend
return import_module('%s.base' % backend_name)
  File "C:\Program Files\Python37\lib\importlib\__init__.py", line 127, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Program 
Files\Python37\lib\site-packages\django\db\backends\mysql\base.py", line 
20, in 
) from err
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?

Can you help me please ? (I'm new with 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 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/05da87dd-b970-470d-a0ab-9bde94092d1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I Suck

2018-10-24 Thread Holger Otto ANDRE
Hello

Weird !!! I just began the last week and I found it  piece of cake.
I am using Visual Studio 2017 community (its free) and you can find in MSDN
and Microsoft Academy very simple to follow tutorials and samples
You can give it a try

*Holger André*


On Wed, Oct 24, 2018 at 8:35 AM Edson Rodrigues 
wrote:

> This is just an outburst. I have been trying to learn Django for months
> and I do not learn. I already paid for a course at Udemy, followed
> tutorials on YouTube, followed the Django Project tutorial and nothing
> worked to me. I am a failure as a programmer / developer. :(
>
> --
> 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/15ac9bcf-7b41-40a0-ae59-46fc915e03d2%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAL0dL5YauZn5be6SJiSb38J7MXDe4UPhTp5WV4vgYTWERAwhnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I Suck

2018-10-24 Thread Gerardo Palazuelos Guerrero
Dude,
We are all like you, at some point. I'm also an experienced programmer, and
Django has been kind of different. I'm still learning.

Listen the other guys: set a goal and solve it. Simple.

Good luck.

--
Gerardo Palazuelos Guerrero



On Wed, Oct 24, 2018 at 8:35 AM Edson Rodrigues 
wrote:

> This is just an outburst. I have been trying to learn Django for months
> and I do not learn. I already paid for a course at Udemy, followed
> tutorials on YouTube, followed the Django Project tutorial and nothing
> worked to me. I am a failure as a programmer / developer. :(
>
> --
> 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/15ac9bcf-7b41-40a0-ae59-46fc915e03d2%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAJ8iCyO3BaNL8SbPpXdg8U23RzcLgE3OFKZotrbAsyU3kN0Fzw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Adding crop and rotate to django image upload

2018-10-24 Thread 2012 . us
Hello,

I confess that I have no experience with django. 
I have a project where the django app was written by developers and I want 
to add a few things to a form that uploads an image. The image currently 
uploads but the user cannot rotate and crop the image to their liking. 

The site is using

class ExampleModel(models.Model):
model_pic = models.ImageField(upload_to = 'pic_folder/'

in the form for image uploading. And the form code where the image is 
uploaded...
Upload Photo

(Maximum image size should be 8 MB)



I would like to incorporate rotate and crop functions to the image where 
the user can adjust these settings on the same form before it is saved. 

I found this:

https://pqina.nl/slim/

and wonder if it can be used in the django form.
Otherwise, maybe PIL can be used; it is already incorporated on the site for 
automatic image compositing after the upload.


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 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/a4ad8da3-6159-4104-b0f2-1347f3b6ac9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels: about max message size

2018-10-24 Thread Chris
Thank you Andrew. Hope I can upgrade soon to get the Channels 2.X 
awesomeness :)

On Wednesday, October 24, 2018 at 2:08:19 AM UTC+9, Andrew Godwin wrote:
>
> Hmm, it's possible the 0.x series didn't have response streaming for files 
> so there'd be a limit, but I honestly can't remember, that was years ago. 
> There's really not much I can do other than recommending an upgrade to 
> something vaguely recent.
>
> Also make sure Heroku is not cutting you off with a request timeout or 
> something.
>
> Andrew
>
> On Tue, Oct 23, 2018 at 5:38 AM Chris > 
> wrote:
>
>> I use Channels & websockets for my webapp's "export data" functionality, 
>> since it can take a long time to generate the file (more than 30 seconds). 
>> In general this works fine, even for large downloads (several MB), but I 
>> have seen several cases on Heroku where the browser never receives the 
>> message with the file, even though debugging shows that 
>> JsonWebsocketConsumer.send was called as expected.
>>
>> I found this Github issue  
>> that 
>> says the message limit is 1 MB (or maybe 256 kb). My questions:
>>
>> - Where is this limit defined? I searched the source of Channels and 
>> Daphne. I'm trying to figure out where the failure is happening -- in the 
>> worker, Daphne, or Redis.
>> - What happens if the limit is exceeded? Is an exception raised? (Because 
>> in my case it fails silently.)
>> - Is there really a 1 MB limit? Because it seems I have been able to send 
>> files larger than that using channels/asgi_redis (unfortunately I'm still 
>> on channels 0.17.3, can't upgrade yet because of a Twisted bug).
>>
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/da8fc1ab-8a75-4504-ab3a-6ab31cfd132e%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/174c7388-be0d-477d-9b6d-803b04b5626e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django auto-deletes field related to MySQL Transactions

2018-10-24 Thread RyanW
Yes, it is. Are you referring to 'delete' method in my views?

On Wednesday, October 24, 2018 at 1:24:12 PM UTC-5, C. Kirby wrote:
>
> Is this happening to production users? It is probably because their 
> browser is doing pre-fetch of links to speed up their UX. GET request are 
> considered by the browser to be safe (non-destructive) and ideally 
> idempotent. YOu should _never_ put a destructive action behind a GET, it 
> should always be behind a POST or (even better if you are going the full 
> REST route) DELETE. 
>
> On Wednesday, October 24, 2018 at 11:10:33 AM UTC-4, RyanW wrote:
>>
>> I've tried two separate MySQL db's on two separate servers.  They both 
>> have given me deletes.  What's strange is that I've set up a local copy on 
>> my laptop with both a local Postgres DB and MySQL connection, and I don't 
>> get the same deletes.
>>
>> I've narrowed it down that it must be something the users are doing to 
>> trigger these deletes, based on logs that would've put them active during a 
>> time of a delete.
>>
>> On Wednesday, October 24, 2018 at 10:03:00 AM UTC-5, Matthew Pava wrote:
>>>
>>> I can’t see anything wrong with what you’ve presented.  Try generating a 
>>> new database and using that.  See if you still get random deletes on that 
>>> database.
>>>
>>>  
>>>
>>> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On 
>>> Behalf Of *RyanW
>>> *Sent:* Wednesday, October 24, 2018 9:51 AM
>>> *To:* Django users
>>> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>>>
>>>  
>>>
>>> Hi Matthew and Joel. Thanks for your help.
>>>
>>>  
>>>
>>> I'm attaching the models.py, views.py and templates for your reference.  
>>> I'm drawing a blank on the implementation that could trigger a delete.
>>>
>>>  
>>>
>>> Thanks again
>>>
>>>
>>> On Tuesday, October 23, 2018 at 11:54:17 AM UTC-5, Matthew Pava wrote:
>>>
>>> And make sure your form is posting to the save view and not the delete 
>>> view.  Maybe show us your template.
>>>
>>>  
>>>
>>> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On 
>>> Behalf Of *Joel
>>> *Sent:* Tuesday, October 23, 2018 11:32 AM
>>> *To:* django...@googlegroups.com
>>> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>>>
>>>  
>>>
>>> You could have a signal which captures all these and logs its origin.
>>>
>>>  
>>>
>>> On Tue, 23 Oct, 2018, 9:35 PM RyanW,  wrote:
>>>
>>> Yes, I honestly don't see how Django could be doing this either.  The 
>>> only I could think of was user deletion, but no one has claimed to have 
>>> done so.
>>>
>>>  
>>>
>>> No other apps are connected.
>>>
>>>  
>>>
>>> Thanks for the tip!!
>>>
>>>
>>> On Tuesday, October 23, 2018 at 10:05:51 AM UTC-5, Matthew Pava wrote:
>>>
>>> It doesn’t seem like Django would be doing this.
>>>
>>> Do you have any other apps connected to the database?
>>>
>>> You’ll probably want to surround your URL in quotation marks.  >> href=”{% url ‘epedelete’ epe.id %}”>
>>>
>>>  
>>>
>>>  
>>>
>>> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On 
>>> Behalf Of *RyanW
>>> *Sent:* Tuesday, October 23, 2018 9:33 AM
>>> *To:* Django users
>>> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>>>
>>>  
>>>
>>> I have a button to delete a record by the user, displayed inside a 
>>> template as:
>>>
>>>  
>>>
>>> >> type="button" value="Delete" />
>>>
>>>
>>> and the function in views.py
>>>
>>>  
>>>
>>> def delete(request, part_id=None):
>>>
>>> obj = epe.objects.get(id=part_id)
>>>
>>> obj.delete()
>>>
>>> return HttpResponseRedirect(reverse('epe_home'))
>>>
>>>
>>> Other than that, I have some ForeignKey restraints on_delete to preserve 
>>> integrity, like so:
>>>
>>> epe_ani2 = models.ForeignKey(
>>>
>>> Subjects,
>>>
>>> on_delete=models.PROTECT,
>>>
>>> null=True,
>>>
>>> blank=True
>>>
>>> )
>>>
>>>
>>> As for the authentication backend, I'm using the default provided by 
>>> Django:
>>>
>>> ['django.contrib.auth.backends.ModelBackend']
>>>
>>>  
>>>
>>> Thank you for the help!
>>>
>>>
>>> On Tuesday, October 23, 2018 at 9:16:24 AM UTC-5, Matthew Pava wrote:
>>>
>>> Check your source code for any delete commands.
>>>
>>> This might also be your authentication backend.  Which one are you using?
>>>
>>>  
>>>
>>> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On 
>>> Behalf Of *RyanW
>>> *Sent:* Monday, October 22, 2018 7:55 PM
>>> *To:* Django users
>>> *Subject:* Django auto-deletes field related to MySQL Transactions
>>>
>>>  
>>>
>>> I have a Django site I'm developing, which I've connected to a MySQL 
>>> db.  I haven't deployed into production yet, as I'm still working on a 
>>> couple of things, however I leave the server running in development for 
>>> initial data entry. 
>>>
>>>  
>>>
>>> I've noticed that some of the records already inputted gets deleted, 
>>> seemingly randomly. I enabled logg

Re: Adding crop and rotate to django image upload

2018-10-24 Thread Mark Phillips
You could look at this project for ideas on how to accomplish your crop and
rotate actions - https://github.com/matthewwithanm/django-imagekit

However, if you want the user to manually crop and rotate the image on your
site while looking at a Django view, then you will have to use some
Javascript to do the cropping and rotation on the client side. Every change
to a Django view (ie rotate a few degrees or move the crop box) involves a
round trip to the server, which will be slow and a miserable experience for
your users.

Here one example of cropping images with django and jquery -
https://simpleisbetterthancomplex.com/tutorial/2017/03/02/how-to-crop-images-in-a-django-application.html

And another -
http://blog.appliedinformaticsinc.com/how-to-add-image-cropping-features-using-django-image-cropping-app-jcrop/

I have not used any of these tools myself, so ymmv.

Google will find many many more projects/blogs on this topic.

Good luck!

Mark


On Wed, Oct 24, 2018 at 3:55 PM <2012...@gmail.com> wrote:

> Hello,
>
> I confess that I have no experience with django.
> I have a project where the django app was written by developers and I want
> to add a few things to a form that uploads an image. The image currently
> uploads but the user cannot rotate and crop the image to their liking.
>
> The site is using
>
> class ExampleModel(models.Model):
> model_pic = models.ImageField(upload_to = 'pic_folder/'
>
> in the form for image uploading. And the form code where the image is
> uploaded...
> Upload Photo
> 
> (Maximum image size should be 8 MB)
>  name="profile_image" placeholder="Uploaded_Image*" class="form-control
> input-field" required>
> 
>
> I would like to incorporate rotate and crop functions to the image where
> the user can adjust these settings on the same form before it is saved.
>
> I found this:
>
> https://pqina.nl/slim/
>
> and wonder if it can be used in the django form.
> Otherwise, maybe PIL can be used; it is already incorporated on the site for 
> automatic image compositing after the upload.
>
>
> 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 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/a4ad8da3-6159-4104-b0f2-1347f3b6ac9a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAEqej2NU8icHPph%3DH_7qutcVG3kGSembV2EPes2gZgH7iNWN5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django auto-deletes field related to MySQL Transactions

2018-10-24 Thread Mark Phillips
Just a wild guess - do you have a cascade delete in your models that is
causing the deletion? Is a user deleting another object, and that is
triggering a cascade delete on a different model?

Mark

On Wed, Oct 24, 2018 at 4:22 PM RyanW  wrote:

> Yes, it is. Are you referring to 'delete' method in my views?
>
> On Wednesday, October 24, 2018 at 1:24:12 PM UTC-5, C. Kirby wrote:
>>
>> Is this happening to production users? It is probably because their
>> browser is doing pre-fetch of links to speed up their UX. GET request are
>> considered by the browser to be safe (non-destructive) and ideally
>> idempotent. YOu should _never_ put a destructive action behind a GET, it
>> should always be behind a POST or (even better if you are going the full
>> REST route) DELETE.
>>
>> On Wednesday, October 24, 2018 at 11:10:33 AM UTC-4, RyanW wrote:
>>>
>>> I've tried two separate MySQL db's on two separate servers.  They both
>>> have given me deletes.  What's strange is that I've set up a local copy on
>>> my laptop with both a local Postgres DB and MySQL connection, and I don't
>>> get the same deletes.
>>>
>>> I've narrowed it down that it must be something the users are doing to
>>> trigger these deletes, based on logs that would've put them active during a
>>> time of a delete.
>>>
>>> On Wednesday, October 24, 2018 at 10:03:00 AM UTC-5, Matthew Pava wrote:

 I can’t see anything wrong with what you’ve presented.  Try generating
 a new database and using that.  See if you still get random deletes on that
 database.



 *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On
 Behalf Of *RyanW
 *Sent:* Wednesday, October 24, 2018 9:51 AM
 *To:* Django users
 *Subject:* Re: Django auto-deletes field related to MySQL Transactions



 Hi Matthew and Joel. Thanks for your help.



 I'm attaching the models.py, views.py and templates for your
 reference.  I'm drawing a blank on the implementation that could trigger a
 delete.



 Thanks again


 On Tuesday, October 23, 2018 at 11:54:17 AM UTC-5, Matthew Pava wrote:

 And make sure your form is posting to the save view and not the delete
 view.  Maybe show us your template.



 *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On
 Behalf Of *Joel
 *Sent:* Tuesday, October 23, 2018 11:32 AM
 *To:* django...@googlegroups.com
 *Subject:* Re: Django auto-deletes field related to MySQL Transactions



 You could have a signal which captures all these and logs its origin.



 On Tue, 23 Oct, 2018, 9:35 PM RyanW,  wrote:

 Yes, I honestly don't see how Django could be doing this either.  The
 only I could think of was user deletion, but no one has claimed to have
 done so.



 No other apps are connected.



 Thanks for the tip!!


 On Tuesday, October 23, 2018 at 10:05:51 AM UTC-5, Matthew Pava wrote:

 It doesn’t seem like Django would be doing this.

 Do you have any other apps connected to the database?

 You’ll probably want to surround your URL in quotation marks.  >>> href=”{% url ‘epedelete’ epe.id %}”>





 *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On
 Behalf Of *RyanW
 *Sent:* Tuesday, October 23, 2018 9:33 AM
 *To:* Django users
 *Subject:* Re: Django auto-deletes field related to MySQL Transactions



 I have a button to delete a record by the user, displayed inside a
 template as:



 >>> type="button" value="Delete" />


 and the function in views.py



 def delete(request, part_id=None):

 obj = epe.objects.get(id=part_id)

 obj.delete()

 return HttpResponseRedirect(reverse('epe_home'))


 Other than that, I have some ForeignKey restraints on_delete to
 preserve integrity, like so:

 epe_ani2 = models.ForeignKey(

 Subjects,

 on_delete=models.PROTECT,

 null=True,

 blank=True

 )


 As for the authentication backend, I'm using the default provided by
 Django:

 ['django.contrib.auth.backends.ModelBackend']



 Thank you for the help!


 On Tuesday, October 23, 2018 at 9:16:24 AM UTC-5, Matthew Pava wrote:

 Check your source code for any delete commands.

 This might also be your authentication backend.  Which one are you
 using?



 *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On
 Behalf Of *RyanW
 *Sent:* Monday, October 22, 2018 7:55 PM
 *To:* Django users
 *Subject:* Django auto-deletes field related to MySQL Transactions



 I hav

Re: Django auto-deletes field related to MySQL Transactions

2018-10-24 Thread RyanW
Hi Mark,

I did at one point, but I don't any longer ( I use RESTRICT now). 

Would you guys mind if I attached a copy of the app for review?

Thank you!

On Wednesday, October 24, 2018 at 6:36:12 PM UTC-5, mark wrote:
>
> Just a wild guess - do you have a cascade delete in your models that is 
> causing the deletion? Is a user deleting another object, and that is 
> triggering a cascade delete on a different model?
>
> Mark
>
> On Wed, Oct 24, 2018 at 4:22 PM RyanW > 
> wrote:
>
>> Yes, it is. Are you referring to 'delete' method in my views?
>>
>> On Wednesday, October 24, 2018 at 1:24:12 PM UTC-5, C. Kirby wrote:
>>>
>>> Is this happening to production users? It is probably because their 
>>> browser is doing pre-fetch of links to speed up their UX. GET request are 
>>> considered by the browser to be safe (non-destructive) and ideally 
>>> idempotent. YOu should _never_ put a destructive action behind a GET, it 
>>> should always be behind a POST or (even better if you are going the full 
>>> REST route) DELETE. 
>>>
>>> On Wednesday, October 24, 2018 at 11:10:33 AM UTC-4, RyanW wrote:

 I've tried two separate MySQL db's on two separate servers.  They both 
 have given me deletes.  What's strange is that I've set up a local copy on 
 my laptop with both a local Postgres DB and MySQL connection, and I don't 
 get the same deletes.

 I've narrowed it down that it must be something the users are doing to 
 trigger these deletes, based on logs that would've put them active during 
 a 
 time of a delete.

 On Wednesday, October 24, 2018 at 10:03:00 AM UTC-5, Matthew Pava wrote:
>
> I can’t see anything wrong with what you’ve presented.  Try generating 
> a new database and using that.  See if you still get random deletes on 
> that 
> database.
>
>  
>
> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] 
> *On Behalf Of *RyanW
> *Sent:* Wednesday, October 24, 2018 9:51 AM
> *To:* Django users
> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>
>  
>
> Hi Matthew and Joel. Thanks for your help.
>
>  
>
> I'm attaching the models.py, views.py and templates for your 
> reference.  I'm drawing a blank on the implementation that could trigger 
> a 
> delete.
>
>  
>
> Thanks again
>
>
> On Tuesday, October 23, 2018 at 11:54:17 AM UTC-5, Matthew Pava wrote:
>
> And make sure your form is posting to the save view and not the delete 
> view.  Maybe show us your template.
>
>  
>
> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] 
> *On Behalf Of *Joel
> *Sent:* Tuesday, October 23, 2018 11:32 AM
> *To:* django...@googlegroups.com
> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>
>  
>
> You could have a signal which captures all these and logs its origin.
>
>  
>
> On Tue, 23 Oct, 2018, 9:35 PM RyanW,  wrote:
>
> Yes, I honestly don't see how Django could be doing this either.  The 
> only I could think of was user deletion, but no one has claimed to have 
> done so.
>
>  
>
> No other apps are connected.
>
>  
>
> Thanks for the tip!!
>
>
> On Tuesday, October 23, 2018 at 10:05:51 AM UTC-5, Matthew Pava wrote:
>
> It doesn’t seem like Django would be doing this.
>
> Do you have any other apps connected to the database?
>
> You’ll probably want to surround your URL in quotation marks.   href=”{% url ‘epedelete’ epe.id %}”>
>
>  
>
>  
>
> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] 
> *On Behalf Of *RyanW
> *Sent:* Tuesday, October 23, 2018 9:33 AM
> *To:* Django users
> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>
>  
>
> I have a button to delete a record by the user, displayed inside a 
> template as:
>
>  
>
>  type="button" value="Delete" />
>
>
> and the function in views.py
>
>  
>
> def delete(request, part_id=None):
>
> obj = epe.objects.get(id=part_id)
>
> obj.delete()
>
> return HttpResponseRedirect(reverse('epe_home'))
>
>
> Other than that, I have some ForeignKey restraints on_delete to 
> preserve integrity, like so:
>
> epe_ani2 = models.ForeignKey(
>
> Subjects,
>
> on_delete=models.PROTECT,
>
> null=True,
>
> blank=True
>
> )
>
>
> As for the authentication backend, I'm using the default provided by 
> Django:
>
> ['django.contrib.auth.backends.ModelBackend']
>
>  
>
> Thank you for the help!
>
>
> On Tuesday, October 23, 2018 at 

Help to get started with Gsoc 2019

2018-10-24 Thread PARTH PATIL
Hey i am* Parth Patil*, a second year undergraduate engineer. I have been 
using django since the last year and had done many cool projects with it, 
also I'm cureently a maintainer for 3 websites as well.

I am willing to participate in* GSoC 2019*. I thought this would be a good 
time to start. I have been reading alot about django for past few weeks , 
like previous year projects, getting started wiki etc. But I am pretty much 
confused right now. Here is list of few *problems/doubts*.

1) I am not able to find any channel or forum on which discussion for gsoc 
2019 is active (is it too early for that?)

2) I had a very hard time finding the contact of the past year student who 
have successfully completed their project. Like there is no list or 
anything of some sort.

3) while going through projects, many times i didn't even understood what 
project statement was, is that a problem??

4) Also i have a doubt from where to learn the style of writing code, to 
get good pylint/sphinx scores. (if any one has a good reference please link 
down).

Also if anyone has any other information please feel free to share below, 
you can contact me at parth...@gmail.com

-- 
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/dd0aa0a5-faa3-4693-bfbf-412fcc286ea2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.