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:
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/$',
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
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
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
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
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
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)),
> )
>
>
>
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('',
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':
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
>
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
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
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
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
!
> > 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
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
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..
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-
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.
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
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
.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
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
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
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 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
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
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
> >
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?
&
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
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
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>
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
> 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
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
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
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
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
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
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
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()
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
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
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
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
>
.\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
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?
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
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
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?
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
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-:
./?%&
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
(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
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
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!
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!
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
> 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 =
> 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"
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
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
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
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
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
/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
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
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
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
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
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
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
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:
> 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,
* 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
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 "/
>
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
> 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
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
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
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
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
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
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
101 - 200 of 449 matches
Mail list logo