additions to the "usage" part
ccurvey opened this issue · 6 comments
new user here, please tell me if this is noise.
after pip install requirements/local.txt....
- Go create a database for your site to use
- edit myapp/config/settings.py and change the database URL. This should be
postgres://username:password@hostname:port/databasename
- python manage.py syncdb (to create basic tables)
- python manage.py migrate (to install the migrations)
- python manage.py runserver (to start the server)
- hit localhost:8000 (to see if everything worked)
At this point, you WON'T have any admin user set up. (Is this a 1.6 bug? Usually the initial user is set up at the first syncdb.)
-
edit your settings again and find EMAIL_BACKEND. change "smtp" to "console". This is so you don't have to go through all the rigamarole of getting email connectivity working right now.
-
use the "Sign up" link available from http://localhost:8000 to sign up for an account. The verification email will appear in the window where you started the server. (The console.)
-
Copy the confirmation link from the console and paste it into your browser. Confirm your email, and you'll be taken to the login screen.
-
Now you can login to the site, but you still don't have an administrative user. To make the user you just registered an admin user, fire up a postgres query tool (psql, pgadmin3, etc), and run:
update users_user
set is_superuser = true
, is_staff = true
where id = 1; # or use username or email to restrict your update.
Now you are ready to start creating your own app. (I'll file another ticket with that doco when I get it working.)
You can skip steps 7 - 10 with https://docs.djangoproject.com/en/1.6/ref/django-admin/#createsuperuser
I noticed the lack of automatic superuser creation a while back and meant to open an issue. I guess this is it. 😉
ah, thank you syst3ml00t. I figured that there had to be a better way, but getting out the Big Hammer (tm) seemed faster. (I'm wondering if I should file a doc ticket for Django 1.6 to include this new thing in the release notes.
Well, @ccurvey, the question to ask is this a bug in Django or in cookiecutter-django?
You can skip steps 7-10 and do python manage.py createsuperuser
instead of django-admin.py createsuperuser
. The later does not work, possibly due to a documentation bug in django.
http://blog.johnbaldwin.org/2013/05/11/django-admin-createsuperuser/ provides some explanation on this.
I'm working on cleaning this up and moving it into the README 🌊