Merge Project

2022-12-28 Thread Anil Singh
Hi Friends,

I am merging tow one project to another project, also install app in 
settings.py, but i error : RuntimeError: Model class 
django.contrib.contenttypes.models.ContentType doesn't declare an explicit 
app_label and isn't in an application in INSTALLED_APPS.

How can i fix this error
Need your help friends

Thanks & Regards
Anil

-- 
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/6e8bbf6c-e2b2-4e26-90b0-b293734ff65bn%40googlegroups.com.


Squashing Data Migrations

2022-12-28 Thread Saksham Bajaj
Hi,

This feels like a very common use case but I can't figure out the best 
practice or any guidance online so would really appreciate any advice. 

*Django Version: 3.1*
*Python: 3.7*


Here is the scenario:

   1. I have a custom data migration that loads custom data into a 
   migration. Following exactly the pattern in the given documentation on 
   data migrations 
   
   .
   In this case, this migration file was called 'add_areas.py' and exists 
   in the `migrations/ ` folder as expected. The 'add_areas' migration has a 
   single RunPython(add_areas, reverse_code=remove_areas) operation.
   2. I squashed all my migrations, including 'add_areas' into  
   'all_squashed.py'. Now, the RunPython command in 'all_squashed.py' 
   references the custom `add_areas` and `remove_areas` function in the 
   'add_areas.py' migration file.
   3. As the migration is squashed, and applied in my environments, I now 
   need to delete the 'add_areas' data migration it replaces as recommended at 
   the end of the section in the documentation on squashing migrations 
   

   4. I can't delete the 'add_areas' data migration now as it has the 
   custom functions.


The few options that I have come up with to have this to work, but I feel 
there is a cleaner pattern which will let me keep the custom functions in 
the migrations/ folder and squash migrations easily:

   1. Move all the custom functions for any data migrations to the squashed 
   migration. This will let me delete the data migration `add_areas`. I 
   however want to keep these functions in different files for readability 
   rather than having to copy and modify them every time I squash migrations.
   2. I tested simply deleting migration class/having an empty migration 
   class/having a migration class with no dependencies/operations from 
   'add_areas' and only leaving the custom functions in those files. All of 
   these raised errors, either BadMigration or multiple leaves. 
   3. The failure in option 2 leaves me to Option 3 where I can simply move 
   these functions outside the migrations folder and reference the files from 
   there. This however feels clunky, and I don't want to create a new folder 
   in my application just for a few data migrations. 

So essentially looking for a pattern that will allow me to keep custom 
migration function files/modules within 'migrations/' and not have to 
move/modify these functions everytime I squash my migrations.

Thank you for any advice :)

Regards,
Saksham

-- 
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/282615f7-fe72-4303-af73-916d40dcc0a0n%40googlegroups.com.


How to create a copy of production sql database for development use?

2022-12-28 Thread Jian Wu
Dear all,

I have a Django currently running in production mode on a remote Linux server. 
While the production server is in use, I am developing new features on my local 
computer. Is there a way to create a copy of production server, so that when I 
develop new features I can test on a database environment as close to the 
production environment as possible?

On the production server the database is a mySQL database.

Thanks!

Best regards,
Jian

-- 
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/4D3A5F50-22F4-4BDB-8202-ED7B816EE848%40gmail.com.


Re: stuck in my payment gateway

2022-12-28 Thread 'Kasper Laudrup' via Django users

On 28/12/2022 20.21, Music Fm wrote:
hi guys, so i am building a payment gate way using django but i am stuck 
on how to integrate cards in the views for the form. please i need help




Which kind of help do you think anyone will be able to provide when you 
haven't given any information at all?


If you don't learn how to communicate with other people you'll be stuck 
forever.


Consider start by reading this:

https://www.propublica.org/nerds/how-to-ask-programming-questions

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/9fc7fb33-7493-a10f-22ed-e720dde47f5e%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


stuck in my payment gateway

2022-12-28 Thread Music Fm
hi guys, so i am building a payment gate way using django but i am stuck on 
how to integrate cards in the views for the form. please i need 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/e957e6a2-a616-43bd-86d1-d0a6d93eac4an%40googlegroups.com.


filtering queryset in CreateAPIView view

2022-12-28 Thread Larry Martell
I have a CreateAPIView view with this code in the serializer:

class AssignWorkItemSerializer(serializers.Serializer, WorkitemSerializerMixin):
assigneeIds = serializers.ListSerializer(
child=serializers.PrimaryKeyRelatedField(

queryset=get_user_model().objects.filter(userrole__role__name='analyst')
),
source='assignees'
)

This is failing because that query returns multiple rows. I want to
filter that queryset at run time by something that is available to me
in the request. Is there a way to do that?

-- 
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/CACwCsY46gZEjH9YNajSx%2B2uSSzozC7S_up9KY%3DB655p4zFL-Yg%40mail.gmail.com.


Re: NEW BIE HERE HOW CAN I LEARN DJANGO FAST

2022-12-28 Thread Jeff Kingsley
can teach you


On Sun, Dec 25, 2022 at 12:08 PM Namanya Daniel 
wrote:

> While learning Django, pay attention to URLs and settings and models, the
> rest you need basic python skills
>
> On Sunday, December 25, 2022 at 2:14:06 AM UTC+3 guru...@gmail.com wrote:
>
>> Hey, I just want to know how you've learned django framework and what
>> resources did you use. It would be great if anyone can suggest me some
>> studying resources.
>> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1dd19704-2e56-47b9-815a-6d76b0e9adfen%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/CAA9WjmH_1mk5rowmfPXnEuRgrYPqMN3i4H8cBiW5o9TeZasQ_A%40mail.gmail.com.