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
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
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"
= [
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
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
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
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
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
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/$
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
>
>
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*
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
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
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
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
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
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
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
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
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
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
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
ಇಂಡ್
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
>
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
24 matches
Mail list logo