Re: urls.py and default values...

2012-10-21 Thread Tomas Ehrlich
Hello, you need to make 'year' argument optional: def student_reports(request, year=None): year = year or datetime.date.today().year ... Another option could be passing extra option to you view function:

urls.py and default values...

2012-10-21 Thread Lachlan Musicman
Hola, I have data across multiple years. I want to run reports on a per year basis, so I have in my urls: url(r'^students/reports/(?P\d{4})/$', student_reports, name='student_reports'), etc. What I want to know though, is how to have this in the urls: url(r'^students/reports/$',

Re: Problem with the urls.py "unexpected end of pattern"

2012-08-18 Thread Rafael Romero Carmona
2012/8/17 Alexis Roda > I think that this is not the problem because I can access to volunters >> without problems. I have problems only with admin, organizers and events >> paths. >> > > So you have problems with all the urls past the first with a wrong

Re: Problem with the urls.py "unexpected end of pattern"

2012-08-17 Thread Alexis Roda
I think that this is not the problem because I can access to volunters without problems. I have problems only with admin, organizers and events paths. So you have problems with all the urls past the first with a wrong pattern. ~$ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC

Re: Problem with the urls.py "unexpected end of pattern"

2012-08-17 Thread Rafael Romero Carmona
2012/8/17 Alexis Roda <alexis.roda.villalo...@gmail.com> > Al 17/08/12 17:42, En/na Rafael Romero Carmona ha escrit: > > Hi, I'm learning Django and I have problems with the urls.py. I show you >> how that's writed: >> >> from django.conf.urls import

Re: Problem with the urls.py "unexpected end of pattern"

2012-08-17 Thread Alexis Roda
Al 17/08/12 17:42, En/na Rafael Romero Carmona ha escrit: Hi, I'm learning Django and I have problems with the urls.py. I show you how that's writed: from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('users.views

Problem with the urls.py "unexpected end of pattern"

2012-08-17 Thread Rafael Romero Carmona
Hi, I'm learning Django and I have problems with the urls.py. I show you how that's writed: from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('users.views', url(r'^volunters/$', 'voluntersindex'), url(r

Re: decorating an include in urls.py

2012-07-06 Thread Alexandr Aibulatov
Try to use this library https://github.com/jeffkistler/django-decorator-include 2012/7/6 Gelonida N : > I'd like to decorate all views in an include. > > Let's take for example: > > urlpatterns = patterns('', > url(r'^decorated_admin/', include(admin.site.urls)), > ) > > >

decorating an include in urls.py

2012-07-06 Thread Gelonida N
I'd like to decorate all views in an include. Let's take for example: urlpatterns = patterns('', url(r'^decorated_admin/', include(admin.site.urls)), ) Is there any way to decorate all views in admin.site.urls I was looking for a syntax similiar to: urlpatterns = patterns('',

Re: How to access HttpRequest from urls.py in Django? or better way.

2012-06-10 Thread Jinxing Ding
Sorry! I using request.GET['category'] 在 Jun 10, 2012,9:19 PM, Daniel Roseman 写道: > On Sunday, 10 June 2012 05:21:08 UTC+1, losingle wrote: > > news_info_dict should be > news_info_dict = { > 'queryset':News.published.filter(category= > request.category).all(), > 'date_field':

Re: How to access HttpRequest from urls.py in Django? or better way.

2012-06-10 Thread Daniel Roseman
On Sunday, 10 June 2012 05:21:08 UTC+1, losingle wrote: > > > news_info_dict should be > news_info_dict = { > 'queryset':News.published.filter(category= > request.category).all(), > 'date_field': 'pub_date', > } > > I couldn't find a way to access the HttpRequest (request) object >

How to access HttpRequest from urls.py in Django? or better way.

2012-06-10 Thread losingle
I need access HttpRequest from urls.py news_info_dict = { 'queryset': News.published.all(), 'date_field': 'pub_date', } news_info_month_dict = { 'queryset': News.published.all(), 'date_field': 'pub_date', 'month_format': '%m', } urlpatterns = patterns

Re: Different urls.py file for different apps

2012-05-22 Thread Andy McKay
Use include to pull in values from other apps inside your urls.py https://docs.djangoproject.com/en/dev/topics/http/urls/#including-other-urlconfs On Tue, May 22, 2012 at 11:49 AM, siddharth56660 <siddharth.ghumr...@gmail.com> wrote: > Hi, > I am developing an ERP system which is vas

Re: Different urls.py file for different apps

2012-05-22 Thread Alexandr Aibulatov
you could include urls of app into your_app/urls.py urlpatterns = patterns('', (r'your_app/', include('your_apps.urls')) (r'your_app2/', include('your_apps2.urls')) ) 2012/5/22 siddharth56660

Different urls.py file for different apps

2012-05-22 Thread siddharth56660
Hi, I am developing an ERP system which is vast and covers many modules. After developing each module i create another app for second module by " django-admin.py startapp myapp2 " This is perfectly working fine. But my urls.py is growing very fast and has crossed more than 5000 lines wit

Re: cannot locate syntax error in urls.py

2012-04-23 Thread r0pewalker
! > > I've formed a reduced set of correct views and templates for the > > purpose of testing but i cannot step through this: > > > > > > Exception Type: SyntaxError at /comunali/ > > Exception Value: invalid syntax (urls.py, line 23) > > > which I confir

Re: cannot locate syntax error in urls.py

2012-04-23 Thread Daniel Roseman
xError at /comunali/ > Exception Value: invalid syntax (urls.py, line 23) > > > which I confirmed by trying to import urls py fin the shell. > I'm quite puzzled by the fact that line 23 in my file is not a line of > code, since urls.py has only 22 lines. I looked through it in search

Re: cache decorators in urls.py error

2012-04-13 Thread Phang Mulianto
t; to be run. Here you are trying to decorate the return value of the > function, without passing it any arguments - which is probably one of > the 'different errors'. > > > but different error comes out... > > i don't know whats wrong.. anyone can help point it out..

Re: cache decorators in urls.py error

2012-04-13 Thread Tom Evans
whats wrong.. anyone can help point it out.. > If you want to decorate a view in your urls.py, you must import the view function, and then refer to the view function by name. Like in the example I linked you to previously… https://docs.djangoproject.com/en/1.3/topics/cache/#specifying-per-

Re: cache decorators in urls.py error

2012-04-13 Thread Phang Mulianto
it out.. On Tue, Apr 10, 2012 at 9:42 PM, Tom Evans <tevans...@googlemail.com> wrote: > On Sat, Apr 7, 2012 at 3:53 PM, Phang Mulianto <braveh...@gmail.com> > wrote: > > Hi, > > > > i have my apps and try to use cache decorator in url.py but got error.

Re: cache decorators in urls.py error

2012-04-10 Thread Tom Evans
On Sat, Apr 7, 2012 at 3:53 PM, Phang Mulianto <braveh...@gmail.com> wrote: > Hi, > > i have my apps and try to use cache decorator in url.py but got error. > > Here are the urls.py > > from django.views.decorators.cache import cache_page > > urlpatterns = pa

cache decorators in urls.py error

2012-04-07 Thread Phang Mulianto
Hi, i have my apps and try to use cache decorator in url.py but got error. Here are the urls.py from django.views.decorators.cache import cache_page urlpatterns = patterns('article.views', #(r'^$','index', { 'template_name': 'blog/public_list.html'}, 'index'), (r'^$',cache_page('index

Re: urls.py and login forms

2012-03-09 Thread Scott Macri
.py. >> >> Request Method: GET >> Request URL:    http://localhost:8000/hcp/login/ >> Django Version: 1.3.1 >> Exception Type: ViewDoesNotExist >> Exception Value: >> Tried views in module django.contrib.auth. Error was: >> 'django.contrib.auth.vie

Re: urls.py and login forms

2012-03-09 Thread Tom Evans
gt; in my settings.py. > > Request Method: GET > Request URL:    http://localhost:8000/hcp/login/ > Django Version: 1.3.1 > Exception Type: ViewDoesNotExist > Exception Value: > Tried views in module django.contrib.auth. Error was: > 'django.contrib.auth.views' is not a call

Re: urls.py and login forms

2012-03-09 Thread Scott Macri
helped. >> >> >> Regards, >> //Vikalp >> >> On Fri, Mar 9, 2012 at 7:23 AM, Scott Macri <scottma...@gmail.com> wrote: >>> >>> How am I supposed to configure access to the built in django login and >>> password forms

Re: urls.py and login forms

2012-03-09 Thread Scott Macri
https://docs.djangoproject.com/en/dev/topics/http/urls/#the-view-prefix > > Hope this helped. > > > Regards, > //Vikalp > > On Fri, Mar 9, 2012 at 7:23 AM, Scott Macri <scottma...@gmail.com> wrote: >> >> How am I supposed to configure access to the built

Re: urls.py and login forms

2012-03-08 Thread vikalp sahni
re access to the built in django login and > password forms after changing my urls.py settings? > I've setup the main project urls.py file like so: > url(r'^myapp/',include('myapp.urls')), > > I now have a urls.py file under myapp/urls.py setup similar to the > following: > urlpatterns = p

urls.py and login forms

2012-03-08 Thread Scott Macri
How am I supposed to configure access to the built in django login and password forms after changing my urls.py settings? I've setup the main project urls.py file like so: url(r'^myapp/',include('myapp.urls')), I now have a urls.py file under myapp/urls.py setup similar to the following

Re: Beginner's question about urls.py

2012-02-22 Thread shartha
hathttp://chekonam.info/claimsthat uWSGI doesn't > > know about the project--presumably the one under /admin. > > > Is this relevant? > > > On 02/22/2012 10:45 PM, shartha wrote: > > > > The file I posted above is the actual file on my server. I don't think > >

Re: Beginner's question about urls.py

2012-02-22 Thread shartha
gt; > > The file I posted above is the actual file on my server. I don't think > > > I have any conflicts in the urls.py. What are the databases that are > > > created when you add 'django.contrib.admin' to your INSTALLED_APP and > > > sync your database? &

Re: Beginner's question about urls.py

2012-02-22 Thread shartha
10:45 PM, shartha wrote: > > > > > > > > > The file I posted above is the actual file on my server. I don't think > > I have any conflicts in the urls.py. What are the databases that are > > created when you add 'django.contrib.admin' to your INSTALLED_APP and

Re: Beginner's question about urls.py

2012-02-22 Thread Jonathan Paugh
What puzzles me is that http://chekonam.info/ claims that uWSGI doesn't know about the project--presumably the one under /admin. Is this relevant? On 02/22/2012 10:45 PM, shartha wrote: > The file I posted above is the actual file on my server. I don't think > I have any conflicts in the u

Re: Beginner's question about urls.py

2012-02-22 Thread shartha
The file I posted above is the actual file on my server. I don't think I have any conflicts in the urls.py. What are the databases that are created when you add 'django.contrib.admin' to your INSTALLED_APP and sync your database? On Feb 22, 9:27 pm, Stanwin Siow <stanwin.kts...@gmail.com>

Re: Beginner's question about urls.py

2012-02-22 Thread Stanwin Siow
Check your urls.py there could be conflicting statements: http://stackoverflow.com/questions/4174610/django-admin-page-not-found-at-admin Check out the stackoverflow question Best Regards, Stanwin Siow On Feb 23, 2012, at 11:20 AM, shartha wrote: > I have "django.contrib.admi

Re: Beginner's question about urls.py

2012-02-22 Thread shartha
> files a little bit and it sometimes gets confusing for a novice person > > like me. Here is my question: > > > This is the urls.py on the server: > > === > > from django.conf.urls.defaults import patterns, include, url

Re: Beginner's question about urls.py

2012-02-22 Thread Stanwin Siow
jango for me. But the problem is they have modified the > files a little bit and it sometimes gets confusing for a novice person > like me. Here is my question: > > This is the urls.py on the server: > === > from django.conf.urls.defaults import pa

Beginner's question about urls.py

2012-02-22 Thread shartha
Hello, I am trying to deploy a simple django site. The host I have chosen installed django for me. But the problem is they have modified the files a little bit and it sometimes gets confusing for a novice person like me. Here is my question: This is the urls.py on the server

Re: {% url 'admin:jsi18n' as jsi18nurl %} error as urls.py

2012-01-06 Thread Brett Epps
I don't see an obvious problem with your urls.py file. Have you tried checking that you're not mixing tabs and spaces in that file's whitespace? Brett On 1/6/12 8:48 AM, "MikeKJ" <mike.jo...@paston.co.uk> wrote: >This is probably an oldie and I remember coming across it

{% url 'admin:jsi18n' as jsi18nurl %} error as urls.py

2012-01-06 Thread MikeKJ
Exception Type: TemplateSyntaxError Exception Value: Caught SyntaxError while rendering: invalid syntax (urls.py, line 7) Exception Location: /home/paston2/webapps/nortons/lib/python2.7/ django/utils/importlib.py in import_module, line 35 Python Executable: /usr/local/bin/python

Re: urls.py?

2011-12-09 Thread Jim Byrnes
On 12/09/2011 03:06 AM, Reinout van Rees wrote: On 09-12-11 01:28, Jim Byrnes wrote: from django.conf.urls.defaults import * from mysite import views from mysite.views import hello, current_datetime, hours_ahead, display_meta from django.contrib import admin from mysite.contact import views

Re: urls.py?

2011-12-09 Thread Reinout van Rees
On 09-12-11 02:23, Mario Gudelj wrote: I think you have to add "from views import *" to urls.py and make sure you have a method called contact in your view. Doing a "star import" is almost always a bad idea. You don't know what you're importing. And you can override v

Re: urls.py?

2011-12-09 Thread Reinout van Rees
On 09-12-11 01:28, Jim Byrnes wrote: from django.conf.urls.defaults import * from mysite import views from mysite.views import hello, current_datetime, hours_ahead, display_meta from django.contrib import admin from mysite.contact import views from mysite.books import views admin.autodiscover()

Re: urls.py?

2011-12-08 Thread Jim Byrnes
On 12/08/2011 07:23 PM, Mario Gudelj wrote: I think you have to add "from views import *" to urls.py and make sure you have a method called contact in your view. Cheers, Thanks, but I added "from views import *" and there definitely is a method called contact in /mysite/c

Re: urls.py?

2011-12-08 Thread Mario Gudelj
I think you have to add "from views import *" to urls.py and make sure you have a method called contact in your view. Cheers, On 09/12/2011 12:10 PM, "Jim Byrnes" <jf_byr...@comcast.net> wrote: > I am trying to learning django by working my way through The Definitiv

urls.py?

2011-12-08 Thread Jim Byrnes
File "/home/jfb/MyProgs/djcode/mysite/urls.py", line 16, in (r'^contact/$',views.contact), AttributeError: 'module' object has no attribute 'contact' Here is urls.py: from django.conf.urls.defaults import * from mysite import views from mysite.views import hello, current_datetime, h

Re: urls.py matching

2011-10-11 Thread django-mike1
gt; > On Tue, Oct 11, 2011 at 12:51 PM, django-mike1 > <support.desk@gmail.com>wrote: > > > > > > > > > > > I am creating a Django Front end for a PDNS Server and having a > > problem with my urls.py url matching. > > > This line >

Re: urls.py matching

2011-10-11 Thread django-mike1
.\w-]+ > > Use this site to try your regex:http://regexpal.com/ > > []'s > > On Tue, Oct 11, 2011 at 12:51 PM, django-mike1 > <support.desk@gmail.com>wrote: > > > > > > > > > > > I am creating a Django Front end for a PDNS Server and

Re: urls.py matching

2011-10-11 Thread Flavia Missi
a > problem with my urls.py url matching. > > This line > > (r'^zones/(?P[.\w]+)/$', zones) > > will match any url like /domain.com/ /domain.net/ domain.org/ etc. > just fine > > what changes would I need to make to this line to also match domains > such as below?

urls.py matching

2011-10-11 Thread django-mike1
I am creating a Django Front end for a PDNS Server and having a problem with my urls.py url matching. This line (r'^zones/(?P[.\w]+)/$', zones) will match any url like /domain.com/ /domain.net/ domain.org/ etc. just fine what changes would I need to make to this line to also match domains

Re: how to match a url in urls.py

2011-10-03 Thread Bjarni Rúnar Einarsson
The complaint about invalid ranges probably stems from the fact that you have '-' in the middle of your character lists. If you do not mean [a-z], you should always make the dash the last character, like so: [az-]. The expression as pasted is requesting ranges [w-:] in a couple of places, which

Re: how to match a url in urls.py

2011-10-03 Thread Javier Guerra Giraldez
On Mon, Oct 3, 2011 at 9:56 AM, He Jibo wrote: >    (r'^pagerank/(?P([/w-]+/.)+[/w-]+.([^a-z])(/[/w-: > ./?%&=]*)?|[a-zA-Z/-/.][/w-]+.([^a-z])(/[/w-: ./?%&=]*)?)', > 'ueseo.pagerank.views.CheckPageRankStatic'),# a static page version of page > rank check is that a copy/paste?

Re: how to match a url in urls.py

2011-10-03 Thread Brian Mehrman
would help me to decipher the problem. I hope this helps, Brian On Mon, Oct 3, 2011 at 9:56 AM, He Jibo <hej...@gmail.com> wrote: > Hello, > > I want to match a url in urls.py. Can you teach me how to do it? Thanks.I > have tried the following two versions. But as long

how to match a url in urls.py

2011-10-03 Thread He Jibo
Hello, I want to match a url in urls.py. Can you teach me how to do it? Thanks.I have tried the following two versions. But as long as I put a . (dot) in the regular expression, it gives me a "bad character range" error. (r'^pagerank/(?P*([/w-]+/.)+[/w-]+.([^a-z])(/[/w-: ./?%&

Re: a little help with the urls.py and views.py

2011-07-22 Thread Andre Terra
for an entry that has all of the specified > > authors, what would be the best way to go about doing that. > > > > urls.py and views.py code examples would be appreciated. Thanks. > > -- > You received this message because you are subscribed to the Google Groups

Re: a little help with the urls.py and views.py

2011-07-22 Thread Derick Felsman
(not necessarily a list but an unspecified number of different > authors) and then query for an entry that has all of the specified > authors, what would be the best way to go about doing that. > > urls.py and views.py code examples would be appreciated.  Thanks. -- You received thi

a little help with the urls.py and views.py

2011-07-22 Thread Derick Felsman
of the specified authors, what would be the best way to go about doing that. urls.py and views.py code examples would be appreciated. Thanks. -- 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@google

Re: WMD-editor: Where's wmd/urls.py?

2011-06-22 Thread Micky Hulse
On Wed, Jun 22, 2011 at 1:20 AM, Kevin Renskers <i...@bolhoed.net> wrote: > I think it's an error in the documentation. Since there are no views, it's > probable that there are no urls as well. Everything works perfectly if I ignore the part about the urls.py file. :D Thanks Kevin!

Re: WMD-editor: Where's wmd/urls.py?

2011-06-22 Thread Micky Hulse
On Wed, Jun 22, 2011 at 1:20 AM, Kevin Renskers wrote: > I think it's an error in the documentation. Since there are no views, it's > probable that there are no urls as well. Hehe, that's a great point! I did not think about looking inside the views.py file. :( Thanks Kevin!

Re: WMD-editor: Where's wmd/urls.py?

2011-06-22 Thread Kevin Renskers
I think it's an error in the documentation. Since there are no views, it's probable that there are no urls as well. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

WMD-editor: Where's wmd/urls.py?

2011-06-21 Thread Micky Hulse
Anyone here using django-wmd-editor? https://github.com/jpartogi/django-wmd-editor If so, could you tell me what its url.py file is supposed to look like? :D Maybe I am missing something obvious here, but wmd/urls.py does not exist... What am I missing? Thanks so much! Micky -- You received

Re: Problems with running Hello world app, urls.py probably ignored

2011-04-25 Thread Jacob
lts. > I have read all known "my first app in django" tutorials, but my test > app just isn't working. > > I have project called "john". In it's directory I have app package > "dashboard" containing init, models, tests and views. Moreover, in > proj

Re: Problems with running Hello world app, urls.py probably ignored

2011-04-23 Thread Rafael Durán Castañeda
I'm not sure, I'm quite new in django, but I think you need to include dashboard in INSTALLED_APPS and looking your urls.py in order to see hello view you need to type http://127.0.0.1:8000/john/hello On 23/04/11 21:57, Honza Javorek wrote: Hello guys, I have searched to solve

Problems with running Hello world app, urls.py probably ignored

2011-04-23 Thread Honza Javorek
init, models, tests and views. Moreover, in project directory "john" are init, manage, settings and urls files. My urls.py: from django.conf.urls.defaults import patterns, include, url urlpatterns = patterns('john', (r'^$', 'dashboard.views.hello'), (r'^hello/$', 'dashboard

Re: admin interface and urls.py regex issue

2011-04-03 Thread xiao_haozi
On Apr 3, 11:58 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Sun, Apr 3, 2011 at 11:35 PM, xiao_haozi <matthew.ma...@gmail.com> wrote: > > I'm running into some perplexing regex issues in urls.py and getting > > to my admin section. > > It worked before

Re: admin interface and urls.py regex issue

2011-04-03 Thread Karen Tracey
On Sun, Apr 3, 2011 at 11:35 PM, xiao_haozi <matthew.ma...@gmail.com> wrote: > I'm running into some perplexing regex issues in urls.py and getting > to my admin section. > It worked before but now that I have another view added in, anything > beyond the index regex is getting

admin interface and urls.py regex issue

2011-04-03 Thread xiao_haozi
I'm running into some perplexing regex issues in urls.py and getting to my admin section. It worked before but now that I have another view added in, anything beyond the index regex is getting fed into the "url/" section rather than admin: I've included my urls.py section and the 500 er

Re: Repetition in urls.py

2011-03-24 Thread Ryan Osborn
Thanks guys, works great On Mar 24, 7:54 pm, akaariai <akaar...@gmail.com> wrote: > On Mar 24, 9:40 pm, Ryan Osborn <ryan.osbor...@gmail.com> wrote: > > > > > > > > > > > Hi, > > > I am using django 1.3 and have the following in my

Re: Repetition in urls.py

2011-03-24 Thread akaariai
On Mar 24, 9:40 pm, Ryan Osborn <ryan.osbor...@gmail.com> wrote: > Hi, > > I am using django 1.3 and have the following in my urls.py for a > blogging application: > > urlpatterns = patterns('', >     url(r'$', > ArchiveIndexView.as_view(model=Entry,date_field='cr

Re: Repetition in urls.py

2011-03-24 Thread Ian Clelland
On Thu, Mar 24, 2011 at 12:40 PM, Ryan Osborn wrote: > I was just wondering if there was a simple way to condense this as > with django 1.2 I could add all this in to a dictionary like: > > info_dict = {'model': Entry, 'date_field': 'created', 'paginate_by': > 10} Can

Repetition in urls.py

2011-03-24 Thread Ryan Osborn
Hi, I am using django 1.3 and have the following in my urls.py for a blogging application: urlpatterns = patterns('', url(r'$', ArchiveIndexView.as_view(model=Entry,date_field='created',paginate_by=10), name='blog_archive_index'), url(r'today/$', TodayArchiveView.as_view(model=Entry

Re: urls.py usage

2011-03-02 Thread Vladimir
Thank you very much!!! It works! I followed "Python Web Development with Django. J.Forcier, P.Bissex, W.Chun" (I used russian edition). They instruct readers to include registration statement in model.py: Chapter 2 (my reverse translation from russian into English): Open file

Re: urls.py usage

2011-03-01 Thread Daniel Roseman
On Monday, February 28, 2011 7:29:17 PM UTC, Vladimir wrote: > > I only followed manuals! Please, Mr. Daniel, give me more details! Well I don't know which manuals you followed. The online documentation (http://docs.djangoproject.com/en/1.2/ref/contrib/admin/#modeladmin-objects) states this

Re: urls.py usage

2011-02-28 Thread Vladimir
I only followed manuals! Please, Mr. Daniel, give me more details! -- 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

Re: urls.py usage

2011-02-28 Thread Daniel Roseman
On Monday, February 28, 2011 4:26:57 PM UTC, Vladimir wrote: > > > > That you have duplicate registration of one model in your admin.py > > somewhere (I believe, I may be wrong). > There is no admin.py file in this project. > Well, why not? That is the cause of your problem. Putting admin

Re: urls.py usage

2011-02-28 Thread Vladimir
>   That you have duplicate registration of one model in your admin.py > somewhere (I believe, I may be wrong). There is no admin.py file in this project. Model.py file contains: from django.db import models from django.contrib import admin class BlogPost(models.Model): title =

Re: urls.py usage

2011-02-28 Thread Jirka Vejrazka
> AlreadyRegistered at /blog/ > The model BlogPost is already registered That you have duplicate registration of one model in your admin.py somewhere (I believe, I may be wrong). Cheers Jirka -- You received this message because you are subscribed to the Google Groups "Django users"

Re: urls.py usage

2011-02-28 Thread Vladimir
What does this message (it appears after web browser entering) means: AlreadyRegistered at /blog/ The model BlogPost is already registered ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

urls.py usage

2011-02-27 Thread Vladimir
ject level cmsproject/urls.py: from django.contrib import admin from django.conf.urls.defaults import * admin.autodiscover() urlpatterns = patterns('', # Uncomment the next line to enable the admin: # (r'^admin/', include(admin.site.urls)), # url(r'^admin/(.*)', admin.site.root), ur

Re: urls.py and views.generic issue

2011-02-23 Thread Andrew Petaisto
included the working main urls.py and blog urls.py. Antti *main urls.py* 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'^anttipetaisto/', include

RE: urls.py and views.generic issue

2011-02-22 Thread Chris Matthews
s.com [mailto:django-users@googlegroups.com] On Behalf Of Antti Sent: 23 February 2011 06:56 To: Django users Subject: Re: urls.py and views.generic issue Thanks jnns for the response. I tried adding the backslash but it still doesn't match. Would I need to put a different character

Re: urls.py and views.generic issue

2011-02-22 Thread Antti
Hello Chris, thanks for the response. I don't know where that space is coming from. When I type in http://127.0.0.1:8000/blog/ a page loads using the list.html template as it should. Would that mean that the space might be fine because the main urls.py is calling the blog urls.py? I have a main

Re: urls.py and views.generic issue

2011-02-22 Thread Antti
/127.0.0.1:8000/blog/ then the page loads using the list.html template as it should. I have included the main urls.py as well as the blog urls.py Thanks for responding! Antti main urls.py from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from djan

RE: urls.py and views.generic issue

2011-02-20 Thread Chris Matthews
Subject: Re: urls.py and views.generic issue Hi Antti, the url patterns in the tutorial are not correct. The regular expressions are not using character classes but merely plain characters. ^blog/ ^(?Pd{4})/$ should be ^blog/ ^(?P\d{4})/$ Mind the backslash in \d{4}. This way we're

Re: urls.py and views.generic issue

2011-02-19 Thread jnns
and not for a sequence of four "d"s. Regards, jnns On Feb 20, 12:57 am, Antti <ahpetai...@gmail.com> wrote: > The problem: > > I can't seem to get most of my urls that I type in my browser to math > a url in my urls.py file.  I am currently doing Web Monkey's Blog > Tutorial (h

urls.py and views.generic issue

2011-02-19 Thread Antti
The problem: I can't seem to get most of my urls that I type in my browser to math a url in my urls.py file. I am currently doing Web Monkey's Blog Tutorial (http://www.webmonkey.com/2010/02/Get_Started_With_Django/) To date everything has worked but when I try to use the urls from the blog

Re: request in urls.py

2011-02-18 Thread Burhan
urls.py doesn't do anything with GET or POST requests, its just regular expression to method mapping. So you can pass whatever you want to the link, and they will all work. For example, in your urls.py you have: (r'^logout$', logout_user) All these requests will be passed to your logout_user

request in urls.py

2011-02-18 Thread galago
Is it possible to pass request.path in urls.py? I want to pass it as next parameter in logout declaration. -- 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 unsubs

LOGIN_REDIRECT_URL from urls.py?

2011-02-17 Thread galago
Is it possible to make value of LOGIN_REDIRECT_URL from my urls.py? I don't wan't to hardcode it. I don't want to pass next in my url. Maybe there is another way to redirect to my reverse('index')? -- You received this message because you are subscribed to the Google Groups "Django

Re: matching a domain name in urls.py

2011-02-03 Thread Tom Evans
2011/2/3 Łukasz Rekucki : > On 3 February 2011 17:52, Tom Evans wrote: >> >> . matches any character, not just dot. Your class '[.\w]+' will >> actually match anything and everything. I think you want '[\.\w]'. >> > > Not if used in a character class:

Re: matching a domain name in urls.py

2011-02-03 Thread Łukasz Rekucki
> On Thu, Feb 3, 2011 at 4:50 PM, mike171562 wrote: >> I think i got it now with >> >> (r'^zones/(?P[.\w]+)/$', get_domain) Depending on what you plan to do with the matched string later, you may want to limit it to 256 characters or incorporate some more checks,

Re: matching a domain name in urls.py

2011-02-03 Thread Cal Leeming [Simplicity Media Ltd]
* of time! > > Cal > > > On Thu, Feb 3, 2011 at 4:44 PM, mike171562 <support.desk@gmail.com>wrote: > >> I am building an app that passes a domain name to urls.py like so "/ >> sites/domain.com/' >> >> but I cannot get my urls.py to match the 'doma

Re: matching a domain name in urls.py

2011-02-03 Thread Cal Leeming [Simplicity Media Ltd]
Hi Mike, May I suggest RegexBuddy for anything regex related in the future, it have saved me a *lot* of time! Cal On Thu, Feb 3, 2011 at 4:44 PM, mike171562 <support.desk@gmail.com>wrote: > I am building an app that passes a domain name to urls.py like so "/ >

Re: matching a domain name in urls.py

2011-02-03 Thread Tom Evans
On Thu, Feb 3, 2011 at 4:50 PM, mike171562 wrote: > I think i got it now with > > (r'^zones/(?P[.\w]+)/$', get_domain) > > . matches any character, not just dot. Your class '[.\w]+' will actually match anything and everything. I think you want '[\.\w]'. Cheers Tom

Re: matching a domain name in urls.py

2011-02-03 Thread Jirka Vejrazka
> I am building an app that passes a domain name to urls.py like so   "/ > sites/domain.com/' > > but I cannot get my urls.py to match the 'domain.com'  it only seems > to match if i just use domain without the dot > > I have tried > >    (r'^zones/^[^/]+/', g

Re: matching a domain name in urls.py

2011-02-03 Thread mike171562
I think i got it now with (r'^zones/(?P[.\w]+)/$', get_domain) On Feb 3, 10:44 am, mike171562 <support.desk@gmail.com> wrote: > I am building an app that passes a domain name to urls.py like so   "/ > sites/domain.com/' > > but I cannot get my urls.py to match th

matching a domain name in urls.py

2011-02-03 Thread mike171562
I am building an app that passes a domain name to urls.py like so "/ sites/domain.com/' but I cannot get my urls.py to match the 'domain.com' it only seems to match if i just use domain without the dot I have tried (r'^zones/^[^/]+/', get_domain), (r'^zones/(?P\w+)/', get_d

Re: urls.py independient from application path

2010-12-19 Thread Javier Guerra Giraldez
On Sat, Dec 18, 2010 at 3:16 PM, JMVmedia.es <jmvme...@gmail.com> wrote: > In the urls.py of one application i decided to use this idea. > > > import os > APP_DIR = os.path.dirname(os.path.abspath(__file__)) > APP_NAME = os.basemane(APP_PATH) > > I'm not sure abou

urls.py independient from application path

2010-12-18 Thread JMVmedia.es
In the urls.py of one application i decided to use this idea. import os APP_DIR = os.path.dirname(os.path.abspath(__file__)) APP_NAME = os.basemane(APP_PATH) I'm not sure about the performance implications of using this os import here. ¿Do you use any similar idea to make applications

Re: How to launch home page from urls.py?

2010-10-13 Thread Chris Boyd
Thank you Rob! > {'template': 'index.html'} But in that case I have to use Django template file, while my home page is built with Pyjamas (http://pyjs.org/). Can I use a Django urlpattern to launch any HTML file, not just Django tempalte file? Thank you, Chris On Wed, Oct 13, 2010 at 9:46

Re: How to launch home page from urls.py?

2010-10-13 Thread Robbington
Hi Chris, I use urlpatterns = patterns('django.views.generic.simple', (r'^$', 'direct_to_template',{'template': 'index.html'}), ) Where template is the defined template directory in my settings.py Seems a better way to me, as then if you want to expand your site you can just incorperate

<    1   2   3   4   5   >