How to install a complete version of http://djangosnippets.org/? #11

Closed
sysout opened this Issue Jun 27, 2011 · 6 comments

Projects

None yet

2 participants

@sysout
sysout commented Jun 27, 2011

Hi, I have a complete newbie question:
After following the installation instruction in the Readme file, the Django snippets is running on my laptop now. However, "Log in", "register", "about" "search" etc are not functional.
I added one line to the urls.py of my project:
" (r'.*', include('cab.urls.snippets')), "

I cheched cab/urls/snippets.py and didn't find any pattern match "/accounts/login/" or "/about/"
Did I doing something wrong? If I want to have a website identical to http://djangosnippets.org/ what should I do?

@coleifer
Contributor

Congrats, sounds like you're most of the way there. You'll need to install the dependencies listed in the README -- they are all pip-installable. Add the django ones to your project's INSTALLED_APPS. The /accounts/ urls specifically are in the django-registration app, so:

url(r'^accounts/', include('django.contrib.auth.urls')),  # <-- djangos own auth urls (keep)
url(r'^accounts/', include('registration.urls')),  # <-- django registration urls

Below is a gist that shows pip requirements, installed apps, and urls:

https://gist.github.com/892fc06a466e2c4dc72b

@coleifer coleifer closed this Jun 27, 2011
@sysout
sysout commented Jun 30, 2011

Hi Charles,
I think I am very close now. When I click login in, django report that:

Request Method: GET
Request URL: http://127.0.0.1:8000/accounts/login/?next=
Django Version: 1.3
Exception Type: TemplateDoesNotExist
Exception Value: registration/login.html
Exception Location: /Library/Python/2.6/site-packages/django/template/loader.py in find_template, line 138

I know django package has this file at

/Library/Python/2.6/site-packages/django/contrib/auth/tests/templates/registration/login.html

My question is:
Do we have to manually add each template directory of our app to TEMPLATE_DIRS?
Is it a bad practice to copy the template files to the template directory of our project? How do you handle it?

Can you give us your complete settings.py?

Also, I see "about" is not in the url patterns. Is urls.py in that link complete?

@coleifer
Contributor
coleifer commented Jul 1, 2011

Yeah registration doesn't come with default templates. The "about" bit is a flatpage.

@sysout
sysout commented Jul 1, 2011

But where can I find these template?

@sysout
sysout commented Jul 1, 2011

Thank you!
I thought you may have different template than the one come with the other packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment