Re: Backward migration failing because of old dropped model

2020-01-21 Thread maninder singh Kumar
In your database there is a table called django_migrations. Delete all references in it to any other migration than the initial one. [image: --] Maninder Kumar [image: http://]about.me/maninder.s.kumar On Tue, Jan 21, 2020 at 1:37 AM Adrien

Re: Backward migration failing because of old dropped model

2020-01-21 Thread Adrien Agnel
Hello Bruckner, Thank you for your answer. You pointed me in the right direction : the issue was with the Form model which is part of a custom app named 'form'... I've added a depency to the initial migration of the 'billing' app on the last current migration of 'form' app, and it solved the iss

Re: Backward migration failing because of old dropped model

2020-01-21 Thread Adrien Agnel
Hello Maninder, Thanks for your answer, it's finally working now after adding a dependency to the initial migration file. See Bruckner's answer and my other reply for more details. Best regards, Adrien On Tuesday, January 21, 2020 at 9:19:24 AM UTC+1, maninder singh Kumar wrote: > > In your d

Tracking IP

2020-01-21 Thread Soumen Khatua
Hi Folks, In my Django application I want to show IP address of users, Just like others financial websites. How I can do that using Django(of course it's should be free cost). Thank You in advance Regards, Soumen -- You received this message because you are subscribed to the Google Groups "Dj

Re: Tracking IP

2020-01-21 Thread bharat pamnani
hostname -I will give you the ip of user. On Tue, Jan 21, 2020 at 5:27 PM Soumen Khatua wrote: > Hi Folks, > > In my Django application I want to show IP address of users, Just like > others financial websites. How I can do that using Django(of course it's > should be free cost). > > Thank You i

Re: Tracking IP

2020-01-21 Thread Soumen Khatua
I want to show the users/clients IP address On Tue, Jan 21, 2020 at 5:29 PM bharat pamnani wrote: > hostname -I will give you the ip of user. > > On Tue, Jan 21, 2020 at 5:27 PM Soumen Khatua > wrote: > >> Hi Folks, >> >> In my Django application I want to show IP address of users, Just like

Calculation field - best practice

2020-01-21 Thread Mario Bisiani
Good morning, first post here! I have a quesion for you. I need to have a calculated field from two attribute of different class in model.py. Which is the best practice to perform calcs : in model.py by function or in the view.py? In the case of model.py how can i access the atribut of the dif

Re: Django Lessons

2020-01-21 Thread Philip Mutua
Thanks for sharing this you have useful content. On Sun, Jan 19, 2020 at 10:55 PM 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

Re: Tracking IP

2020-01-21 Thread Roger Gammans
Hi The precise details of this depend on your hosting environment, but the canonical method is request.get_host() ; see https://docs.djangoproject.com/en/3.0/ref/request-response/#django.http.HttpRequest.get_host If your hosting environment is non-standard; you might need some custom middlewar

Re: Backward migration failing because of old dropped model

2020-01-21 Thread Adrien Agnel
I have been a bit quick when I wrote that this finally works... Actually, with the dependency on 'form' app, I can now run my new migration for the 'billing' app and make it work backward as well. However my project's test suites won't run anymore, and fail with the same error as previously. I

Re: Calculation field - best practice

2020-01-21 Thread Sencer Hamarat
IMO this should be done in view if it's just for display purposes in rendered page. Although, the best method is doing it in a template tag. Regards, Sencer HAMARAT On Tue, Jan 21, 2020 at 3:30 PM Mario Bisiani wrote: > Good morning, > > first post here! > > I have a quesion for you. I need t

Unique Field

2020-01-21 Thread Soumen Khatua
Hi Folks, Is their any other library or module is available except UUID which can generate unique number in python? As I mentioned earlier I want to use random unique number in django for billion user. Just like account number,please tell me any unique module. Thank You In advance Thank You Re

Re: Unique Field

2020-01-21 Thread Irfan Khan
You can use nano library to generate unique numbers or characters On Tue, 21 Jan 2020 at 8:41 PM, Soumen Khatua wrote: > Hi Folks, > > Is their any other library or module is available except UUID which can > generate unique number in python? > > As I mentioned earlier I want to use random uniqu

Re: Unique Field

2020-01-21 Thread Soumen Khatua
Could you share any documentation link,please?? On Tue, 21 Jan 2020, 20:45 Irfan Khan, wrote: > You can use nano library to generate unique numbers or characters > > On Tue, 21 Jan 2020 at 8:41 PM, Soumen Khatua > wrote: > >> Hi Folks, >> >> Is their any other library or module is available exc

Re: Tracking IP

2020-01-21 Thread Kasper Laudrup
Hi, On 21/01/2020 13.34, Roger Gammans wrote: Hi The precise details of this depend on your hosting environment, but the canonical method is request.get_host() ; see https://docs.djangoproject.com/en/3.0/ref/request-response/#django.http.HttpRequest.get_host If your hosting environment is n

Re: Tracking IP

2020-01-21 Thread Soumen Khatua
ok On Tue, Jan 21, 2020 at 11:19 PM Kasper Laudrup wrote: > Hi, > > On 21/01/2020 13.34, Roger Gammans wrote: > > Hi > > > > The precise details of this depend on your hosting environment, but the > > canonical method is request.get_host() ; see > > > https://docs.djangoproject.com/en/3.0/ref/r

some value for primary key

2020-01-21 Thread Soumen Khatua
Hi Folks, I want to start my primary key from saome random number like: (onwards) but not from 1. How I can do that in django? Thank you in advance Regards, Soumen -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this g

Re: DjangoEveryDay. My practice website!

2020-01-21 Thread Jack Lin
Actually DjangoEveryDay and Jack's Practice Zone is the same thing. It is something like “Practice Django Every Day in Jack’s Practice Zone” But the different name seems confuse. I’ll fix it. 在 2020年1月21日 於 上午1:16:03, maninder singh Kumar (maninder.s.ku...@gmail.com) 寫下: Did you do Jack's Practic

Re: DjangoEveryDay. My practice website!

2020-01-21 Thread Jack Lin
My Major is information and communication. Kind of Mass Communication but we made our content more specific to internet world. I’m not really sure what you mean in “and importantly how you think contributes to a certain type — or even workflow or stack — of learning in CS. “ "tying in what you know

Re: Unique Field

2020-01-21 Thread Irfan Khan
Here you can check this link for reference https://pypi.org/project/nanoid/ On Tue, 21 Jan 2020 at 9:02 PM, Soumen Khatua wrote: > Could you share any documentation link,please?? > > On Tue, 21 Jan 2020, 20:45 Irfan Khan, wrote: > >> You can use nano library to generate unique numbers or char

Re: Unique Field

2020-01-21 Thread Soumen Khatua
Irfan- Are you sure it will generate unique id for 10 billion people. On Wed, 22 Jan 2020, 01:39 Irfan Khan, wrote: > Here you can check this link for reference > > https://pypi.org/project/nanoid/ > > > On Tue, 21 Jan 2020 at 9:02 PM, Soumen Khatua > wrote: > >> Could you share any documentati

Re: Unique Field

2020-01-21 Thread Irfan Khan
No I didn’t check that one, it will generate unique id’s for you but how many you wanted to generate you must write code explicitly with some logic On Wed, 22 Jan 2020 at 1:43 AM, Soumen Khatua wrote: > Irfan- Are you sure it will generate unique id for 10 billion people. > > On Wed, 22 Jan 2020

Re: Unique Field

2020-01-21 Thread Soumen Khatua
Okay Thanks for the information. On Wed, 22 Jan 2020, 02:11 Irfan Khan, wrote: > No I didn’t check that one, it will generate unique id’s for you but how > many you wanted to generate you must write code explicitly with some logic > > On Wed, 22 Jan 2020 at 1:43 AM, Soumen Khatua > wrote: > >>

Geodjango deplyoment with Apache on Windows Server

2020-01-21 Thread 'nicola frosi' via Django users
I would like to know if anyone has ever managed to publish web pages created with geodjango using the OSGEO, mod_wsgi, Python36 libraries and drivers in PyCharm with APACHE. I would be interested in starting a discussion on which compilers in windows is better to use, or if to compile the Pyth

Re: some value for primary key

2020-01-21 Thread Suraj Thapa FC
Just right a simple python function With random number generation... And call it where you want to use it On Wed, 22 Jan 2020, 12:03 am Soumen Khatua, wrote: > Hi Folks, > > I want to start my primary key from saome random number like: (onwards) > but not from 1. How I can do that in dja

Re: some value for primary key

2020-01-21 Thread Mike Dewhirst
On 22/01/2020 5:32 am, Soumen Khatua wrote: Hi Folks, I want to start my primary key from saome random number like: (onwards) but not from 1. I wonder why? How I can do that in django? If I really had to do that I would adjust the relevant sequence manually via PGAdmin. Otherwise,

Re: some value for primary key

2020-01-21 Thread maninder singh Kumar
you could do that in the database with a mysql statement. ALTER TABLE tbl AUTO_INCREMENT = ; [image: --] Maninder Kumar [image: http://]about.me/maninder.s.kumar On Wed, Jan 22, 2020 at 12:03 AM Soumen Khatua wrote: > Hi Folks, > > I

Re: Tracking IP

2020-01-21 Thread maninder singh Kumar
You could request.hostname or request.path to get to the names. [image: --] Maninder Kumar [image: http://]about.me/maninder.s.kumar On Tue, Jan 21, 2020 at 5:27 PM Soumen Khatua wrote: > Hi Folks, > > In my Django application I want to sh