-
Notifications
You must be signed in to change notification settings - Fork 11
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
Assignment: Part one of Django tutorial #3
Comments
So we need to follow the instructions and do sections from "creating project" to "play with API". Is that correct? |
Yeah - doing everything on that page to create a poll app. |
FIX: In settings.py there needs to be a trailing comma after os.path.join(PROJECT_ROOT, 'static_media') in the STATICFILES_DIRS |
Hi guys: I am really stuck with the assignment. I look over the part 1 and understand pretty well what is going on. However, it seems that I have trouble implementing the steps on my computer. I have created a new virtual environment called assignment-env However, I can't get this command to work. I refer back to the class slides for help and didn't see I did anything wrong. I also tried to install different version of Django and it still doesn't work. Can anyone help me. I am running Ubuntu. |
@duanyang Your file structure should look like this. Yu can move them using the OS or you can and should do it by using the mv [what] [to] |
@epait Thanks for helping and sharing! |
@duanyang Make sure that you're in the mysite directory (while in your venv before trying to run the syncdb command. (mysite-env)$ cd mysite |
@shawannewang Make sure that you're in the right directory when you're running commands. $ cd DJANGO_PROJECTS ###Make sure you’re in the mysite directory (top level) before running startapp or syncdb (mysite-env) DJANGO_PROJECTS $ django-admin startproject mysite |
@caseymm Thanks! It worked up until I tried django-admin startproject mysite. I tried it with and without .py but it keeps saying 'command not found' or this shows up: 'did you mean: Command 'django-admin' from package 'python-django' (main)' |
@shawannewang Try this: sudo ln -s /usr/lib/python2.7/dist-packages/django/bin/django-admin.py /usr/local/bin/django-admin.py http://wecanrify.wordpress.com/2012/07/05/installing-the-django-framework-on-ubuntu-12-04-3/ |
It ran (I entered the code and then my password when prompted, so it should've worked), but when I tried django-admin again it still gave me command not found. I tried googling solutions, but most of them seemed to give similar answers which don't work either. Not sure what is up with that...thank you for the help, though! I appreciate it a lot. Edit: Oh! I figured out why now. I tried django-admin.py --help and it worked totally fine afterwards. hm... |
thanks @caseymm |
Hi guys: For part 2 of tutorial, I update admin.py with following codes: from django.contrib import admin class PollAdmin(admin.ModelAdmin): admin.site.register(Poll, PollAdmin) However, when I refresh my webpage, I didn't get the same result as the tutorial states. The screenshot below shows what I get. Somehow, the phrase "Date information" doesn't show up as it suppose to. Does anyone get similar problem? |
The code you provided is displaying properly. I am not sure where you are in the tutorial but if you are trying to do this: https://docs.djangoproject.com/en/dev/_images/admin07.png |
Hi guys: I am currently doing the section "Use generic views: Less code is better" on https://docs.djangoproject.com/en/1.6/intro/tutorial04/ I follow the instruction and make necessary change. However, I get the following message when I try to run the poll (127.0.0.1:800/polls/1) Does anyone know what is going on? |
Do Part 1: https://docs.djangoproject.com/en/1.6/intro/tutorial01/
The text was updated successfully, but these errors were encountered: