Multiple themes with their own url.py and views.py

2022-01-10 Thread 'Rahul Chauhan' via Django users
Hi All, I am trying to build a blog based system in Django similar to WordPress. Where each theme folder will have it's own set of url.py, view.py, stylesheet etc. So far, I have been able to implement multiple themes, but all of theme rely on a single common url.py & views.py. Wh

Re: best practice: using only url.py from the main project

2020-04-12 Thread Chucky Mada Madamombe
Hi yes it's bad practice.this is why: The best point is to be able to reuse applications in different projects. There will be problem if you are saving all your URLs in the “projecturl.py” file. So best practice is to create an “url.py” per application and to include it in your main pro

best practice: using only url.py from the main project

2020-04-12 Thread Esther Camilo
Most of the tutorial recomends you create a url.py inside your app (as polls for example). Is it a bad practice using only url.py from the main project folder? Thanks for your attention. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Invalid syntax in url.py

2015-08-07 Thread Sylvain James
= [ url(r'^$', newsletter_views.home, name="home") # url(r'^admin/', include(admin.site.urls)), Hope it helps, Sylvain Le jeudi 6 août 2015 21:57:45 UTC+2, Matthew Yankey a écrit : > > this is the url.py > > > from django.conf.u

Re: Invalid syntax in url.py

2015-08-06 Thread Javier Guerra Giraldez
On Thu, Aug 6, 2015 at 2:03 PM, Matthew Yankey wrote: > url(r'^', .newsletter.views.home, name="home") .newsletter looks like import syntax, but this isn't valid in an expression at the top include a line like from .newsletter.views import home and then the url entry becomes url(r'^', ho

Invalid syntax in url.py

2015-08-06 Thread Matthew Yankey
this is the url.py from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ url(r'^', .newsletter.views.home, name="home") => this is the line 20 # url(r'^admin/', include(admin.site.urls)), error be

Re: Many links to one function in url.py

2014-05-21 Thread Lucas Klassmann
Hi Jun, The diference is: With \w only one character is allowed and not allow null, like this: /link/a/ With \w+ one or more characters is allowed and not allow null, like this: /link/mypage/ With \w* zero or more is allowed and also null argument, like this: /link// (Note the double slash, dja

Re: Many links to one function in url.py

2014-05-21 Thread François Schiettecatte
inks to one function but I would like to identify >> which link that come from. >> >> url.py looks >> >>(r'^link1/$', 'project.apps.main.get'), >>(r'^link2/$', 'project.apps.main.get'), >>(r'^lin

Re: Many links to one function in url.py

2014-05-21 Thread Tom Evans
On Wed, May 21, 2014 at 3:40 AM, Jun Tanaka wrote: > Hi there. > > > I hope to know the solution for the following: > say, there are several links to one function but I would like to identify > which link that come from. > > url.py looks > > (r'^link1/$&#

Re: Many links to one function in url.py

2014-05-21 Thread Jun Tanaka
Hi Lucas, Thank you very much. It seems that I can use this. Hopefully, I can ask you one more question. \d+ is for a int. is \w+ for a string? What does \w* mean? I saw it. Jun 2014年5月21日水曜日 11時49分46秒 UTC+9 Lucas Klassmann: > > Hi Jun, > > Try this: > > Put only this line in urls.py > >

Re: Many links to one function in url.py

2014-05-20 Thread Lucas Klassmann
Hi Jun, Try this: Put only this line in urls.py url(r'^link/(?P<*identifier*>\d+)/$', 'project.apps.main.get'), And in your view, add *identifier* as argument in function: def get(request, *identifier*): ... return HttpResponse(u'Identifier %d' % *identifier*) Note that *identifier*

Many links to one function in url.py

2014-05-20 Thread Jun Tanaka
Hi there. I hope to know the solution for the following: say, there are several links to one function but I would like to identify which link that come from. url.py looks (r'^link1/$', 'project.apps.main.get'), (r'^link2/$', 'pro

Re: Newbie, hierarchical models, url.py problem

2009-05-30 Thread adelaide_mike
Thanks Gabriel. I think it would be good if the tutorial included a three-level hierarchy sowing how to handle the url.py and views.py for the third layer. Anyway, I now understandone step more. Thanks and regards On May 31, 11:46 am, Gabriel wrote: > adelaide_mike escri

Re: Newbie, hierarchical models, url.py problem

2009-05-30 Thread Gabriel
adelaide_mike escribió: > urlpatterns = patterns('whasite.wha.views', > > (r'^address/{{street.id}}/(?P\d+)/$', 'select_event'), > (r'^address/(?P\d+)/$', 'select_property'), > (r'^address/$', 'select_street'), > (r'^$', 'address'), > ) (r'^address/(?P\d+)/(?P\d+)/$', 's

Newbie, hierarchical models, url.py problem

2009-05-30 Thread adelaide_mike
I have model classes Suburb, Street ,Property and Event. Each has a name , a foreign key to the model above, and the id provided by default. In the admin everything is fine. The template address.html has a search field and returns a startswith query that generates streets. Clicking a line in t

Re: Need help with tutorial url.py not matching using IIS and isapi_wsgi

2008-05-02 Thread jmDesktop
On May 2, 12:25 pm, jmDesktop <[EMAIL PROTECTED]> wrote: > On May 2, 10:18 am, jmDesktop <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, I am using isapi_wsgi with django, or trying to: > > >http://code.google.com/p/isapi-wsgi/wiki/IntegrationWithDjango > > > I have my script exactly like the example

Re: Need help with tutorial url.py not matching using IIS and isapi_wsgi

2008-05-02 Thread jmDesktop
On May 2, 10:18 am, jmDesktop <[EMAIL PROTECTED]> wrote: > Hi, I am using isapi_wsgi with django, or trying to: > > http://code.google.com/p/isapi-wsgi/wiki/IntegrationWithDjango > > I have my script exactly like the example.  I created the same > directories on my pc.  I believe django is "trying

Need help with tutorial url.py not matching using IIS and isapi_wsgi

2008-05-02 Thread jmDesktop
Hi, I am using isapi_wsgi with django, or trying to: http://code.google.com/p/isapi-wsgi/wiki/IntegrationWithDjango I have my script exactly like the example. I created the same directories on my pc. I believe django is "trying" to work, but it cannot resolve the URLs. I have done syncdb and

Re: url.py

2007-12-18 Thread mike
Marty...you de man!! On Dec 18, 1:20 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > It looks like you've configured the built-in admin at "/admin/", and > you're defining your custom URLs *later* in the list of URL patterns. > This means that the admin's URL configuration will see > "/ad

Re: url.py

2007-12-18 Thread Marty Alchin
It looks like you've configured the built-in admin at "/admin/", and you're defining your custom URLs *later* in the list of URL patterns. This means that the admin's URL configuration will see "/admin/display/12/" and assume it's supposed to route to its view for an app named "display" and a mode

url.py

2007-12-18 Thread mike
I am trying to get the url.py to display my template based on the 'id' of my model, but I cannot get this to work, any help would be appreciated. I have tried the url below and also my view is below, I would like to be able to visit /admin/display//id-number and see the ticket corres

Re: url.py parsing and mod_python, recurent problem.

2006-02-22 Thread Kenneth Gonsalves
On Wednesday 22 Feb 2006 1:33 pm, coulix wrote: >  # Uncomment this for admin: > (r'^admin/', include('django.contrib.admin.urls.admin')), (r'^mywebsite/admin/', include('django.contrib.admin.urls.admin')), -- regards kg http://www.livejournal.com/users/lawgon tally ho! http://avsap.org.in ಇಂಡ್

Re: url.py parsing and mod_python, recurent problem.

2006-02-22 Thread [EMAIL PROTECTED]
dd django conf > > SetHandler python-program > PythonHandler django.core.handlers.modpython > PythonPath sys.path+[r'/home/greg/django'] > SetEnv DJANGO_SETTINGS_MODULE cefinban.settings > PythonDebug On >

url.py parsing and mod_python, recurent problem.

2006-02-22 Thread coulix
o "of my project cefinban. url.py : # Uncomment this for admin: (r'^admin/', include('django.contrib.admin.urls.admin')), Now let's try access, http://192.168.1.13/mywebsite/admin/ Request Method: GET Request URL:http://192.168.1.13/mywebsite/admin/ U