Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

sysout opened this issue Jun 27, 2011 · 6 comments

Comments

@sysout
Copy link

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
Copy link
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

@sysout
Copy link
Author

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
Copy link
Contributor

coleifer commented Jul 1, 2011

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

@sysout
Copy link
Author

sysout commented Jul 1, 2011

But where can I find these template?

@coleifer
Copy link
Contributor

coleifer commented Jul 1, 2011

@sysout
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants