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 8350165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:13:56+00:00 2026-06-09T08:13:56+00:00

I am facing annoying problem.. i was trying to extend user registation with custom

  • 0

I am facing annoying problem.. i was trying to extend user registation with custom fields…
as below

import hashlib
import datetime
import hmac
from django.db import models

from django.contrib.auth.models import User
from ecpCommon.models import StateModel
from ecpCommon.enum import enumauto
from ecpPayments.models import PaymentCard
from registration.signals import user_registered
from apps.ecpUser.models import UserProfile
from apps.ecpMerchant.forms import RegistrationFormEx


   class MerchantProfile(StateModel):
      user = models.OneToOneField(UserProfile, related_name="merchant_profile")
      payment_card = models.OneToOneField(PaymentCard, related_name="merchant_profile")
      current_state = models.IntegerField('State', choices=STATE_CHOICES)
      name = models.CharField('Merchant Name', max_length=64)

      def user_created(sender, user, request, **kwargs):
            form = RegistrationFormEx(data=request.POST)
            new_user = User.objects.get(username=request.POST['username'])
            digest=hmac.new("qnscAdgRlkIhAUPY44oiexBKtQbGY0orf7OV1I50", str(request.POST['password1']),hashlib.sha1).hexdigest()
            new_profile = UserProfile(user=new_user,api_key=digest)
            new_profile.save()
            #now add other fields including password hash as well
            uid = new_profile.id

            merchant_profile = MerchantProfile(user_id=uid,
                create_time=datetime.datetime.now(),
                modified_time=datetime.datetime.now(),
                payment_card_id=uid,
                current_state=1,
                name=request.POST['name'],
                 )
            merchant_profile.save()

my forms is as follow

from django import forms
from registration.forms import RegistrationForm
from django.utils.translation import ugettext_lazy as _
from registration.models import RegistrationProfile
from apps.ecpMerchant.models import Category

class RegistrationFormEx(RegistrationForm):
    #ADD ALL CUSTOM FIELDS BELOW
    name=forms.CharField()

but it is showing following error log.. earlier it was working .. later the error came.. i have several modification in models with other tables… but how it effect this registration

C:\Python27\Lib\site-packages\django\bin\ecp>manage.py runserver
Validating models...

Unhandled exception in thread started by <bound method Command.inner_run of <dja
ngo.contrib.staticfiles.management.commands.runserver.Command object at 0x02DC0A
B0>>
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.
py", line 91, in inner_run
    self.validate(display_num_errors=True)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 266,
 in validate
    num_errors = get_validation_errors(s, app)
  File "C:\Python27\lib\site-packages\django\core\management\validation.py", lin
e 30, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 158, in
 get_app_errors
    self._populate()
  File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 67, in
_populate
    self.load_app(app_name)
  File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 88, in
load_app
    models = import_module('.models', app_name)
  File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in im
port_module
    __import__(name)
  File "C:\Python27\Lib\site-packages\django\bin\ecp\apps\ecpMerchant\models.py"
, line 10, in <module>
    from apps.ecpMerchant.forms import RegistrationFormEx
  File "C:\Python27\Lib\site-packages\django\bin\ecp\apps\ecpMerchant\forms.py",
 line 5, in <module>
    from apps.ecpMerchant.models import Category
  File "C:\Python27\Lib\site-packages\django\bin\ecp\apps\ecpMerchant\models.py"
, line 10, in <module>
    from apps.ecpMerchant.forms import RegistrationFormEx
ImportError: cannot import name RegistrationFormEx
  • 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-09T08:14:01+00:00Added an answer on June 9, 2026 at 8:14 am

    Circular import…

    You have forms importing models which is importing forms.

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

Sidebar

Related Questions

Im facing a very annoying problem in PHP when Im trying to watermark the
I'm facing an annoying problem that has been holding me back from programming for
Im facing problem when trying to apply data annotation. In my case im passing
Im facing a strange issue trying to move from sql server to oracle. in
I am facing a very annoying problem. I have written (in Notepad++) some SQL
I am facing a simple yet annoying problem of memory deallocation and message sending
I'm facing this really annoying problem with QTextStream used for console output. QTextStream cout(stdout,
I am facing a little annoying design problem. Not easy to give a title
I'm facing a very annoying problem. Here's the context : I have a rectangle
I am using Hibernate and I am facing with a really annoying problem, when

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.