Re: Tutorial Part 3: loading index.html in browser
Also, I get the following error message when rendering the page with my local server: TemplateSyntaxError at /polls/ Could not parse the remainder: 'http://poll.id/";>poll.id' from 'http://poll.id/";>poll.id' On Sunday, November 25, 2012 8:34:26 AM UTC-5, Luisa Beck wrote: > > Mm, I don't have a TEMPLATE_CONTEXT_PROCESSORS section in the setting.py > section. > The setting.py file in my version of Django only includes TEMPLATE_DEBUG, > TEMPLATE_LOADERS and TEMPLATE_DIRS. > > Could you specify what you mean? Thank you. > > On Sunday, November 25, 2012 8:16:00 AM UTC-5, Sergiy Khohlov wrote: >> >> looks like you have a problem with template processor >> could you please check setting.py section TEMPLATE_CONTEXT_PROCESSORS >> >> 2012/11/25 Luisa Beck : >> > Thank you Xavier and Sergiy for your responses. >> > >> > To clarify: I put the following code (see below) into my index.html >> file and >> > got a page displaying the code (rather than a list) when I rendered it >> in my >> > browser by my local server: >> > >> > Could the problem have to do with my file system? I created a directory >> > called 'templates' in the inner 'mysites' folder and created another >> > directory within that called 'polls'. That's where I put the index.html >> > file. And I also edited TEMPLATE_DIRS in my settings.py to tell Django >> the >> > absolute path to index.html. >> > >> > Any more thoughts about this? Thank you! >> > >> > >> > >> > >> > Test >> > >> > >> > >> > >> > {% if latest_poll_list %} >> > >> > >> > >> > {% for poll in latest_poll_list %} >> > >> > {{ poll.question >> }} >> > >> > {% endfor %} >> > >> > >> > >> > {% else %} >> > >> > No polls are available. >> > >> > {% endif %} >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > On Saturday, November 24, 2012 5:48:29 PM UTC-5, Sergiy Khohlov wrote: >> >> >> >> Near too. >> >> >> >> simple example of your fitst template: >> >> http://www.djangobook.com/en/2.0/chapter04.html >> >> >> >> remove all after to and place your code inside >> this >> >> >> >> 2012/11/25 Luisa Beck : >> >> > I'm in the process of going through the Django tutorials. >> >> > I'm having trouble with loading the index.html file into the >> browser. I >> >> > don't see a bulleted-list containing the "What's up" poll from >> Tutorial >> >> > 1. >> >> > Instead, I'm simply seeing the code that I pasted from green box >> (see >> >> > middle >> >> > of the page in the tutorial- I've also pasted it below). >> >> > The tutorial says "put the following code in that template". Does it >> >> > mean >> >> > that the code is supposed to go into the index.html file that I >> created? >> >> > >> >> > Thanks! >> >> > >> >> > {% if latest_poll_list %} >> >> > >> >> > {% for poll in latest_poll_list %} >> >> > {{ poll.question >> }} >> >> > {% endfor %} >> >> > >> >> > {% else %} >> >> > No polls are available. >> >> > {% endif %} >> >> > >> >> > -- >> >> > You received this message because you are subscribed to the Google >> >> > Groups >> >> > "Django users" group. >> >> > To view this discussion on the web visit >> >> > https://groups.google.com/d/msg/django-users/-/xwta_28JByIJ. >> >> > To post to this group, send email to django...@googlegroups.com. >> >> > To unsubscribe from this group, send email to >> >> > django-users...@googlegroups.com. >> >> > For more options, visit this group at >> >> > http://groups.google.com/group/django-users?hl=en. >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "Django users" group. >> > To view this discussion on the web visit >> > https://groups.google.com/d/msg/django-users/-/vZnRe-IPpLEJ. >> > >> > To post to this group, send email to django...@googlegroups.com. >> > To unsubscribe from this group, send email to >> > django-users...@googlegroups.com. >> > For more options, visit this group at >> > http://groups.google.com/group/django-users?hl=en. >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/-0o7jEx-H-4J. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Tutorial Part 3: loading index.html in browser
Mm, I don't have a TEMPLATE_CONTEXT_PROCESSORS section in the setting.py section. The setting.py file in my version of Django only includes TEMPLATE_DEBUG, TEMPLATE_LOADERS and TEMPLATE_DIRS. Could you specify what you mean? Thank you. On Sunday, November 25, 2012 8:16:00 AM UTC-5, Sergiy Khohlov wrote: > > looks like you have a problem with template processor > could you please check setting.py section TEMPLATE_CONTEXT_PROCESSORS > > 2012/11/25 Luisa Beck >: > > Thank you Xavier and Sergiy for your responses. > > > > To clarify: I put the following code (see below) into my index.html file > and > > got a page displaying the code (rather than a list) when I rendered it > in my > > browser by my local server: > > > > Could the problem have to do with my file system? I created a directory > > called 'templates' in the inner 'mysites' folder and created another > > directory within that called 'polls'. That's where I put the index.html > > file. And I also edited TEMPLATE_DIRS in my settings.py to tell Django > the > > absolute path to index.html. > > > > Any more thoughts about this? Thank you! > > > > > > > > > > Test > > > > > > > > > > {% if latest_poll_list %} > > > > > > > > {% for poll in latest_poll_list %} > > > > {{ poll.question > }} > > > > {% endfor %} > > > > > > > > {% else %} > > > > No polls are available. > > > > {% endif %} > > > > > > > > > > > > > > > > > > > > On Saturday, November 24, 2012 5:48:29 PM UTC-5, Sergiy Khohlov wrote: > >> > >> Near too. > >> > >> simple example of your fitst template: > >> http://www.djangobook.com/en/2.0/chapter04.html > >> > >> remove all after to and place your code inside > this > >> > >> 2012/11/25 Luisa Beck : > >> > I'm in the process of going through the Django tutorials. > >> > I'm having trouble with loading the index.html file into the browser. > I > >> > don't see a bulleted-list containing the "What's up" poll from > Tutorial > >> > 1. > >> > Instead, I'm simply seeing the code that I pasted from green box (see > >> > middle > >> > of the page in the tutorial- I've also pasted it below). > >> > The tutorial says "put the following code in that template". Does it > >> > mean > >> > that the code is supposed to go into the index.html file that I > created? > >> > > >> > Thanks! > >> > > >> > {% if latest_poll_list %} > >> > > >> > {% for poll in latest_poll_list %} > >> > {{ poll.question > }} > >> > {% endfor %} > >> > > >> > {% else %} > >> > No polls are available. > >> > {% endif %} > >> > > >> > -- > >> > You received this message because you are subscribed to the Google > >> > Groups > >> > "Django users" group. > >> > To view this discussion on the web visit > >> > https://groups.google.com/d/msg/django-users/-/xwta_28JByIJ. > >> > To post to this group, send email to django...@googlegroups.com. > >> > To unsubscribe from this group, send email to > >> > django-users...@googlegroups.com. > >> > For more options, visit this group at > >> > http://groups.google.com/group/django-users?hl=en. > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "Django users" group. > > To view this discussion on the web visit > > https://groups.google.com/d/msg/django-users/-/vZnRe-IPpLEJ. > > > > To post to this group, send email to > > django...@googlegroups.com. > > > To unsubscribe from this group, send email to > > django-users...@googlegroups.com . > > For more options, visit this group at > > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/UTLN4SU6L6sJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Tutorial Part 3: loading index.html in browser
Thank you Xavier and Sergiy for your responses. To clarify: I put the following code (see below) into my index.html file and got a page displaying the code (rather than a list) when I rendered it in my browser by my local server: Could the problem have to do with my file system? I created a directory called 'templates' in the inner 'mysites' folder and created another directory within that called 'polls'. That's where I put the index.html file. And I also edited TEMPLATE_DIRS<https://docs.djangoproject.com/en/1.4/ref/settings/#std:setting-TEMPLATE_DIRS> in my settings.py to tell Django the absolute path to index.html. Any more thoughts about this? Thank you! Test {% if latest_poll_list %} {% for poll in latest_poll_list %} {{ poll.question }} {% endfor %} {% else %} No polls are available. {% endif %} On Saturday, November 24, 2012 5:48:29 PM UTC-5, Sergiy Khohlov wrote: > > Near too. > > simple example of your fitst template: > http://www.djangobook.com/en/2.0/chapter04.html > > remove all after to and place your code inside this > > 2012/11/25 Luisa Beck >: > > I'm in the process of going through the Django tutorials. > > I'm having trouble with loading the index.html file into the browser. I > > don't see a bulleted-list containing the "What's up" poll from Tutorial > 1. > > Instead, I'm simply seeing the code that I pasted from green box (see > middle > > of the page in the tutorial- I've also pasted it below). > > The tutorial says "put the following code in that template". Does it > mean > > that the code is supposed to go into the index.html file that I created? > > > > Thanks! > > > > {% if latest_poll_list %} > > > > {% for poll in latest_poll_list %} > > {{ poll.question > }} > > {% endfor %} > > > > {% else %} > > No polls are available. > > {% endif %} > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "Django users" group. > > To view this discussion on the web visit > > https://groups.google.com/d/msg/django-users/-/xwta_28JByIJ. > > To post to this group, send email to > > django...@googlegroups.com. > > > To unsubscribe from this group, send email to > > django-users...@googlegroups.com . > > For more options, visit this group at > > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/vZnRe-IPpLEJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Tutorial Part 3: loading index.html in browser
I'm in the process of going through the Django tutorials. I'm having trouble with loading the index.html file into the browser. I don't see a bulleted-list containing the "What's up" poll from Tutorial 1. Instead, I'm simply seeing the code that I pasted from green box (see middle of the page in the tutorial- I've also pasted it below). The tutorial says "put the following code in that template". Does it mean that the code is supposed to go into the index.html file that I created? Thanks! {% if latest_poll_list %} {% for poll in latest_poll_list %} {{ poll.question }} {% endfor %} {% else %} No polls are available.{% endif %} -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/xwta_28JByIJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Understanding virtual environment paths
Hi Javier, That's super helpful. Thank you! Just to make sure I'm understanding correctly: You write "there's nothing to block you from accessing anything outside the environment. just the defaults are set up so you have to intentionally do it, not by accident." So in other words, the virtual environments let me temporarily change my default settings. And when I step out of the virtual environment, the system's default settings are used instead. But say I create a virtual environment and install a script that depends on another script that I haven't included in the virtual environment. That leads me to an error because the script can't be found in that virtual environment. Why doesn't the interpreter then look outside of my virtual environment? Or do I need to specify this in the interpreter's path somewhere? Thanks! On Thursday, November 22, 2012 9:28:38 AM UTC-5, Javier Guerra wrote: > > On Wed, Nov 21, 2012 at 7:30 PM, Luisa Beck > > wrote: > > (I'm imagining the virtual environment like a sandbox around my project. > I > > can play with the things I put into the sandbox.) So when I place a file > > outside of that, can I still access it when my virtual environment is > > active? > > the 'sandboxing' of the virtual environment is not like chroot or a > virtual machine: > > - it's only about what python code you use, not about what that code > can do. the whole machine's resources are still accessible: the whole > filesystem(s), RAM, network, etc. it's just a different Python > installation that doesn't conflict with what you already have, or with > other virtualenvs. > > - it's not about security, but about reducing mistakes. there's > nothing to block you from accessing anything outside the environment. > just the defaults are set up so you have to intentionally do it, not > by accident. > > -- > Javier > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/ki4N_3FcZOUJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Understanding virtual environment paths
I have a question about virtual environments: Say I've activated a virtual environment. I'm working with SQlite3 (already installed on my Mac 10.6.8) and I save a .db file outside of my project directory. If I save the path outside the project directory, will I still have access to it when I'm in the virtual environment? (I'm imagining the virtual environment like a sandbox around my project. I can play with the things I put into the sandbox.) So when I place a file outside of that, can I still access it when my virtual environment is active? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/MdQuwsP-lB8J. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
syncing sqlite3 for Django tutorial
I'm starting the Django tutorials and have virtual environments and django installed. I'm working on a Mac 10.6.8, which has sqlite3 already installed. I'm working inside a virtual environment. I changed the settings.py file to: ENGINE -- 'django.db.backends.sqlite3' I left the NAME -- in the settings.py file blank (i.e. '') because the tutorial said "If the file doesn't exist, it will automatically be created when you synchronize the database for the first time." But when I run python manage.py syncdb, I get the following error: django.core.exceptions.ImproperlyConfigured: Please fill out the database NAME in the settings module before using the database. Why isn't my file automatically created? Or what do I need to do to solve this problem? Thank you! -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/nzkQeK5eKf4J. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: need help with postgres installation and set-up for doing tutorials
Thank you for your thoughts! I have a few follow-up questions: *The reason that I’m trying to figure out postgres is that I’m helping some folks with a development project and they’re using postgres. I’m trying to do the tutorial with that so that I can get familiar with postgres and the pgAdmin III interface. And also with how Django, Python and Postgres work together (your explanation has been very helpful with that). Regarding your explanations: I have a bash “Terminal” and an SQL Shell. I also have virtual environments in a folder ~/Sites/django_test (i.e. when I tell the bash Terminal to “activate” this folder, it puts me in a an (env)). However ,when I run “python manage.py runserver" at the bash Terminal command line, I get an error message saying “can't open file 'manage.py': [Errno 2] No such file or directory”. Even when I run the command in the (env), I get the error message: /Library/Frameworks/Python.framework/Versions/3.2/Resources/Python.app/Contents/MacOS/Python: can't open file 'manage.py': [Errno 2] No such file or directory (Which I presume is telling me that the path is still set on an incorrect version of Python (3.2), even though I want to use version 2.7 and trashed the 3.2 version from my system. ) I think that there are a few gaps in my understanding here: - I don’t understand the difference between typing in commands into my bash Terminal versus my SQL shell - Is running “python manage.py runserver” the same as running Python programs with an IDE like IDLE? - How and where do I adjust your $PATH environment variable so that the correct python occurs first on the path? - I think that I installed the correct Python version into the virtual environment using pip install. Why am I still receiving a “No such file or directory” error? - Why does Python version 3.2 still appear in the path indicated by my error message is I trashed it? If you could help me with these questions, or simply list links with any tutorials that explain this, that would be much appreciated. Or perhaps you know how I can access ‘freenode’ so that I can ask in the discussion forum? Thanks!* Also, I'm having trouble entering freenode because it says that " #Django Cannot >> join channel (+r) - you need to be identified with services" >> >> And lastly, if someone could forward me a tutorial about how the >> databases, python files, >> virtual environments and Django work together (I am new to all of these) >> that would be much appreciated! >> >> Thanks in advance! >> Luisa >> >> >> I'm no Mac expert, but I'll offer a couple of thoughts. > > First, you shouldn't need to solve both the PostgreSQL installation issue > and learning Django at the same time. sqlite3 is adequate to the tutorial, > and is built in to modern pythons (e.g.; 2.7), and I presume that's true on > the Mac as well. > > Django is written in Python, which requires no pre-compilation, but must > be run with a python interpreter, e.g.; "python manage.py runserver" at the > command line. The tutorial is written with the assumption that you will be > running it from the command line. If you have more than one python > installed on your system, you can specify which one to use by including the > path on the command line, such as "~/bin/python manage.py runserver", or > you can adjust your $PATH environment variable so that the correct python > occurs first on the path. This last is what virtualenv does: the activate > code (which you must "source", not run, e.g.; "source > ~/venvs/djtutorial/bin/activate") adjusts the PATH (and prompt) of the > shell that sources it so that the virtualenv's python is found first*, and > defines a "deactivate" shell function that will undo the changes (exiting > the shell is just as good - i.e., this will not last across a reboot, you > must activate each new shell - command line window - that you start to work > on this project). Python figures out where you ran it from, and searches > from there for it's libraries, and finds first those associated with the > virtualenv, e.g. "~/venvs/djtutorial/lib/python2.7/". This means that you > can install things there (e.g.; by using "pip install ..." from a shell > that has been activated for that virtualenv) and they won't effect your > base python installation. > > [ * Perhaps not commonly understood, you don't need to activate if you > specify the path to the correct python, e.g.; > "~/venvs/djtutorial/bin/python manage.py runserver", so it is easy to > create a shell script or even an alias that does your most common stuff. > For example, you might make a copy of manage.py, maybe called "manage", add > a first line with the magic incantation: > > #!/absolute/path/to/the/correct/python > > Then make that file executable ("chmod a+x manage") and you will be able > to do "./manage runserver", etc., whether or not you have activated in the > current shell. (I speci
need help with postgres installation and set-up for doing tutorials
Hi, I'm new to web development and I'm trying to get my mac set up for doing the tutorials. I installed postgres and pgAdmin III and set it up on the default port (5433). I created a test database. Now when I try to open it on the local server, I get an error message: 'ERROR: column "datconfig" does not exist LINE1:...b.dattablespace AS spcoid, spcname, datallowconn, dataconfig,... Here is what I did before I closed pgAdmin and then reopened it: - Installation: The Setup told me that an existing data directory was found at /Library/PostgreSQL/9.2/data set to use port 5433. - I loaded an .sql file that I wanted to test (I saved it on my desktop and loaded it into the database from there). Also, I'm having trouble entering freenode because it says that " #Django Cannot join channel (+r) - you need to be identified with services" And lastly, if someone could forward me a tutorial about how the databases, python files, virtual environments and Django work together (I am new to all of these) that would be much appreciated! Thanks in advance! Luisa -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/p3ad_ybxZl8J. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
initializing virtualenvwrapper on Mac (10.6.8) for Django
I want to use Django and create virtual environments. I don't quite understand the initializing steps documentation on the virtualenvwrapper website. I've installed virtualenvwrapper in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages. I've already installed XCode, Homebrew and Posgres as well. The documentation tells me to: $ export WORKON_HOME=~/Envs $ mkdir -p $WORKON_HOME $ source /usr/local/bin/virtualenvwrapper.sh $ mkvirtualenv env1` I'm especially confused about the first line. Is it telling me that I need to *create* a project folder named 'WORKON_HOME' and export it into another folder called 'Envs'? (I've searched for both folders on my mac but didn't find them). And then in the second line I make another directory 'WORKON_HOME'? If you have suggestions or links to better explanations/tutorials, I would greatly appreciate it. Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/QxJcDlsxBdEJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.