Primary Key

2020-01-20 Thread Soumen Khatua
Hi Folks,

I want to generate unique 6 digit primary key for django models and I want
to generate this for 10 billon users. So guys please could you tell me How
I can do that?

I tried UUID module but it's generating some big numbers.

Thank you

Regards,
Soumen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPUw6WZSz%3D0sPRJ40VTVHQRD8GtHh3m2zb64Te4ti8RF2f23Vg%40mail.gmail.com.


Re: Primary Key

2020-01-20 Thread Forrest Hartley
I’m not sure a six digit model would support 10bn unique values.

On Mon, Jan 20, 2020 at 4:01 AM Soumen Khatua 
wrote:

> Hi Folks,
>
> I want to generate unique 6 digit primary key for django models and I want
> to generate this for 10 billon users. So guys please could you tell me How
> I can do that?
>
> I tried UUID module but it's generating some big numbers.
>
> Thank you
>
> Regards,
> Soumen
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPUw6WZSz%3D0sPRJ40VTVHQRD8GtHh3m2zb64Te4ti8RF2f23Vg%40mail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABd3-AAjozMfQE5sfr-jcW%2BKi32sJTAy7bFQxN4yNEsh7eHg5w%40mail.gmail.com.


Re: Primary Key

2020-01-20 Thread Kasper Laudrup

Hi Soumen,

On 20/01/2020 10.01, Soumen Khatua wrote:

Hi Folks,

I want to generate unique 6 digit primary key for django models and I 
want to generate this for 10 billon users. So guys please could you tell 
me How I can do that?




You want to generate a number between 0 and 1.000.000 that should be 
unique for 10.000.000.000 instances?


I hope you can understand why that doesn't make any sense.

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2e919c12-58dd-d954-d584-606b73e9124c%40stacktrace.dk.


Re: Primary Key

2020-01-20 Thread Kasper Laudrup

Hi again,

On 20/01/2020 10.22, Kasper Laudrup wrote:


You want to generate a number between 0 and 1.000.000 that should be 
unique for 10.000.000.000 instances?


I hope you can understand why that doesn't make any sense.



Thinking a bit more about, you don't specify whether it should be in 
base 10.


If use use base 64 you can represent 68.719.476.736 values which is 
enough for representing 10.000.000.00 unique values.


You would still have to generate them so they don't collide with an 
existing value (which, unlike a UUID, is bound to happen).


Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3a55fb7a-56f3-72cc-8049-13bf4a1deafe%40stacktrace.dk.


Re: Primary Key

2020-01-20 Thread Soumen Khatua
Thank you for your email

On Mon, Jan 20, 2020 at 3:09 PM Kasper Laudrup 
wrote:

> Hi again,
>
> On 20/01/2020 10.22, Kasper Laudrup wrote:
> >
> > You want to generate a number between 0 and 1.000.000 that should be
> > unique for 10.000.000.000 instances?
> >
> > I hope you can understand why that doesn't make any sense.
> >
>
> Thinking a bit more about, you don't specify whether it should be in
> base 10.
>
> If use use base 64 you can represent 68.719.476.736 values which is
> enough for representing 10.000.000.00 unique values.
>
> You would still have to generate them so they don't collide with an
> existing value (which, unlike a UUID, is bound to happen).
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3a55fb7a-56f3-72cc-8049-13bf4a1deafe%40stacktrace.dk
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPUw6WbaOcDrHghMJaB3y0OYnNbo1k-G3s0ijcfZ55sNrU_3%3DA%40mail.gmail.com.


Re: Primary Key

2020-01-20 Thread Muhammed Rafi A
import uuid
uuid.uuid4().hex[:8]

or


from django.utils.crypto import get_random_string
get_random_string(8).lower()

def get_random_string(length=12,
allowed_chars='abcdefghijklmnopqrstuvwxyz'
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'):

On Mon, Jan 20, 2020 at 2:31 PM Soumen Khatua 
wrote:

> Hi Folks,
>
> I want to generate unique 6 digit primary key for django models and I want
> to generate this for 10 billon users. So guys please could you tell me How
> I can do that?
>
> I tried UUID module but it's generating some big numbers.
>
> Thank you
>
> Regards,
> Soumen
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPUw6WZSz%3D0sPRJ40VTVHQRD8GtHh3m2zb64Te4ti8RF2f23Vg%40mail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADwyzwo6LUiedx4b%3D0T9mEn%3DurULxfy%2BYvOMMXKeUMZyX0TfLw%40mail.gmail.com.


Re: Primary Key

2020-01-20 Thread Kasper Laudrup

Hi Muhammed,

On 20/01/2020 11.25, Muhammed Rafi A wrote:

|importuuid uuid.uuid4().hex[:8]

|

|or


|fromdjango.utils.crypto importget_random_string 
get_random_string(8).lower()


||

def get_random_string(length=12,

allowed_chars='abcdefghijklmnopqrstuvwxyz'

'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'):



There's nothing wrong with this as far as I can tell, but I'm fairly 
certain this is more or less guaranteed to generate duplicates if 
generating 10.000.000.000 values.


Of course, it would be nice to know what OPs use case is. Doesn't sound 
like this is the right solution for whatever the problem is he's trying 
to solve.


Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9f2f08d6-1bd2-83a2-950e-4897f3b16376%40stacktrace.dk.


UniqueConstraint rises fields.E310 error because of issue with backward compatibility with unique_together

2020-01-20 Thread Pavel Garkin
Hi all,


I'm trying to create migration with uniqueness of 2 fields: uid, source. 

*Django 2.2.9*

class Users(models.Model):
uid = models.CharField(...)
source = models.ForeignKey(*...*)

class Meta:

   constraints = [models.UniqueConstraint(fields=['uid', 'source'], 
name='users_uniqueness')]
   indexes = [models.Index(fields=('uid', 'source'), name='users_indexes')]



When I start makemigrations command in manage.py it rises *fields.E310 
* error


app_name.Users.field: (fields.E310) No subset of the fields 'uid', 'source' on 
model 'Users' is unique.
HINT: Add unique=True on any of those fields or add at least a subset 
of them to a unique_together constraint.



When I change Meta options to unique_together constraint it works ok. 
Migrations passes with no errors


...
   class Meta:

unique_together = [['uid', 'source']]


As mentioned in docs 
 
unique_together may be deprecated in the future so I wanted to avoid this kind 
of issue.



*Thanks,*

*Pavel*


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5ea7b380-152c-47d0-960b-dfe6c1fbedf6%40googlegroups.com.


Re: Django Lessons

2020-01-20 Thread Eugen Ciur
Sure! Thanks!
I will keep in mind your kind offer.

On Monday, January 20, 2020 at 5:34:09 AM UTC+1, Karan Mittal wrote:
>
> Hey Eugin,
> Your blogs are awesome. Let me know if you need some help in writing. I am 
> a technical writer myself.
> I have also written a complete series on Django. 
> You can check it out here.
> https://data-flair.training/blogs/django-tutorials-home/
>
> Regards, 
> Karan Mittal 
>
>
> On Mon, 20 Jan, 2020, 1:25 AM Eugen Ciur, > 
> wrote:
>
>> Hi everyone,
>>
>> I launched recently a new resource, django-lessons.com. 
>> 
>> I target mostly intermediate django developers but newcomers might find 
>> it usefull as well.
>> Although main focus is Django Web Framework, I will post a lot of info 
>> about devops ecosystem around django (production) and about python itself.
>> I have an youtube channe 
>> l as well.
>>
>> What do you think?
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/0437652e-7887-48f5-a9b8-f0e79bd16d1f%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4d864aff-5185-4fd7-aead-200f6db04161%40googlegroups.com.


Double hashing in django

2020-01-20 Thread sandeep bisht
hey guys, have you any idea about password double hashing in django?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/36ac15ac-ce5d-42eb-b468-829ae7faa7b0%40googlegroups.com.


Re: Using Daphne without altering nginx config on Google App Engine

2020-01-20 Thread Sai Santhosh
Hlelo

On Mon, Jan 20, 2020 at 12:44 PM Integr@te System 
wrote:

> Hi Rahu,
>
> Plz scrutinize  more info to differ, combine and select right one for your
> case.
>
> https://stackshare.io/stackups/google-app-engine-vs-nginx
>
>
> On Mon, Jan 20, 2020, 12:08 Rahul Arora  wrote:
>
>> Thanks for your reply. Is there really no way of using daphne without
>> altering nginx/supervisord config like we use gunicorn?
>>
>> If not, I have some questions based on my efforts so far, please. I will
>> be grateful for your attention to these. Apologies if they're silly
>> questions since I'm a beginner:
>> 1. If I reconfigure nginx and supervisord, how should I make sure the
>> conf files get picked up by GAE? Should I add something to the app.yaml
>> file to point to the nginx-app.conf file in the root folder? Should I also
>> change my runtime declaration to custom, or leave it as python? I find that
>> whenever I add an nginx-app.conf file in the root folder the build times
>> out and I get an Error[4] from gcloud app deploy. Otherwise the build
>> completes fully.
>> 2. If I am starting a Unix socket for Daphne in the supervisord config
>> file, what happens to the entrypoint delaration in the ap.yaml file? Do I
>> delete that?
>> 3. How do I know what path I should use in the command: "daphne -u /run/
>> daphne/daphne%(process_num)d.sock". Also, what is process_num?
>> 4. The new conf files (for nginx and supervisord in the documentation
>> shared by you) refer to localhost:8000 - should I change this? What is the
>> TCP socket used by nginx backend?
>> 5. How can I do things like updating supervisor, "sudo service nginx
>> reload" etc on the GAE PaaS platform since I'm not operating the instance
>> directly? Or is this not necessary since I'm creating a whole new build
>> each time?
>>
>> Sorry for the barrage and thanks in advance,
>> Rahul.
>>
>> On Sunday, January 19, 2020 at 1:41:09 PM UTC+8, Integr@te System wrote:
>>>
>>> Hi Rahu,
>>>
>>> Check chennel_layers setting as a sample in this doc for more helpful
>>>
>>> https://channels.readthedocs.io/en/latest/deploying.html
>>>
>>>
>>>
>>> On Sat, Jan 18, 2020, 21:10 Rahul Arora  wrote:
>>>
 Hi all,

 I'm trying to switch from gunicorn to Daphne for my Django app on GAE
 Flex, since I need to use Django Channels. Previously the site worked fine
 with gunicorn as entrypoint (in the app.yaml file). I just replaced it with
 daphne so my yamlfile looks like this:

 runtime: python
 env: flex

 runtime_config:
   python_version: 3

 entrypoint: daphne -b 0.0.0.0 -p 8001 my_project_name.asgi:application


 I've already made a .asgi file next to my .wsgi file and declared an
 application there.

 In requirements.txt I've ensured the daphne(2.4.1) and asgiref(3.2.3)
 packages are the latest versions.

 Finally when I do 'gcloud app deploy', deployment appears to happen
 smoothly and in the build logs I can see daphne starting:


 Step #1: Step 9/9 : CMD exec daphne -b 0.0.0.0 -p 8001 
 my_project_name.asgi:applicationStep #1:  ---> Running in c6f3762a5ce2


 But when I go to the site, I'm seeing a 502 Bad Gateway error on the
 site, with "nginx" in the next line.


 Is there a way to deploy Daphne without going into nginx configurations 
 etc? I'm using an app engine only because I wanted to avoid doing 
 micro-level tweaks on a cloud machine.

 Thanks,
 Rahul.

 --
 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...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/dfb79af0-663c-4581-8fab-f06d2281d875%40googlegroups.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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/663c1f9c-9bdc-4da1-95d6-269c13c6c86b%40googlegroups.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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAP5HUWqzyqwcX98BX%2Bx%2BnOZ3kknonL742FsdHmjLD3hCrL3-3Q%4

Create Dashboard for CSV data

2020-01-20 Thread Santhosh sridhar
I have a csv file : each line having some inputs and some status. I need to 
read this csv file and present the data as a dashboard with some charts. I 
came across to use chart js plugin. Is there any better approach?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/70da7790-e3ed-4320-b374-c7a5d1a1f95a%40googlegroups.com.


Re: UniqueConstraint rises fields.E310 error because of issue with backward compatibility with unique_together

2020-01-20 Thread Simon Charette
Hello Pavel,

This is likely a bug because UniqueConstraint was only recently introduced.

Please file a bug report about it. In the mean time you can add this check 
to
your SILENCED_SYSTEM_CHECKS setting to silence it.

Best,
Simon

Le lundi 20 janvier 2020 07:21:26 UTC-5, Pavel Garkin a écrit :
>
> Hi all,
>
>
> I'm trying to create migration with uniqueness of 2 fields: uid, source. 
>
> *Django 2.2.9*
>
> class Users(models.Model):
> uid = models.CharField(...)
> source = models.ForeignKey(*...*)
>
> class Meta:
>
>constraints = [models.UniqueConstraint(fields=['uid', 'source'], 
> name='users_uniqueness')]
>indexes = [models.Index(fields=('uid', 'source'), 
> name='users_indexes')]
>
>
>
> When I start makemigrations command in manage.py it rises *fields.E310 
> * error
>
>
> app_name.Users.field: (fields.E310) No subset of the fields 'uid', 'source' 
> on model 'Users' is unique.
>   HINT: Add unique=True on any of those fields or add at least a subset 
> of them to a unique_together constraint.
>
>
>
> When I change Meta options to unique_together constraint it works ok. 
> Migrations passes with no errors
>
>
> ...
>class Meta:
>
> unique_together = [['uid', 'source']]
>
>
> As mentioned in docs 
>  
> unique_together may be deprecated in the future so I wanted to avoid this 
> kind of issue.
>
>
>
> *Thanks,*
>
> *Pavel*
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b49b70d2-9a1d-409f-ac43-3a643a7f27b1%40googlegroups.com.


Re: Using Daphne without altering nginx config on Google App Engine

2020-01-20 Thread Rahul Arora
Thanks but this is not a valid or useful comparison since GAE is a PaaS 
service whereas Nginx is a proxy server. In fact GAE itself uses Nginx 
which is why I'm getting the error from Nginx despite not configuring it 
myself.

Rahul.

On Monday, January 20, 2020 at 3:14:35 PM UTC+8, Integr@te System wrote:
>
> Hi Rahu,
>
> Plz scrutinize  more info to differ, combine and select right one for your 
> case.
>
> https://stackshare.io/stackups/google-app-engine-vs-nginx
>
>
> On Mon, Jan 20, 2020, 12:08 Rahul Arora  > wrote:
>
>> Thanks for your reply. Is there really no way of using daphne without 
>> altering nginx/supervisord config like we use gunicorn?
>>
>> If not, I have some questions based on my efforts so far, please. I will 
>> be grateful for your attention to these. Apologies if they're silly 
>> questions since I'm a beginner:
>> 1. If I reconfigure nginx and supervisord, how should I make sure the 
>> conf files get picked up by GAE? Should I add something to the app.yaml 
>> file to point to the nginx-app.conf file in the root folder? Should I also 
>> change my runtime declaration to custom, or leave it as python? I find that 
>> whenever I add an nginx-app.conf file in the root folder the build times 
>> out and I get an Error[4] from gcloud app deploy. Otherwise the build 
>> completes fully.
>> 2. If I am starting a Unix socket for Daphne in the supervisord config 
>> file, what happens to the entrypoint delaration in the ap.yaml file? Do I 
>> delete that?
>> 3. How do I know what path I should use in the command: "daphne -u /run/
>> daphne/daphne%(process_num)d.sock". Also, what is process_num?
>> 4. The new conf files (for nginx and supervisord in the documentation 
>> shared by you) refer to localhost:8000 - should I change this? What is the 
>> TCP socket used by nginx backend?
>> 5. How can I do things like updating supervisor, "sudo service nginx 
>> reload" etc on the GAE PaaS platform since I'm not operating the instance 
>> directly? Or is this not necessary since I'm creating a whole new build 
>> each time?
>>
>> Sorry for the barrage and thanks in advance,
>> Rahul.
>>
>> On Sunday, January 19, 2020 at 1:41:09 PM UTC+8, Integr@te System wrote:
>>>
>>> Hi Rahu,
>>>
>>> Check chennel_layers setting as a sample in this doc for more helpful
>>>
>>> https://channels.readthedocs.io/en/latest/deploying.html
>>>
>>>
>>>
>>> On Sat, Jan 18, 2020, 21:10 Rahul Arora  wrote:
>>>
 Hi all,

 I'm trying to switch from gunicorn to Daphne for my Django app on GAE 
 Flex, since I need to use Django Channels. Previously the site worked fine 
 with gunicorn as entrypoint (in the app.yaml file). I just replaced it 
 with 
 daphne so my yamlfile looks like this:

 runtime: python
 env: flex

 runtime_config:
   python_version: 3

 entrypoint: daphne -b 0.0.0.0 -p 8001 my_project_name.asgi:application


 I've already made a .asgi file next to my .wsgi file and declared an 
 application there.

 In requirements.txt I've ensured the daphne(2.4.1) and asgiref(3.2.3) 
 packages are the latest versions.

 Finally when I do 'gcloud app deploy', deployment appears to happen 
 smoothly and in the build logs I can see daphne starting:


 Step #1: Step 9/9 : CMD exec daphne -b 0.0.0.0 -p 8001 
 my_project_name.asgi:applicationStep #1:  ---> Running in c6f3762a5ce2


 But when I go to the site, I'm seeing a 502 Bad Gateway error on the 
 site, with "nginx" in the next line. 


 Is there a way to deploy Daphne without going into nginx configurations 
 etc? I'm using an app engine only because I wanted to avoid doing 
 micro-level tweaks on a cloud machine.

 Thanks,
 Rahul.

 -- 
 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...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/dfb79af0-663c-4581-8fab-f06d2281d875%40googlegroups.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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/663c1f9c-9bdc-4da1-95d6-269c13c6c86b%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" gro

Django bootstrap calendar

2020-01-20 Thread Perceval Maturure
Dear All
Is there anyone who has used the djangobootrstrap calendar in Django 2.xxx 
project?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9C8AB979-2DC4-4B6B-9D1D-FD9144E9F014%40gmail.com.


Re: Create Dashboard for CSV data

2020-01-20 Thread Shivam Dutt Sharma
You may use matplotlib / seasborn.

You can also create dataframes from that csv file and opt for creating
bar/line/box plots.

Best,
Shivam


On Mon, Jan 20, 2020, 19:29 Santhosh sridhar 
wrote:

> I have a csv file : each line having some inputs and some status. I need
> to read this csv file and present the data as a dashboard with some charts.
> I came across to use chart js plugin. Is there any better approach?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/70da7790-e3ed-4320-b374-c7a5d1a1f95a%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANo3eCumDzNMxrCwgG8pVE9pf%3Di%2BZuYKryYs-GmE0CfMMFSDyg%40mail.gmail.com.


Re: Using Daphne without altering nginx config on Google App Engine

2020-01-20 Thread Integr@te System
Hi Rahul,

That right you had a few answer on your previous question, more deeper
perhap you must config reverse proxy connection (tcp sock (ur question)
compatible http)
these are for your custom

https://www.nginx.com/blog/websocket-nginx/?__cf_chl_captcha_tk__=9fc641baf627a1f387f365526786c1929d6228e9-1579534051-0-AQ6HE6aPclHIoe1eXIG58qJDoS8rfLMq6XCSerTbE7DgckT5DZPBe7z03bg-q68-sV0yhL8widMBgAGw8G4rQVAAQZyXbwnOgoiGXirdV1z92FffD_gr342PfSrXFbl-UsEW0vOYeRkvInYe45iSeqG-Ywsp6oxzoE00XcZnQhdRwhZ_nPuT1yoRfmvEA30TB--CWjLH_PN3-Do3Hkj4YSCDoCDulx3TzIfj3oB-n7oGJR86KqcnViZhcZn1r6gAx94Bx0UHzrNV7QStAtWkPex1J5Gp3capZUdwA4qdRPVHQGiiHSaniVjT_PRRiIq6bKVWiEy1nMYt0A0RIs4Aej2LTNy-GrcBsHKXeMuYpE2Z-gocONTNQITbekY5vkK7I10HVaPR-eovREjv8zq-xlg

https://cloud.google.com/appengine/docs/flexible/python/using-websockets-and-session-affinity

>From flex env gcp provided:
https://cloud.google.com/appengine/docs/flexible/

On Mon, Jan 20, 2020, 21:42 Rahul Arora  wrote:

> Thanks but this is not a valid or useful comparison since GAE is a PaaS
> service whereas Nginx is a proxy server. In fact GAE itself uses Nginx
> which is why I'm getting the error from Nginx despite not configuring it
> myself.
>
> Rahul.
>
> On Monday, January 20, 2020 at 3:14:35 PM UTC+8, Integr@te System wrote:
>>
>> Hi Rahu,
>>
>> Plz scrutinize  more info to differ, combine and select right one for
>> your case.
>>
>> https://stackshare.io/stackups/google-app-engine-vs-nginx
>>
>>
>> On Mon, Jan 20, 2020, 12:08 Rahul Arora  wrote:
>>
>>> Thanks for your reply. Is there really no way of using daphne without
>>> altering nginx/supervisord config like we use gunicorn?
>>>
>>> If not, I have some questions based on my efforts so far, please. I will
>>> be grateful for your attention to these. Apologies if they're silly
>>> questions since I'm a beginner:
>>> 1. If I reconfigure nginx and supervisord, how should I make sure the
>>> conf files get picked up by GAE? Should I add something to the app.yaml
>>> file to point to the nginx-app.conf file in the root folder? Should I also
>>> change my runtime declaration to custom, or leave it as python? I find that
>>> whenever I add an nginx-app.conf file in the root folder the build times
>>> out and I get an Error[4] from gcloud app deploy. Otherwise the build
>>> completes fully.
>>> 2. If I am starting a Unix socket for Daphne in the supervisord config
>>> file, what happens to the entrypoint delaration in the ap.yaml file? Do I
>>> delete that?
>>> 3. How do I know what path I should use in the command: "daphne -u /run/
>>> daphne/daphne%(process_num)d.sock". Also, what is process_num?
>>> 4. The new conf files (for nginx and supervisord in the documentation
>>> shared by you) refer to localhost:8000 - should I change this? What is the
>>> TCP socket used by nginx backend?
>>> 5. How can I do things like updating supervisor, "sudo service nginx
>>> reload" etc on the GAE PaaS platform since I'm not operating the instance
>>> directly? Or is this not necessary since I'm creating a whole new build
>>> each time?
>>>
>>> Sorry for the barrage and thanks in advance,
>>> Rahul.
>>>
>>> On Sunday, January 19, 2020 at 1:41:09 PM UTC+8, Integr@te System wrote:

 Hi Rahu,

 Check chennel_layers setting as a sample in this doc for more helpful

 https://channels.readthedocs.io/en/latest/deploying.html



 On Sat, Jan 18, 2020, 21:10 Rahul Arora  wrote:

> Hi all,
>
> I'm trying to switch from gunicorn to Daphne for my Django app on GAE
> Flex, since I need to use Django Channels. Previously the site worked fine
> with gunicorn as entrypoint (in the app.yaml file). I just replaced it 
> with
> daphne so my yamlfile looks like this:
>
> runtime: python
> env: flex
>
> runtime_config:
>   python_version: 3
>
> entrypoint: daphne -b 0.0.0.0 -p 8001 my_project_name.asgi:application
>
>
> I've already made a .asgi file next to my .wsgi file and declared an
> application there.
>
> In requirements.txt I've ensured the daphne(2.4.1) and asgiref(3.2.3)
> packages are the latest versions.
>
> Finally when I do 'gcloud app deploy', deployment appears to happen
> smoothly and in the build logs I can see daphne starting:
>
>
> Step #1: Step 9/9 : CMD exec daphne -b 0.0.0.0 -p 8001 
> my_project_name.asgi:applicationStep #1:  ---> Running in c6f3762a5ce2
>
>
> But when I go to the site, I'm seeing a 502 Bad Gateway error on the
> site, with "nginx" in the next line.
>
>
> Is there a way to deploy Daphne without going into nginx configurations 
> etc? I'm using an app engine only because I wanted to avoid doing 
> micro-level tweaks on a cloud machine.
>
> Thanks,
> Rahul.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop re

Re: DjangoEveryDay. My practice website!

2020-01-20 Thread Andrew C.
What is your major? Usually tying in what you know, how you behave, and
importantly how you think contributes to a certain type — or even workflow
or stack — of learning in CS.

On Mon, Jan 20, 2020 at 1:52 AM Jack Lin  wrote:

> I’m not sure what this gonna be in the future. I think I’m just exlpore
> the way.
> I may want to make this reusable for the newbie in the future and make the
> community better.
> Open to any ideas and contribution.
>
>
> 在 2020年1月20日 於 下午2:49:48, Jack Lin (tkic...@gmail.com) 寫下:
>
> Oh yes, this is all on Github. I’ll update the page to include GitHub link
> today! Thanks for reminding.
>
>
> 在 2020年1月20日 於 上午1:43:43, Balaji Shetty (balajishe...@gmail.com) 寫下:
>
> Great
>
> We follow you means ...
>
> Are you making code available on github to improve further..
>
> On Sunday, January 19, 2020, Jack Lin  wrote:
>
>> Hi everyone. I'm doing #DjangoEveryday Challenge to myself.
>> I set a goal for everyday and try to accomplish it. So I got practice and
>> progress everyday :)
>>
>> I'm doing this for preparation of my resume. I'm looking for Django Job
>> in Taiwan but CS is not my major.
>> I want to share this with you guys!
>>
>> btw, I do a bit of develop journal on my Linkedin, too. so if you are
>> interested on my progression, you can follow me on Linkedin!
>>
>> There is the website: Jack's Practice Zone
>> 
>> and this is my Linkedin
>>  :)
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/fc2e047e-d362-4110-b6c5-9853402b0120%40googlegroups.com
>> 
>> .
>>
>
>
> --
> Mr Shetty Balaji
> Asst. Prof.
> IT Department
> SGGS I&T
> Nanded. My. India
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAECSbOtnvBqGo24hmoA5%2BA56P%2BtZ5VU5OBaSQpHm8VsdRE4sbg%40mail.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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAP7OQq0QTXBWSP7WoKahq1ezh2S2hH9Akk96OQQp-XD0pE1pfA%40mail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJVmkN%3DxSRWJ6asFgzkn320Z4Hw30wUCU4D4VdkterLSHVSj%2Bg%40mail.gmail.com.


Re: DjangoEveryDay. My practice website!

2020-01-20 Thread maninder singh Kumar
Did you do Jack's Practice Zone is Django too ?


[image: --]

Maninder Kumar
[image: http://]about.me/maninder.s.kumar





On Sun, Jan 19, 2020 at 4:46 PM Jack Lin  wrote:

> Hi everyone. I'm doing #DjangoEveryday Challenge to myself.
> I set a goal for everyday and try to accomplish it. So I got practice and
> progress everyday :)
>
> I'm doing this for preparation of my resume. I'm looking for Django Job in
> Taiwan but CS is not my major.
> I want to share this with you guys!
>
> btw, I do a bit of develop journal on my Linkedin, too. so if you are
> interested on my progression, you can follow me on Linkedin!
>
> There is the website: Jack's Practice Zone
> 
> and this is my Linkedin
>  :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fc2e047e-d362-4110-b6c5-9853402b0120%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABOHK3TxoLAJ0CkZ5jig%3DeNio%3Da6gOTvM6_k%2BLX%2B3JGzRNNbAQ%40mail.gmail.com.


Does a custom user model require first_name and last_name fields

2020-01-20 Thread graeme
I have people's first names and last names in another model (because not 
all people in the DB are users). Therefore if I store names in the user 
model I will duplicate data.

I think the right solution is to remove the first_name and last_name user 
models from the custom user model. Will this cause problems?

I can sensibly override methods like get_full_name()

Thanks for any help. 


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/421e55c9-b3ef-47e0-aaf7-3d36bfcff45d%40googlegroups.com.


Re: Does a custom user model require first_name and last_name fields

2020-01-20 Thread Suraj Thapa FC
Ofcourse you can...
It will not create any problem

On Mon, 20 Jan 2020, 10:49 pm graeme,  wrote:

> I have people's first names and last names in another model (because not
> all people in the DB are users). Therefore if I store names in the user
> model I will duplicate data.
>
> I think the right solution is to remove the first_name and last_name user
> models from the custom user model. Will this cause problems?
>
> I can sensibly override methods like get_full_name()
>
> Thanks for any help.
> 
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/421e55c9-b3ef-47e0-aaf7-3d36bfcff45d%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPjsHcHa8-GVb4KV_pMyxCEX7ijAqh0Ob%2BgomrA33yfyafWaEw%40mail.gmail.com.


Changing Primary Key from BigAutoField to BigIntegerField not working

2020-01-20 Thread Amiganer
Hello.

I'm using postgresql 12 and psycopg2, Python 3.7, Django 3.0.2 (actual 
stable branch)

I declared first my Model with a BigAutoField as Primary_key, later i 
menchend that the ID field is unique, the id's are predefined and unique.
I tried to change the id to a BigIntegerField, done a migration, a look at 
the database nothing has changes, the id is still a autogenerated sequence 
(postgresql uses sequences as primary key).
the "nexval(...seq)" is in it too.
I does the manually: "ALTER TABLE xyz ALTER id DROP DEFAULT" and that 
worked. Now the id (=primary-key) key is as wished a normal BigIntegerField.

Have I done something wrong?

Bye, Christian

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8ce2cb19-c852-413b-87fa-d196bb55cbd9%40googlegroups.com.


Re: Django Lessons

2020-01-20 Thread Juhana Jauhiainen
Hi Eugen,

Seems like you're of to a good start.
Best of luck!

-Juhana

On Mon, Jan 20, 2020 at 2:21 PM Eugen Ciur  wrote:

> Sure! Thanks!
> I will keep in mind your kind offer.
>
> On Monday, January 20, 2020 at 5:34:09 AM UTC+1, Karan Mittal wrote:
>>
>> Hey Eugin,
>> Your blogs are awesome. Let me know if you need some help in writing. I
>> am a technical writer myself.
>> I have also written a complete series on Django.
>> You can check it out here.
>> https://data-flair.training/blogs/django-tutorials-home/
>>
>> Regards,
>> Karan Mittal
>>
>>
>> On Mon, 20 Jan, 2020, 1:25 AM Eugen Ciur,  wrote:
>>
>>> Hi everyone,
>>>
>>> I launched recently a new resource, django-lessons.com.
>>> 
>>> I target mostly intermediate django developers but newcomers might find
>>> it usefull as well.
>>> Although main focus is Django Web Framework, I will post a lot of info
>>> about devops ecosystem around django (production) and about python itself.
>>> I have an youtube channe
>>> l as well.
>>>
>>> What do you think?
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/0437652e-7887-48f5-a9b8-f0e79bd16d1f%40googlegroups.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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4d864aff-5185-4fd7-aead-200f6db04161%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABScFx9zHJa0oOfebjeD8FAYPqMCbXw8hq5KxrTxncu80N%3DzzQ%40mail.gmail.com.


Backward migration failing because of old dropped model

2020-01-20 Thread Adrien Agnel
Hi everyone,

This is my first post in this group so do not hesitate to ask for some more 
specific details if this is not enough. Django version is 2.2.9, Python 3.6.


I'm facing an error when trying to migrate back the initial migration of a 
freshly installed new application 'billing'.
The error message is the following one : 

> *ValueError: The field form.Form.ticket_description was declared with a 
> lazy reference to 'tickets.ticketdescription', but app 'tickets' doesn't 
> provide model 'ticketdescription'.*


*However the model 'ticketdescription' has been dropped several month ago 
and is no longer present in my project*. Thus the part " app 'tickets' 
doesn't provide model 'ticketdescription' " is perfectly right, but I don't 
get why it is not managed by the migration of app 'tickets' which dropped 
the model 'ticketdescription'.
The model 'ticketdescription' remains as a pending model of state apps in 
the migration executor, I would expect it to be removed.

Until now, I could migrate backward other apps without any issue but after 
adding the app 'billing', which is not directly related to app 'tickets', 
it is not possible anymore.



I don't know where to look at to fix this issue ? Could you help me 
debugging please ? This looks like a bug but I'm not sure !

Best regards,
Adrien


 

Here is the full error trace :

Traceback (most recent call last):
>   File "manage.py", line 23, in 
> execute_from_command_line(sys.argv)
>   File 
> "[...]/lib/python3.6/site-packages/django/core/management/__init__.py", 
> line 381, in execute_from_command_line
> utility.execute()
>   File 
> "[...]/lib/python3.6/site-packages/django/core/management/__init__.py", 
> line 375, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "[...]/lib/python3.6/site-packages/django/core/management/base.py", 
> line 323, in run_from_argv
> self.execute(*args, **cmd_options)
>   File "[...]/lib/python3.6/site-packages/django/core/management/base.py", 
> line 364, in execute
> output = self.handle(*args, **options)
>   File "[...]/lib/python3.6/site-packages/django/core/management/base.py", 
> line 83, in wrapped
> res = handle_func(*args, **kwargs)
>   File 
> "[...]/lib/python3.6/site-packages/django/core/management/commands/migrate.py",
>  
> line 234, in handle
> fake_initial=fake_initial,
>   File 
> "[...]/lib/python3.6/site-packages/django/db/migrations/executor.py", line 
> 121, in migrate
> state = self._migrate_all_backwards(plan, full_plan, fake=fake)
>   File 
> "[...]/lib/python3.6/site-packages/django/db/migrations/executor.py", line 
> 173, in _migrate_all_backwards
> for migration, _ in full_plan:
>   File "[...]/lib/python3.6/site-packages/django/utils/functional.py", 
> line 80, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File "[...]/lib/python3.6/site-packages/django/db/migrations/state.py", 
> line 210, in apps
> return StateApps(self.real_apps, self.models)
>   File "[...]/lib/python3.6/site-packages/django/db/migrations/state.py", 
> line 280, in __init__
> raise ValueError("\n".join(error.msg for error in errors))
> ValueError: The field form.Form.ticket_description was declared with a 
> lazy reference to 'tickets.ticketdescription', but app 'tickets' doesn't 
> provide model 'ticketdescription'.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4f876052-71e5-4d25-9382-59d3c30d19f8%40googlegroups.com.


Re: Django blog post not linking to detail.html page

2020-01-20 Thread John

OK. I've read further through your code. It looks like it should be:

    from blog import views

But you will have another problem, unless you have defined PostListView 
somewhere in views.py other than what you have shown (2.JPG in your 
original email stops at line 35).


I do not have the Django by Example book. Perhaps you should check with 
that? The error messages tell you which line the error is on.


John

On 20/01/2020 05:54, amanda wrote:

Hi John,
Thank you!
I config setting DEBUG = True, but my webserver does not display any 
error message. i use pythonanywhere host, i do not need running: 
runserver.

I did try your advise, if i did that, i got error message:

在 2020年1月20日星期一 UTC+1上午6:43:10,amanda写道:



在 2020年1月19日星期日 UTC+1下午11:28:24,John写道:

/mysite/blog/urls.py, line 2 is bad syntax and should probably
read:

from .views import *

You should also be seeing some kind of error from your
webserver (are you running the site using runserver first?)
which would give you a clue where the problem is.

John

On 19/01/2020 16:03, amanda wrote:

Hello,
I am new to Django, i follow a book : Django by Example 2. i
install a blog, it show blog post list, but when i click post
title, it does not go to post detail.html page.
anyone can tell me where i can wrong?
Thank you very much!



-- 
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...@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/2fb56c3c-6eb6-46c9-9162-548a65b3c781%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/66a517de-64e9-4119-bfe1-0c4da34d9f78%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a431c3df-2273-2842-12c2-c39643a59f99%40martinhome.org.uk.


Re: Django bootstrap calendar

2020-01-20 Thread Muhammed Rafi A
Refer this

https://simpleisbetterthancomplex.com/tutorial/2019/01/03/how-to-use-date-picker-with-django.html

On Mon, Jan 20, 2020 at 8:15 PM Perceval Maturure 
wrote:

> Dear All
> Is there anyone who has used the djangobootrstrap calendar in Django 2.xxx
> project?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9C8AB979-2DC4-4B6B-9D1D-FD9144E9F014%40gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADwyzwo9HS3w%3D5npK%2BTn9ToEMTOOqVY-mdW%2Br951Uf9sy9dGnw%40mail.gmail.com.


Re: Django Lessons

2020-01-20 Thread Eugen Ciur
Thank you.

On Monday, January 20, 2020 at 8:38:24 PM UTC+1, Juhana Jauhiainen wrote:
>
> Hi Eugen,
>
> Seems like you're of to a good start. 
> Best of luck!
>
> -Juhana
>
> On Mon, Jan 20, 2020 at 2:21 PM Eugen Ciur  > wrote:
>
>> Sure! Thanks!
>> I will keep in mind your kind offer.
>>
>> On Monday, January 20, 2020 at 5:34:09 AM UTC+1, Karan Mittal wrote:
>>>
>>> Hey Eugin,
>>> Your blogs are awesome. Let me know if you need some help in writing. I 
>>> am a technical writer myself.
>>> I have also written a complete series on Django. 
>>> You can check it out here.
>>> https://data-flair.training/blogs/django-tutorials-home/
>>>
>>> Regards, 
>>> Karan Mittal 
>>>
>>>
>>> On Mon, 20 Jan, 2020, 1:25 AM Eugen Ciur,  wrote:
>>>
 Hi everyone,

 I launched recently a new resource, django-lessons.com. 
 
 I target mostly intermediate django developers but newcomers might find 
 it usefull as well.
 Although main focus is Django Web Framework, I will post a lot of info 
 about devops ecosystem around django (production) and about python itself.
 I have an youtube channe 
 l as well.

 What do you think?

 -- 
 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...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/0437652e-7887-48f5-a9b8-f0e79bd16d1f%40googlegroups.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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/4d864aff-5185-4fd7-aead-200f6db04161%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/90634ba7-1553-4cf4-ac03-48b51f6c6d85%40googlegroups.com.


Re: Backward migration failing because of old dropped model

2020-01-20 Thread Bruckner de Villiers
Adrien,

Your precise issue eludes me, but I have sometimes come across a similar issue 
when changing the field types of models.  

It appears that you still have a reference somewhere in your code between the 
form and the model.  I suspect that form.Form.ticket_description is a Django 
default expected file name from one of your (original) CBV’s.

 

Alternative:

My method to resolve the Catch22 is to delete the most recent migration files, 
including in your case, the migration file that originally created the 
‘ticketdescription’ model.  I move them to a dummy folder, in case they 
shouldn’t have been deleted.

 

Bruckner de Villiers

083 625 1086

 

From:  on behalf of Adrien Agnel 

Reply to: 
Date: Monday, 20 January 2020 at 22:07
To: Django users 
Subject: Backward migration failing because of old dropped model

 

Hi everyone,

 

This is my first post in this group so do not hesitate to ask for some more 
specific details if this is not enough. Django version is 2.2.9, Python 3.6.

 

 

I'm facing an error when trying to migrate back the initial migration of a 
freshly installed new application 'billing'.

The error message is the following one : 

ValueError: The field form.Form.ticket_description was declared with a lazy 
reference to 'tickets.ticketdescription', but app 'tickets' doesn't provide 
model 'ticketdescription'.

 

However the model 'ticketdescription' has been dropped several month ago and is 
no longer present in my project. Thus the part " app 'tickets' doesn't provide 
model 'ticketdescription' " is perfectly right, but I don't get why it is not 
managed by the migration of app 'tickets' which dropped the model 
'ticketdescription'.

The model 'ticketdescription' remains as a pending model of state apps in the 
migration executor, I would expect it to be removed.

 

Until now, I could migrate backward other apps without any issue but after 
adding the app 'billing', which is not directly related to app 'tickets', it is 
not possible anymore.

 

 

 

I don't know where to look at to fix this issue ? Could you help me debugging 
please ? This looks like a bug but I'm not sure !

 

Best regards,

Adrien

 

 

 

 

Here is the full error trace :

 

Traceback (most recent call last):
  File "manage.py", line 23, in 
execute_from_command_line(sys.argv)
  File "[...]/lib/python3.6/site-packages/django/core/management/__init__.py", 
line 381, in execute_from_command_line
utility.execute()
  File "[...]/lib/python3.6/site-packages/django/core/management/__init__.py", 
line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "[...]/lib/python3.6/site-packages/django/core/management/base.py", line 
323, in run_from_argv
self.execute(*args, **cmd_options)
  File "[...]/lib/python3.6/site-packages/django/core/management/base.py", line 
364, in execute
output = self.handle(*args, **options)
  File "[...]/lib/python3.6/site-packages/django/core/management/base.py", line 
83, in wrapped
res = handle_func(*args, **kwargs)
  File 
"[...]/lib/python3.6/site-packages/django/core/management/commands/migrate.py", 
line 234, in handle
fake_initial=fake_initial,
  File "[...]/lib/python3.6/site-packages/django/db/migrations/executor.py", 
line 121, in migrate
state = self._migrate_all_backwards(plan, full_plan, fake=fake)
  File "[...]/lib/python3.6/site-packages/django/db/migrations/executor.py", 
line 173, in _migrate_all_backwards
for migration, _ in full_plan:
  File "[...]/lib/python3.6/site-packages/django/utils/functional.py", line 80, 
in __get__
res = instance.__dict__[self.name] = self.func(instance)
  File "[...]/lib/python3.6/site-packages/django/db/migrations/state.py", line 
210, in apps
return StateApps(self.real_apps, self.models)
  File "[...]/lib/python3.6/site-packages/django/db/migrations/state.py", line 
280, in __init__
raise ValueError("\n".join(error.msg for error in errors))
ValueError: The field form.Form.ticket_description was declared with a lazy 
reference to 'tickets.ticketdescription', but app 'tickets' doesn't provide 
model 'ticketdescription'.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4f876052-71e5-4d25-9382-59d3c30d19f8%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/160DD2D0-2302-41E8-B1B7-CE871AB3A11F%40gmail.com.