cookiecutter / cookiecutter-django

Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.

Home Page:https://cookiecutter-django.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

additions to the "usage" part

ccurvey opened this issue · comments

new user here, please tell me if this is noise.

after pip install requirements/local.txt....

  1. Go create a database for your site to use
  2. edit myapp/config/settings.py and change the database URL. This should be
postgres://username:password@hostname:port/databasename
  1. python manage.py syncdb (to create basic tables)
  2. python manage.py migrate (to install the migrations)
  3. python manage.py runserver (to start the server)
  4. 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.)

  1. 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.

  2. 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.)

  3. 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.

  4. 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.)

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 🌊