Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8459909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:27:32+00:00 2026-06-10T13:27:32+00:00

okay, i have a generic question .. I want to have my models.py very

  • 0

okay, i have a generic question .. I want to have my models.py very clean … no other stuff other than declaring the models.

lets say i have this as models.py

class UserProfile(models.Model:
    user = models.OneToOneField(User, related_name='profile')
    #other stuff

and this is my signals.py

def create_user_profile(sender, instance, created, **kwargs):
    if created:
        profile, created = UserProfile.objects.get_or_create(user=instance)

post_save.connect(create_user_profile, sender=User)

how do i go about telling my application that this is my signals file? .. do i have to declare them in my models.py?

//mouse

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:27:34+00:00Added an answer on June 10, 2026 at 1:27 pm

    Well – I saw one way of doing it I liked. Create receivers.py or signals.py in the same app, and put your signal receiving methods and then just import all of them and connect to signals in models.py.

    Or even (f.e. if you like to use decorators for defining connected signals, which I always use) – import whole receivers.py at the end of models.py: from app.receivers import *

    Only thing I don’t like in this solution is that it sometimes ends with circular dependencies you must care about.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, so I want to have a generic method that can read data from
Okay, this might be a very silly beginner question, but: I've got an ClassA,
EDIT: ANSWER AT BOTTOM OF THIS QUESTION Okay so I've got some generic EF
okay i have been trying to understand this for hours i am learning VB
Okay i have two models: posts and comments. as you can think comments has
Okay, this is a bit complicated so please bear with me. :) We have
Okay this is probably a shot in the dark as it would be very
Okay, this is the case: I got a generic base-class which I need to
Okay; sorry I know this isn't a programming question as such, but it was
I want a generic function that would work with types that have Top ,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.