Django newbie, running on Ubuntu 12.04, Django 1.3.1 and apt-get install python-django-registration.
Trying build a demo site to use the user registration module. I followed the steps from http://lightbird.net/dbe/forum3.html. But when I try to access accounts/ or admin/, getting the following error: "name 'registration' is not defined"
I am able to access the admin interface, after commenting out the registration part in urls.py. Any tips to overcome this issue?
is "registration" in INSTALLED_APPS in settings.py?
Is django-registration on your PYTHONPATH? Also I assume that you did syncdb after adding registration to installed app. If both are true, then try opening a shell prompt with python manage.py shell and import something from the registration module and see what error that gives
Related
i tried installing django registration:
http://django-registration.readthedocs.org/en/latest/
but i get an error: no module named registration
whenever i load my site.
what can I do?
You should add it to the INSTALLED_APPS list :
Begin by adding registration to the INSTALLED_APPS setting of your
project, and specifying one additional setting:
ACCOUNT_ACTIVATION_DAYS This is the number of days users will have to
activate their accounts after registering. If a user does not activate
within that period, the account will remain permanently inactive and
may be deleted by maintenance scripts provided in django-registration.
This is from the required settings section :
http://django-registration.readthedocs.org/en/latest/quickstart.html#required-settings
So these are the steps that worked for me.
Install using pip
$pip install django-registration
Make sure the django-registration is installed.
$pip list
django-registration should show up.
Add 'django-registration' to INSTALLED_APPS tuple
Hope this helps.
I have installed django-allauth for using social accounts in my django app but every time I try
manage.py syncdb
It gives me an error
ImportError: No module named allauth
I tried to add even
sys.path.append(os.path.abspath(os.path.dirname(__file__)))
to
manage.py
but its still not working.I am unable to debug about how to add path to allauth to include it?
go to the root of the folder where you have your virtual environment and type:
source bin/activate
I'm using django-bouncer to make a waiting list in a Django 1.6 app. Unfortunately, when I add 'bouncer.middleware.MembersOnlyMiddleware' to my MIDDLEWARE_CLASSES as required, I get: "ImportError: No module named middleware." I tried going into the Django shell and typing "from bouncer.middleware import MembersOnlyMiddleware," but that received the same error.
What can I do to resolve this problem?
django-bouncer and bouncer are not the same package.
Try to install django-bouncer:
pip install django-bouncer
Hi I am trying to implement Django simple capcha into my app but when i try to import from view.py "from captcha.fields import CaptchaField" i get an error "No module named fields". but i am able to import this in the django shell terminal. What else am i missing
Did you add captcha to the INSTALLED_APPS in your settings.py?
If so, did you install it, where did you install it, and is it on your Python path?
I encountered same problem before and I installed django-simple-captcha. It worked finally
I can't sign in to Django admin with any of the superusers I've created. Tried creating new superusers, changing passwords, etc. - no error messages for any of these processes, but still can't sign in.
I'm not sure if it's related, but I also can't run django-admin.py commands. Here is what I've done so far:
$ django-admin.py validate
Error: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.
$ export DJANGO_SETTINGS_MODULE=mysite.settings
$ django-admin.py validate
Error: Could not import settings 'mysite.settings' (Is it on sys.path? Does it have syntax errors?): No module named mysite.settings
sys.path shows ['/Users/joerobinson/Sites/django/mysite' ... (other stuff on path)]
Is there something else I need to do to register the mysite module?
python manage.py runserver works fine.
Conclusion
For the question about logging in to django admin, I did not have django.contrib.auth.backends.ModelBackend included in my AUTHENTICATION_BACKENDS - adding this allowed me to sign in to admin.
I'm still working on the django-admin.py configuration question (which appears to not be related), and will reopen it in a separate question.
In my case, I had "SESSION_COOKIE_SECURE = True" because I was trying SSL configurations. Just commenting this line worked.
Well, to answer one of your questions, the parent folder of mysite is what needs to be on the python path. Adding mysite itself to your python path will expose the contents of mysite, not the mysite module to python.
As for runserver working / passwords not working, I haven't a clue. Have you customized anything with authentication?
Can you start the shell and try authenticating with your superuser?
http://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.authenticate
You said in a comment that "is_staff was set appropriately... same problem." -- does that mean you were able to log in with the first superuser to set is_staff??
I ran into a similair problem but, I couldn't login on the admin interface even after removing the database and creating it from scratch. The problem was caused by a real silly mistake.
Don't run python manage.py testserver by accident. Make sure you use python manage.py runserver.