0

I am trying to use django-registration package on my project as an APP. All I did was

  1. Downloaded the package from ""
  2. Copied the "registration" folder under SOWL
  3. In my project's URLs.py added

    (r'^accounts/', include('registration.backends.default.urls')),
    
  4. in my project's settings.py added "registration"

    INSTALLED_APPS = (
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.sites',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        'CATALOG',
        'SOWLAPP',
        'registration',
        # Uncomment the next line to enable the admin:
        'django.contrib.admin',
        # Uncomment the next line to enable admin documentation:
        'django.contrib.admindocs',
    )
    

it gives the following error -

C:\SHIYAM\Personal\SuccessOwl\SOWL0.1\SOWL>python manage.py runserver
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
443, in execute_from_command_line
    utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 196,
 in run_from_argv
    self.execute(*args, **options.__dict__)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 217,
 in execute
    translation.activate('en-us')
  File "C:\Python27\lib\site-packages\django\utils\translation\__init__.py", lin
e 105, in activate
    return _trans.activate(language)
  File "C:\Python27\lib\site-packages\django\utils\translation\trans_real.py", l
ine 194, in activate
    _active.value = translation(language)
  File "C:\Python27\lib\site-packages\django\utils\translation\trans_real.py", l
ine 183, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File "C:\Python27\lib\site-packages\django\utils\translation\trans_real.py", l
ine 160, in _fetch
    app = import_module(appname)
  File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in im
port_module
    __import__(name)
  File "C:\SHIYAM\Personal\SuccessOwl\SOWL0.1\SOWL\registration\__init__.py", li
ne 3
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax

C:\SHIYAM\Personal\SuccessOwl\SOWL0.1\SOWL>

I am looking at the urls.py, __init__.py from the registration package and they all look different from the usual urls.py, __init__.py from in the regular apps under my project. Why are they different and what should I do to make it different?

  • SHM
user1546529
  • 45
  • 1
  • 9
  • It looks like something has gone wrong when you were copying the `registration` app. The traceback suggests that `__init__.py` contains html like ` `, which it definitely shouldn't. – Alasdair Aug 10 '12 at 14:06
  • What version did you download, and where from? – Alasdair Aug 10 '12 at 14:07
  • 1
    if you post the full exception traceback here you get a quicker answer than posting a screenshot of half the exception. – Meitham Aug 10 '12 at 14:08
  • 1
    And, remember: websites come and go. If next year screenshot.com closes shop, this question is no longer as useful to others. Unless the question actually dictates a screenshot, then always just post the text here. – Chris Pratt Aug 10 '12 at 14:24
  • Thanks for all the comments/advices. I edited the OP by adding the whole exception and removed the screenshot. – user1546529 Aug 10 '12 at 15:29
  • You are right. I think I have all the repositery details on these files. I wonder if this repo was cracked. I downloaded it from here - https://bitbucket.org/ubernostrum/django-registration/src/27bccd108cde/registration If you download the __init__.py, it contains XHTML and javascript code in it. weird. Am I downloading it from a wrong repo? – user1546529 Aug 10 '12 at 15:33
  • I found what the problem is. I right and saved those files manually as I could not find .zip package for this for windows. It downloaded the whole html page with the .py extension. I dont understand why it would be in py extension if it is copying the html page. but thats fine. I good to go now. – user1546529 Aug 10 '12 at 17:14
  • I am not able to mark the comments as useful. I am able to do so for answers. – user1546529 Aug 10 '12 at 17:15
  • I've added my comment as an answer, so you can upvote it or accept it if it was helpful. – Alasdair Aug 11 '12 at 14:32

1 Answers1

0

It looks like something has gone wrong when you were copying the registration app . The traceback suggests that __init__.py contains html like <!DOCTYPE html>, which it definitely shouldn't.

Alasdair
  • 298,606
  • 55
  • 578
  • 516