Re: Django way to design this model
Point 4 above is a little ambiguous: >4. Move the queries you've created to a view that renders results to >a template. If you start doing this by accepting GET parameters and >displaying the search results through the template, you can get the >query functionality working and test it by changing the URL before >creating the actual search form. Can anyone help out? thanks in advance. Divesh On Jul 9, 1:58 pm, Divesh Gidwani <dagidw...@gmail.com> wrote: > Thanks so much for all the advice.. Yes, you are right, a lot of it > sounds like rubbish, and i'm just lost! Yes, I am going to finish up > the tutorial today, and read up on the documentation. > > Thanks so much for your help. I will surely keep you updated on how > things go! > > Much appreciated once again. > > -Divesh > > On Jul 9, 1:45 pm, Friðrik Már Jónsson <frid...@pyth.net> wrote: > > > > > HiDivesh, > > > > I have this model that I want to design on Django. I have already > > > created the mysql side of it, and the mysql database is ready. Also, i > > > have loaded mysqldb and i think it works. > > > It sounds like you've created something with MySQL and imported it to > > a database that's used by Django. This is not the same as creating > > actual models in your `models.py` file, which is required if you want > > to make use of Django's querying methods. > > > > (Species 1 & 2). And then you write a view, that will do the searching > > > according parameters (Tolerance, pagination, species 1&2) > > > > So I have to create something like the website above on Django. Was > > > just wondering if there was any easy way of doing this.. I don't fully > > > understand Django yet, and am not sure if have to make a form or > > > what? I'm really confused. > > > > Basically what I want to do is create that type of a site, with only > > > one species, and then have it such that when you click the radio > > > button next to one species, it shows you what that species corresponds > > > to in the mysql database. > > > You need to take this one step at a time. You seem to be mixing model > > creation (defining the data structure) with writing views and > > templates (the radio button, pagination, criteria). > > > 1. Design the model[1] to the specification that is your current > > MySQL schema. > > 2. Fill the model with some test data[2]. > > 3. Use the shell to try to retrieve the objects[3] according to the > > criteria you would get from your user through the view. > > 4. Move the queries you've created to a view that renders results to > > a template. If you start doing this by accepting GET parameters and > > displaying the search results through the template, you can get the > > query functionality working and test it by changing the URL before > > creating the actual search form. > > 5. Create the search form, probably using `django.forms`[4] and use > > a `ChoiceField(widget=RadioSelect, choices=...)`[5] to present the > > options to users. > > > If this is all sounding like nonsese to you, it probably means you > > should spend some time reading up on Django's excellent documentation, > > and if you haven't already, finish the tutorial. > > > Regards, > > Friðrik Már > > > [1]http://docs.djangoproject.com/en/dev/topics/db/models/ > > > > [2]http://docs.djangoproject.com/en/dev/topics/db/queries/#creating-objects > > > > [3]http://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-ob... > > [4]http://docs.djangoproject.com/en/dev/topics/forms/ > > > > [5]http://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. 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: Creating radio button search app
Also, what kind of views do I need? I'm really confused about that part. If somebody has snippets of their code that they may have written, it'll be great to see how its done. Thanks. Divesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. 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 -~--~~~~--~~--~--~---
Creating radio button search app
I have this site that I want to design on Django. I have already created the mysql side of it, and the mysql database is ready. Also, i have loaded mysqldb it works too. This is the site I have to re-design on Django: http://gomezlab.bme.unc.edu:8080/~kdauria/search.php so far i have this in my models.py: class Groups(models.Model): group_id = models.IntegerField(primary_key=True) school = models.CharField(max_length=60, db_column='School', blank=True) # Field name made lowercase. position = models.CharField(max_length=60, db_column='Position', blank=True) # Field name made lowercase. class Meta: db_table = u'groups' def __unicode__(self): return self.position class Persongroups(models.Model): pg_id = models.IntegerField(primary_key=True, db_column='pg_ID') # Field name made lowercase. person_id = models.IntegerField(null=True, blank=True) group_id = models.IntegerField(null=True, blank=True) class Meta: db_table = u'persongroups' def __unicode__(self): return unicode(self.pg_id) class Persons(models.Model): person_id = models.IntegerField(primary_key=True) firstname = models.CharField(max_length=60, db_column='Firstname', blank=True) # Field name made lowercase. lastname = models.CharField(max_length=60, db_column='Lastname', blank=True) # Field name made lowercase. class Meta: db_table = u'persons' def __unicode__(self): return self.firstname How can I get those radio button like search fields? How to bring up the search? Any suggestions, or resources would be helpful. Thanks in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. 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 2 - Template Dirs
Hey Ben, Thanks for your help. It worked, but it changed the entire format of the screen. I don't know what's up next, but I'll find out shortly! :) On Jun 30, 4:49 pm, Ben <ben.james.sm...@gmail.com> wrote: > Hey this might be a question I can answer - I'm a NKOTB too. > > The easiest way is to modify the "title" and "branding" blocks in the > base_site.html file. This would change the name for the admin across > the site, as far as I know. It should live in (in your case) /home/ > divesh/projects/myproject/templates/admin/base_site.html - looks like > you've already copied that file from the django site-packages > directory. > > -- > > {% extends "admin/base.html" %} > {% load i18n %} > > {% block title %}{{ title }} | {% trans 'Django site admin' %}{% > endblock %} > > {% block branding %} > {% trans 'Django administration' %} > {% endblock %} > > {% block nav-global %}{% endblock %} > > On Jun 30, 1:06 pm, Divesh Gidwani <dagidw...@gmail.com> wrote: > > > Okay, I have experimented with this for sometime, but for some reason > > the site is still showing 'Django Administration' on top. I open it > > with Text/Edit and changed the name. What exact files from the Django > > directory should i copy to my project one. > > > Thanks > > > On Jun 30, 1:12 pm, Divesh Gidwani <dagidw...@gmail.com> wrote: > > > > Now that I created the templates folder, should I take the base.html > > > and index.html files and paste them in this folder? > > > > That being done, how can I edit these files? Is there a particular > > > program to use? > > > > On Jun 30, 12:56 pm, Ahmet Emre Aladağ <aladage...@gmail.com> wrote: > > > > > On Tue, Jun 30, 2009 at 7:36 PM, Divesh Gidwani <dagidw...@gmail.com> > > > > wrote: > > > > > > So I have had a pretty smooth transition so far, but am now stuck when > > > > > at the end oftutorial2, it asks to specify my directory of tempaltes > > > > > in the settings.py file under the template_dirs tuple. > > > > > > Where are the templates i created stored? > > > > > You can create a directory called templates inside your project [not > > > > app] > > > > folder and give its fullpath such as: > > > > /home/divesh/projects/myproject/templates > > > > > An example structure: > > > > -myproject > > > > --myapp > > > > views.py > > > > models.py > > > > urls.py > > > > --templates > > > > index.html > > > > base.html > > > > myapp > > > > --results.html > > > > --output.html > > > > --urls.py > > > > --settings.py > > > > --manage.py > > > > --__init__.py- Hide quoted text - > > > - Show quoted text - > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. 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: Django way to design this model
Thanks so much for all the advice.. Yes, you are right, a lot of it sounds like rubbish, and i'm just lost! Yes, I am going to finish up the tutorial today, and read up on the documentation. Thanks so much for your help. I will surely keep you updated on how things go! Much appreciated once again. -Divesh On Jul 9, 1:45 pm, Friðrik Már Jónssonwrote: > Hi Divesh, > > > I have this model that I want to design on Django. I have already > > created the mysql side of it, and the mysql database is ready. Also, i > > have loaded mysqldb and i think it works. > > It sounds like you've created something with MySQL and imported it to > a database that's used by Django. This is not the same as creating > actual models in your `models.py` file, which is required if you want > to make use of Django's querying methods. > > > (Species 1 & 2). And then you write a view, that will do the searching > > according parameters (Tolerance, pagination, species 1&2) > > > So I have to create something like the website above on Django. Was > > just wondering if there was any easy way of doing this.. I don't fully > > understand Django yet, and am not sure if have to make a form or > > what? I'm really confused. > > > Basically what I want to do is create that type of a site, with only > > one species, and then have it such that when you click the radio > > button next to one species, it shows you what that species corresponds > > to in the mysql database. > > You need to take this one step at a time. You seem to be mixing model > creation (defining the data structure) with writing views and > templates (the radio button, pagination, criteria). > > 1. Design the model[1] to the specification that is your current > MySQL schema. > 2. Fill the model with some test data[2]. > 3. Use the shell to try to retrieve the objects[3] according to the > criteria you would get from your user through the view. > 4. Move the queries you've created to a view that renders results to > a template. If you start doing this by accepting GET parameters and > displaying the search results through the template, you can get the > query functionality working and test it by changing the URL before > creating the actual search form. > 5. Create the search form, probably using `django.forms`[4] and use > a `ChoiceField(widget=RadioSelect, choices=...)`[5] to present the > options to users. > > If this is all sounding like nonsese to you, it probably means you > should spend some time reading up on Django's excellent documentation, > and if you haven't already, finish the tutorial. > > Regards, > Friðrik Már > > [1]http://docs.djangoproject.com/en/dev/topics/db/models/ > [2]http://docs.djangoproject.com/en/dev/topics/db/queries/#creating-objects > [3]http://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-ob... > [4]http://docs.djangoproject.com/en/dev/topics/forms/ > [5]http://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. 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: Django way to design this model
>Don't know if i understand you right, but you have to create two models (Species 1 & 2). And then you write a view, that will do the searching according parameters (Tolerance, pagination, species 1&2) So I have to create something like the website above on Django. Was just wondering if there was any easy way of doing this.. I don't fully understand Django yet, and am not sure if have to make a form or what? I'm really confused. Basically what I want to do is create that type of a site, with only one species, and then have it such that when you click the radio button next to one species, it shows you what that species corresponds to in the mysql database. Thanks for your help guys. On Jul 9, 1:32 am, urukay <radovan.be...@gmail.com> wrote: > Don't know if i understand you right, but you have to create two models > (Species 1 & 2). And then you write a view, that will do the searching > according parameters (Tolerance, pagination, species 1&2) > > But more details would help definetely. > > R. > > > > Divesh Gidwani wrote: > > > Hey, > > > Newbie toDjango, and have just finished part 2 of the tutorial on the > > website, and need to speed up with work in the office. > > > I have this model that I want to design onDjango. I have already > > created the mysql side of it, and the mysql database is ready. Also, i > > have loaded mysqldb and i think it works. > > > This is the model I have to follow: > > >http://gomezlab.bme.unc.edu:8080/~kdauria/search.php > > > How can I get those radio button like search fields? How to bring up > > the search? > > > Any suggestions, or resources would be helpful. > > > Thanks in advance! > > -- > View this message in > context:http://www.nabble.com/Django-way-to-design-this-model-tp24397321p2440... > Sent from thedjango-users mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. 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 -~--~~~~--~~--~--~---
Django way to design this model
Hey, Newbie to Django, and have just finished part 2 of the tutorial on the website, and need to speed up with work in the office. I have this model that I want to design on Django. I have already created the mysql side of it, and the mysql database is ready. Also, i have loaded mysqldb and i think it works. This is the model I have to follow: http://gomezlab.bme.unc.edu:8080/~kdauria/search.php How can I get those radio button like search fields? How to bring up the search? Any suggestions, or resources would be helpful. Thanks in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. 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: Admin page set up.
Kamal, This is of the django project website. I was having similar difficulties when I typed it up, but if copy and paste from this, and then match it to your code, you will see minor flaws (from my experience.) Hope this helps best, Divesh On Jul 2, 12:45 pm, patrickkwrote: > I´d recommend this > (obviously):http://docs.djangoproject.com/en/dev/ref/contrib/admin/ > > regards, > patrick > > On 2 Jul., 18:01, kamal sharma wrote: > > > Actually I was reading from this link and doing what it is mentioned here. > > >http://www.djangobook.com/en/1.0/chapter06/ > > > Do we have other better doc for admin page set up? > > > On Thu, Jul 2, 2009 at 9:19 PM, patrickk wrote: > > > > your admin-url has NO relation whatsoever to the name of your project > > > or app. > > > > IMHO, you should try to understand how the url-configuration works in > > > the first place. you should also read the django-docs carefully ... > > > > I´m sorry that I can´t help more, but I think with reading (and > > > understanding) the docs and a little bit of "try and error" you´ll be > > > there very soon. from remembering my first steps with django I´d say: > > > don´t become desperate, it´ll all be reasonable very soon. > > > > regards, > > > patrick > > > > On 2 Jul., 17:40, kamal sharma wrote: > > > > Thanks Patrick for your quick response. Please let me know if this info > > > > helps you to understand. > > > > > I am calling my project 'gweb' and my app 'web'? And my model > > > > code is in file in 'gweb/web/models.py'. So in that case my admin url > > > > should be > > > > >http://server-name:1020/gweb/admin/ > > > > > Please correct if I am wrong. > > > > > I access my site in this way and it is working. > > > > >http://server-name:1020/gweb/default/ > > > > > I have tried all these options in urls.py > > > > > # Uncomment this for admin: > > > > # (r'^admin/', include('django.contrib.admin.urls')), > > > > # (r'^admin/', include(admin.site.urls)), > > > > (r'^admin/(.*)', admin.site.root), > > > > > But not able to find what I am missing. How do I get the admin login > > > page? > > > > > Thanks, > > > > Damudar > > > > > On Thu, Jul 2, 2009 at 8:38 PM, patrickk wrote: > > > > > > sorry, but I can´t help with apache-stuff. your django-setup seems > > > > > correct to me ... I´ve never seen port 1020 used for the dev-server, > > > > > but I´m not doing server-setups at all, so it might be very common. > > > > > > you could try a simple direct_to_template in order to check whether > > > > > (or not) apache is serving your site correctly. > > > > > > regards, > > > > > patrick > > > > > > On 2 Jul., 16:56, kamal sharma wrote: > > > > > > Hi Patrick, > > > > > > > I am using apache web server. After doing following changes I tried > > > to > > > > > > access this URLhttp://server-name:1020/admin/andgotfollowingerror. > > > > > > > The requested URL /admin/ was not found on this server > > > > > > > Thanks, > > > > > > Pankaj > > > > > > > On Thu, Jul 2, 2009 at 8:00 PM, patrickk > > > wrote: > > > > > > > > you have defined it in urls.py ... with > > > > > > > (r'^admin/(.*)', admin.site.root), > > > > > > > your URL is > > > > > > >http://server-name:1020/admin/ > > > > > > > > after adding 'django.contrib.admin' to your INSTALLED_APPS > > > > > > > you have sync the database, of course: > > > > > > > python mangage.py syncdb > > > > > > > > regards, > > > > > > > patrick > > > > > > > > On 2 Jul., 15:13, kamal sharma wrote: > > > > > > > > Hi, > > > > > > > > > I am trying to setup admin page. > > > > > > > > > Django version: alpha version of 1.1 > > > > > > > > Python Version: Python 2.5.2 > > > > > > > > > I have followed the following steps to set up admin page. > > > > > >http://docs.djangoproject.com/en/dev/ref/contrib/admin/#ref-contrib-a. > > > .. > > > > > > > > > 1. settings.py: > > > > > > > > > # Add 'django.contrib.admin' to INSTALLED_APPS. > > > > > > > > > 2. web/admin.py: > > > > > > > > > from django.contrib import admin > > > > > > > > from gnatsweb.web.models import table > > > > > > > > > admin.site.register(table) > > > > > > > > > 3. urls.py: > > > > > > > > > from django.contrib import admin > > > > > > > > > admin.autodiscover() > > > > > > > > > # Uncomment this for admin: > > > > > > > > (r'^admin/', include('django.contrib.admin.urls')), > > > > > > > > > in place of this I have used this also but still not working. > > > > > > > > > (r'^admin/(.*)', admin.site.root), > > > > > > > > > My application URL to access the site is > > > > > > > > "http://server-name:1020/web/database/ > > > > > > > > > In this case what will be my admin site URL? > > > > > > > > > Is this correct?http://server-name:1020/web/admin/ > > > > > > > > > Please help me to know, what I am missing here? > > > >
Re: Tutorial 2 - Template Dirs
Okay, I have experimented with this for sometime, but for some reason the site is still showing 'Django Administration' on top. I open it with Text/Edit and changed the name. What exact files from the Django directory should i copy to my project one. Thanks On Jun 30, 1:12 pm, Divesh Gidwani <dagidw...@gmail.com> wrote: > Now that I created the templates folder, should I take the base.html > and index.html files and paste them in this folder? > > That being done, how can I edit these files? Is there a particular > program to use? > > On Jun 30, 12:56 pm, Ahmet Emre Aladağ <aladage...@gmail.com> wrote: > > > On Tue, Jun 30, 2009 at 7:36 PM, Divesh Gidwani <dagidw...@gmail.com> wrote: > > > > So I have had a pretty smooth transition so far, but am now stuck when > > > at the end of tutorial 2, it asks to specify my directory of tempaltes > > > in the settings.py file under the template_dirs tuple. > > > > Where are the templates i created stored? > > > You can create a directory called templates inside your project [not app] > > folder and give its fullpath such as: > > /home/divesh/projects/myproject/templates > > > An example structure: > > -myproject > > --myapp > > views.py > > models.py > > urls.py > > --templates > > index.html > > base.html > > myapp > > --results.html > > --output.html > > --urls.py > > --settings.py > > --manage.py > > --__init__.py --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. 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 2 - Template Dirs
Now that I created the templates folder, should I take the base.html and index.html files and paste them in this folder? That being done, how can I edit these files? Is there a particular program to use? On Jun 30, 12:56 pm, Ahmet Emre Aladağ <aladage...@gmail.com> wrote: > On Tue, Jun 30, 2009 at 7:36 PM, Divesh Gidwani <dagidw...@gmail.com> wrote: > > > So I have had a pretty smooth transition so far, but am now stuck when > > at the end of tutorial 2, it asks to specify my directory of tempaltes > > in the settings.py file under the template_dirs tuple. > > > Where are the templates i created stored? > > You can create a directory called templates inside your project [not app] > folder and give its fullpath such as: > /home/divesh/projects/myproject/templates > > An example structure: > -myproject > --myapp > views.py > models.py > urls.py > --templates > index.html > base.html > myapp > --results.html > --output.html > --urls.py > --settings.py > --manage.py > --__init__.py --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. 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 2 - Template Dirs
Thanks for that. I'll try it now and see how that goes. On Jun 30, 12:56 pm, Ahmet Emre Aladağ <aladage...@gmail.com> wrote: > On Tue, Jun 30, 2009 at 7:36 PM, Divesh Gidwani <dagidw...@gmail.com> wrote: > > > So I have had a pretty smooth transition so far, but am now stuck when > > at the end of tutorial 2, it asks to specify my directory of tempaltes > > in the settings.py file under the template_dirs tuple. > > > Where are the templates i created stored? > > You can create a directory called templates inside your project [not app] > folder and give its fullpath such as: > /home/divesh/projects/myproject/templates > > An example structure: > -myproject > --myapp > views.py > models.py > urls.py > --templates > index.html > base.html > myapp > --results.html > --output.html > --urls.py > --settings.py > --manage.py > --__init__.py --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. 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 2 - Template Dirs
So I have had a pretty smooth transition so far, but am now stuck when at the end of tutorial 2, it asks to specify my directory of tempaltes in the settings.py file under the template_dirs tuple. Where are the templates i created stored? Sorry, Newbie at Django, but looking to help out in the near future! Thanks, Divesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. 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: Activate Admin Tutorial 2
On Jun 25, 4:49 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Thu, Jun 25, 2009 at 4:29 PM, Divesh Gidwani <dagidw...@gmail.com> wrote: > > > Hey Guys, > > > I'm new to Django and computer programming and am currently following > > a tutorial from this website: > > >http://www.zabada.com/tutorials/django-quick-start.php > > I wouldn't recommend that. From a brief look that tutorial is based on > Django 0.96, and unless you are supporting old code written for that level > you do not want to be starting out with such an old base. There are many > things that changed between 0.96 and 1.0 in a backwards-incompatible way > (one of which has led to your problem), you are much better off starting > with 1.0. Why not use the official Django tutorial, which is updated to > match the current code (or you can use the version for the latest official > release, depending on what level of Django you decide to go with): > > http://docs.djangoproject.com/en/dev/intro/tutorial01/#intro-tutorial01 > > Karen Hey Karen, Thanks a ton for that. I used the activate admin way suggested in tutorial 2 of the djangoproject website and that worked just great! I'm sure this Django journey is not going to be very smooth, and i'll keep having questions along the way, especially since this is my first ever programming experience. Thanks to people like you, it becomes a lot easier. Thanks once again. Divesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. 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 -~--~~~~--~~--~--~---
Activate Admin Tutorial 2
Hey Guys, I'm new to Django and computer programming and am currently following a tutorial from this website: http://www.zabada.com/tutorials/django-quick-start.php Everything worked until the activate the admin part. My code to activate the admin in my records/urls.py is as such: from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^djangotest/', include('djangotest.foo.urls')), # Uncomment the admin/doc line below and add 'django.contrib.admindocs' # to INSTALLED_APPS to enable admin documentation: (r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: (r'^admin/', include(divesh.records.urls)), ) I don't exactly know what i'm doing, so please help. divesh is my username records is the app This is the error i get when i try to runserver and display the page. I am a newbie. Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/core/servers/basehttp.py", line 278, in run self.result = application(self.environ, self.start_response) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/core/servers/basehttp.py", line 636, in __call__ return self.application(environ, start_response) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/core/handlers/wsgi.py", line 241, in __call__ response = self.get_response(request) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/core/handlers/base.py", line 73, in get_response response = middleware_method(request) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/middleware/common.py", line 56, in process_request if (not _is_valid_path(request.path_info) and File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/middleware/common.py", line 142, in _is_valid_path urlresolvers.resolve(path) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/core/urlresolvers.py", line 257, in resolve return get_resolver(urlconf).resolve(path) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/core/urlresolvers.py", line 184, in resolve for pattern in self.url_patterns: File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/core/urlresolvers.py", line 208, in _get_url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/core/urlresolvers.py", line 203, in _get_urlconf_module self._urlconf_module = import_module(self.urlconf_name) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/Users/Divesh/djangotest/djangotest/../djangotest/urls.py", line 16, in (r'^admin/', include(divesh.records.urls)), NameError: name 'divesh' is not defined Please help. thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. 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 -~--~~~~--~~--~--~---
Webapp creation: Check box like search to find common ground
Hey Guys, This is my first post on this group. I'm a newbie to Django, Python and mysql, and have recently been asked by my boss to make a web page of a Database. What I have to do: Take the tables from the database(which is in mysql) and create a web application to show which groups belong to which. By that I mean say we have Two groups in a table : X and Y. In X we have numbers 1 - 20. In Y we have letters A - D. Now say 1,5,7 correspond to A and 1,9,15 correspond to B and 2,11,13 correspond to C and so on for D, I want to see what each selection in Y (when checked in a check box) has which numbers? Its an ongoing project, and will post more as I come across it. I hope this benefits other users out there too. Thanks in advance. Best, Divesh A Gidwani --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. 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 -~--~~~~--~~--~--~---