__init__.py in the new
directory3. Move the monster views.py into ./views renaming it to original.py
or something similar.4. Split original.py into as many useful individual views
files as desired - including separate utilities file(s) etc.5. In __init__.py
import each view used by your urls.py using
You are welcome
On Mon, Sep 18, 2023 at 6:00 PM 'Simon Connah' via Django users <
django-users@googlegroups.com> wrote:
> Thank you! That got it working!
>
> --- Original Message ---
> On Monday, September 18th, 2023 at 13:34, Asim Sulehria <
> de.asimha...@gmail.com> wrote:
>
> You can
Thank you! That got it working!
--- Original Message ---
On Monday, September 18th, 2023 at 13:34, Asim Sulehria
wrote:
> You can just directly declare an array of URL Patterns in a separate file and
> then import that file in the url files you want to make the main urls file
>
>
You can just directly declare an array of URL Patterns in a separate file
and then import that file in the url files you want to make the main urls
file
On Mon, Sep 18, 2023 at 5:28 PM 'Simon Connah' via Django users <
django-users@googlegroups.com> wrote:
> Hi,
>
> I have an app which has a lot
Hi,
I have an app which has a lot of views and URLs and keeping them in just one
file makes it really hard to manage because it is so long. I'd like to make a
views and URLs folder which will allow me to break up views and URLs into
different categories but I'm not sure what the best way to go
It's extremely basic error... File urls.py line 3 the import is invalid as
it say into the trace.
cretae??? Where is this function? I think "create" is the good function
name: canno't import name crétin from 'audio_api.views...
Le mardi 6 juin 2023 à 14:15:25 UTC+2, AKHIL KORE a écri
Nevermind. I managed to create the missing file myself.
On Monday, December 7, 2020 at 9:48:59 AM UTC-5 Julie Reier wrote:
> Hi! I'm following the tutorial at
> https://docs.djangoproject.com/en/3.1/intro/tutorial01/.
>
> When running the 'python manage.py startapp polls' command,
Good evening,
When u run the code python manage.py startapp, it wont create urls.py. You
have to create it in your every apps after run that command. You will only
have the urls.py file in your main app which has the settings.py.
Thank you.
On Mon, 7 Dec 2020 20:18 Julie Reier, wrote:
> Hi!
Hi! I'm following the tutorial
at https://docs.djangoproject.com/en/3.1/intro/tutorial01/.
When running the 'python manage.py startapp polls' command, the urls.py
file is generated in the top level directory, but not in the polls
directory. I even tried the tutorial a second time, naming
ile an old code in Django 1.4 Many things are deprecated. I
> manage to change some of them but I don't knwo how to go futher on the
> urls.py
>
> here is the old code
>
>
> *from django.conf.urls.defaults import *
> from django.conf import settings
>
> dynurls = patterns(
I try to compile an old code in Django 1.4 Many things are deprecated. I
manage to change some of them but I don't knwo how to go futher on the
urls.py
here is the old code
*from django.conf.urls.defaults import *
from django.conf import settings
dynurls = patterns('minesweepr.views
Sure.
Here is my urls.py
from django.conf.urls import url
from django.contrib import admin
from django.urls import path
from vr_reporting_app.views import HomeView
from vr_reporting_app.views import Local
from vr_reporting_app.views import User
from vr_reporting_app.views import School
ml page. i also have
a menu on that page that will load up other html pages.
>> however, when i add the path to urls.py and then the class def in views,
it fails. i know it's something simple, what am i missing.
>>
>> As I said, the dashboard.html works, i just want another me
I resolved this.
On Thursday, May 2, 2019 at 5:21:59 PM UTC-4, randmw...@gmail.com wrote:
>
> new to django. so i have an app that displays an html page. i also have a
> menu on that page that will load up other html pages.
> however, when i add the path to urls.py and then t
It does not, I changed the name, stil the same error
> On May 2, 2019, at 8:23 PM, Abishek Goda wrote:
>
>
> Hi,
>
>>
>> As I said, the dashboard.html works, i just want another menu option to load
>> the other html file. i have commented this out as it causes my app to break.
> So the
Hi,
>
> As I said, the dashboard.html works, i just want another menu option to load
> the other html file. i have commented this out as it causes my app to break.
So the issue is with the map url. Can you try to use a different name?
>
> #path('map/', Map.as_view(), name='map'),
pages.
however, when i add the path to urls.py and then the class def in views, it
fails. i know it's something simple, what am i missing.
As I said, the dashboard.html works, i just want another menu option to
load the other html file. i have commented this out as it causes my app to
break.
urls.py
new to django. so i have an app that displays an html page. i also have a
menu on that page that will load up other html pages.
however, when i add the path to urls.py and then the class def in views, it
fails. i know it's something simple, what am i missing.
As I said, the dashboard.html
other page
>> after 10 sec or 20 sec.
>> my 2nd problem is i dont know how to set (or) match the pattern in
>> [application]/urls.py
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe
ion
> when certain condition is met i have to redirect to another page after 10
> sec or 20 sec.
> my 2nd problem is i dont know how to set (or) match the pattern in
> [application]/urls.py
>
> --
> You received this message because you are subscribed to the Google Group
, now in that function
> when certain condition is met i have to redirect to another page after 10
> sec or 20 sec.
> my 2nd problem is i dont know how to set (or) match the pattern in
> [application]/urls.py
>
--
You received this message because you are subscribed to the G
Now my 1st problem is in views.py i have a function , now in that function
when certain condition is met i have to redirect to another page after 10
sec or 20 sec.
my 2nd problem is i dont know how to set (or) match the pattern in
[application]/urls.py
--
You received this message because you
urn paths
>From urls.py:
from . models import GetItemPaths
urlpatterns = GetItemPaths() + [
path('/to/some/other/views/'otherview.asView(), name='other_name'),
]
lørdag den 23. juni 2018 kl. 15.08.04 UTC+2 skrev Melvyn Sopacua:
>
> On zaterdag 23 juni 2018 14:30:08 CEST Mikkel K
On zaterdag 23 juni 2018 14:30:08 CEST Mikkel Kromann wrote:
> In models.py:
> def GetItemPaths():paths = [ ]
> for i in [ 'Model1', 'Model2', 'Model3' ]:
> p = path( i + '/list/', ItemListView.as_view(model=i), name=i +
> '_list' )
> paths.append(p)
>
> return paths
So, I think I have a neat idea for solving my problem, simply make a
function which returns a list of path() returns.
In urls.py
urlpatterns = GetItemPaths() + [
# other paths
]
In models.py:
def GetItemPaths():paths = [ ]
for i in [ 'Model1', 'Model2', 'Model3' ]:
p = path( i
; ]
>
> From what I can see, my model name mName is passed only to the view and
> apparently not to the name constructor inside urls.py
> Also, while I do not entirely understand the reverse naming process, I
> sense that it might not be too easy to reverse the url name if
I have a lot of models (say 30 or 40) which are so similar, that I have
handled them using slightly modified class based views.
In urls.py:
urlpatterns = [
path('list//',ItemListView.as_view()),
path('create//', ItemCreateView.as_view()),
path('update
Always have the documentation with you while following the old
tutorials.when I was starting Django I had big problems while using a
tutorial in Django 1.7 with Django 1.10, nothing worked, but using
documentation you can pretty much find what had changed
--
You received this message
hecks
>>return checks.run_checks(**kwargs)
>> File "/home/gnull/.local/lib/python2.7/site-packages/
>> django/core/checks/registry.py", line 81, in run_checks
>>new_errors = check(app_configs=app_configs)
>> File
>> "/home/gnull/.l
checks.run_checks(**kwargs)
> File
> "/home/gnull/.local/lib/python2.7/site-packages/django/core/checks/registry.py",
>
> line 81, in run_checks
>new_errors = check(app_configs=app_configs)
> File
> "/home/gnull/.local/lib/python2.7/site-packages/django/co
a file called
``urls.py``.
+To create a URLconf in the polls directory, create a new file called
``urls.py``.
Your app directory should now look like::
polls/
@@ -282,10 +282,31 @@
url(r'^$', views.index, name='index'),
]
-The next step is to point the root URLconf
om/en/1.11/intro/tutorial01/
>
> In the "Write your first view" section it says ...
>
> The next step is to point the root URLconf at the |polls.urls| module.
> In |mysite/urls.py|, add an import for |django.conf.urls.include| and
> insert an |include()|
> <https://docs
improved.
>
> https://docs.djangoproject.com/en/1.11/intro/tutorial01/
>
> In the "Write your first view" section it says ...
>
> The next step is to point the root URLconf at the |polls.urls| module.
> In |mysite/urls.py|, add an import for |django.conf.urls.include| a
://docs.djangoproject.com/en/1.11/intro/tutorial01/
In the "Write your first view" section it says ...
The next step is to point the root URLconf at the |polls.urls| module.
In |mysite/urls.py|, add an import for |django.conf.urls.include| and
insert an |include()|
<https://docs.djangoprojec
gt; settings.
>
>
> I set trailingslash=False in my default router in Urls.py and now it
> works. Why ?
>
> Thank you for your time :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscr
can't redirect to the slash URL while
maintaining POST data. Change your form to point to 127.0.0.1:8000/X/2304/
(note the trailing slash), or set APPEND_SLASH=False in your Django
settings.
I set trailingslash=False in my default router in Urls.py and now it
works. Why ?
Thank you for your time
Tex e crie o arquivo com o
> nome urls.py e coloque dentro dele o código relativo as urls...
>
>
> Talvez você deva explicar melhor quais os problemas que você está tendo
>
> On Mon, Dec 19, 2016 at 5:42 PM, Itamar Junior <i...@ecomp.poli.br> wrote:
>
>> Olá galera,
>&g
uai, desde que arquivos python simplesmente são arquivos de texto, abra um
editor de texto como o Notepad++, Gedit, SublimeTex e crie o arquivo com o
nome urls.py e coloque dentro dele o código relativo as urls...
Talvez você deva explicar melhor quais os problemas que você está tendo
On Mon
Olá galera,
sou no django, como posso fazer para criar um arquivo urls.py?
Obrigado.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-user
On Fri, Sep 09, 2016 at 10:11:25PM -0700, Chris Seberino wrote:
> Flask has a neat design where instead of having a urls.py file they bind
> URLs to view functions with decorators.
>
> Possible to do something similar with Django? What modifications would be
> needed?
Flask has a neat design where instead of having a urls.py file they bind
URLs to view functions with decorators.
Possible to do something similar with Django? What modifications would be
needed?
Thanks,
cs
--
You received this message because you are subscribed to the Google Groups
On Sep 5, 2016 6:06 AM, "arun kumar" wrote:
>
> Hi,
>
>I'm working in Django 1.10 and I got the type error in the below file
at this line " url(r'^$', views.dashboard, name = 'dashboard'),"
>
> from django.conf.urls import include, url
> from . import views
>
>
Not sure what the issue is without more info about the error, but is the
regular expression for that view correct? Assuming that you want to divert
folks to the root of your site can you try the following?
url(r'^/$', views.dashboard, name = 'dashboard')
NOTE: if the error still persists, it
Hi,
I'm working in Django 1.10 and I got the type error in the below file
at this line "* url(r'^$', views.dashboard, name = 'dashboard'),*"
*from django.conf.urls import include, url*
*from . import views*
*urlpatterns = [*
*#preview login view*
*#url(r'^login/$',views.user_login,
I'm not sure exactly what you're asking. Maybe you could give a concrete
example. For a complex example, you could take a look at the urls.py for
djangoproject.com:
https://github.com/django/djangoproject.com/blob/249c3482982fc43afc6b6fa575fe79f938ebe472/djangoproject/urls/www.py
Is there convention on import view as vs a separate URL file in every app?
Is there separate URL in each app only used if you need to use include() ??
On Saturday, August 6, 2016 at 10:05:25 AM UTC-5, Tim Graham wrote:
>
> You're not missing something. You should imports. Sorry you don't like
You're not missing something. You should imports. Sorry you don't like the
look of it, but that's Python.
On Saturday, August 6, 2016 at 8:42:29 AM UTC-4, Andrew Emory wrote:
>
> I am having trouble with how I would intuitively get my url patterns to
> work, by listing the actual path to the
I am having trouble with how I would intuitively get my url patterns to
work, by listing the actual path to the view function.
So it needs to be a callable, ok. But I don't like having 15+ from appname
import views as appname_view.
I can add a url.py file in each app and use include(). But
I put all in urls and check permissions with
https://docs.djangoproject.com/en/1.9/topics/auth/default/#django.contrib.auth.decorators.user_passes_test
so if not
config.L7V_INITIALIZATED
I raise a 404 exception.
No need to reload urls.
2016-06-23 8:02 GMT-06:00 Thomas
Hy django lovers,
it's my first post for being helped, sorry if I miss something.
I want two list of urls available :
- one (limited) before initializing (verify licence, etc...)
- one (large) after initializing success
Here is my settings.ROOT_URLCONF :
from constance import config
On Sat, Apr 23, 2016 at 11:50:05AM -0700, Chris Seberino wrote:
> I am trying to be consistent and make urls.py expect / after every url.
>
> The problem is Django isn't automatically adding / at the end and so now
> I get 404s when I try to access my web pages.
>
&g
I am trying to be consistent and make urls.py expect / after every url.
The problem is Django isn't automatically adding / at the end and so now
I get 404s when I try to access my web pages.
How fix?
Thanks!
Chris
--
You received this message because you are subscribed to the Google Groups
on this server.
My rango/urls.py
from django.conf.urls import patterns, url
from rango import views
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
(r'^/rango/about', 'rango.views.about'),
)
My structure and following this exercise 3.7
at http
On 20/06/2014 8:26 AM, Uzi Lumbroso wrote:
?In the Django documentation, Where can I found URLS.PY Symbol
explanations (for example: (?P[-\w]+)). What is
... [-\w]+) matches
I couldn’t find it in the Django documentation. Thanks for the help
It is more or less plain Python
?In the Django documentation, Where can I found URLS.PY Symbol
explanations (for example: (?P[-\w]+)). What is ... [-\w]+)
matches
I couldn’t find it in the Django documentation. Thanks for the help
--
You received this message because you are subscribed to the Google Groups
"D
You need to quote the argument being passed to include():
include('vmware.urls')
There might be other things going on, but I'm on my phone and it's hard to
follow.
-James
On Tuesday, May 6, 2014, G Z wrote:
> I'm running 1.6.4
>
> yes vmware is in my installed apps i used
I'm running 1.6.4
yes vmware is in my installed apps i used from . import vmware
if I dont try to link my appurls to project urls and just use admin site
all my stuff works correctly its just when i try to add vmare
project.urls
from django.conf.urls import patterns, include, url
from
What version of django do you have runing?, do you define an admin for
vmware?
--
Rafael E. Ferrero
2014-05-06 2:50 GMT-03:00 G Z <zuk...@gmail.com>:
> project name = provisioning app name = vmware
>
> In my projects urls.py I have the following. I assume I set the new url
&
project name = provisioning app name = vmware
In my projects urls.py I have the following. I assume I set the new url
link customers to myapp.urls because im watching a youtube video and thats
what he did.
from django.conf.urls import patterns, include, url
from django.contrib import admin
Cheers DR,
Moving on I think there are Klingons now.
TemplateSyntaxError at /admin/honorary/member/
Exception Type: TemplateSyntaxError Exception Value:
Caught TypeError while rendering: __init__() got an unexpected keyword argument
'core'
Exception Location:
On Thursday, 12 December 2013 13:33:47 UTC, MikeKJ wrote:
>
> Warning: This is a port from 0.97 to 1.3.7 (thanks DR)
>
> The front end of the site is working just the admin is being difficult
> SyntaxError at /admin/honorary/member/
>
> invalid syntax (urls.py, line 10)
>
Warning: This is a port from 0.97 to 1.3.7 (thanks DR)
The front end of the site is working just the admin is being difficult
SyntaxError at /admin/honorary/member/
invalid syntax (urls.py, line 10)
location
/home/paston2/webapps/sevenkbw/lib/python2.7/django/utils/importlib.py
Hi Tom,
works like a charm - THX!
Cheers
Thomas
Am Dienstag, 8. Oktober 2013 17:49:18 UTC+2 schrieb Tom Evans:
>
>
> Use reverse_lazy
>
> https://docs.djangoproject.com/en/1.5/ref/urlresolvers/#reverse-lazy
>
>
> Cheers
>
> Tom
>
--
You received this message because you are subscribed to
r.
>
> This is the relevant part of my urls.py, I marked the prolematic parts in
> red:
>
>
> url(r'^password/reset/$','django.contrib.auth.views.password_reset',{'post_reset_redirect'
> : '/accounts/password/reset/done/', 'template_name':
> 'accounts/password_rese
roduction
> server.
>
> This is the relevant part of my urls.py, I marked the prolematic parts in
> red:
>
>
> url(r'^password/reset/$','django.contrib.auth.views.password_reset',{'post_reset_redirect'
> : '/accounts/password/reset/done/', 'template_name':
> 'account
uction
server.
This is the relevant part of my urls.py, I marked the prolematic parts in
red:
url(r'^password/reset/$','django.contrib.auth.views.password_reset',{'post_reset_redirect'
: '/accounts/password/reset/done/', 'template_name':
'accounts/password_reset.html'}, name="pas
Diek Kearney wrote:
>>
>> I am going through the Tutorial Django 1.5 Tutorial Part 3, and up to the
>> current point everything was running smoothly, then I hit a wall that I
>> cannot figure out. Maybe I am too focused on following, anyways I need some
>> help.
>&
Thomas, like I explained to Mauro it was just confusing. Really I should
have known the problem, I was working on it all last night and I guess I
needed a break. That said, the tutorial is not clear. In line with the rest
of the tutorial they should have used 1, vice 34. It works perfect with
l that I
>> cannot figure out. Maybe I am too focused on following, anyways I need some
>> help.
>>
>> After I updated Polls/urls.py:
>>
>> from django.conf.urls import patterns, include, url
>>
>>
>> from polls import views
>>
>>
>
On 2013-08-20, at 9:02 PM, Diek Kearney wrote:
> I am going through the Tutorial Django 1.5 Tutorial Part 3, and up to the
> current point everything was running smoothly, then I hit a wall that I
> cannot figure out. Maybe I am too focused on following, anyways I
out. Maybe I am too focused on following, anyways I need some
> help.
>
> After I updated Polls/urls.py:
>
> from django.conf.urls import patterns, include, url
>
>
> from polls import views
>
>
> urlpatterns = patterns('',
>
>
I am going through the Tutorial Django 1.5 Tutorial Part 3, and up to the
current point everything was running smoothly, then I hit a wall that I
cannot figure out. Maybe I am too focused on following, anyways I need some
help.
After I updated Polls/urls.py:
from django.conf.urls import
I found a solution!
I created a file /tmp/django.pid with the PID of the UWSGI master-process,
then I executed in the shell the command uwsgi-core --reload
/tmp/django.pid and the UWSGI process has restarted and the urls.py changes
are working now.
Thanks a lot for the help!
El sábado, 9 de
I have launched a "/etc/init.d/uwsgi restart" but the application is still
not loading the changes in urls.py file.
I think I have to kill the process because after restarting the uwsgi
process the PID is still the same:
*root@miami ~ # ps -fea|grep uwsgi
uwsgi11916
The problem is that I am administrating this server where the Django
application was already installed and deployed so I don't have this
information.
However I have execute "ps -e" to view all the processes running on my
server and I got this:
PID TTY TIME CMD
1 ?
On Fri, Mar 8, 2013 at 6:14 PM, Asier Hernández Juanes
wrote:
> When I type "locate *.fcgi" I get no results at all
that searches for files. no relation to processes.
to help you, first we need to know a bit about your deployment
architecture, specially which WSGI
I understand but I cannot locate the FastCGI process to stop it. When I type
"locate *.fcgi" I get no results at all so unfortunatelly I don't know how to
stop the Django (or fastCGI) process itself.
Can anyone help me, please?
--
You received this message because you are subscribed to the
Well, nginx is a proxy to the fastCGI application. So you can't access it
from the usual URL when
nginx is stopped, but that doesn't mean that the process to which you
proxy, which is running
Django, has stopped.
On Fri, Mar 8, 2013 at 3:11 PM, Asier Hernández Juanes <
asiertxo...@gmail.com>
Maybe fastCGI but when I stop the nginx server with /etc/init.d/nginx stop
the application is not loading.
I have seen some fastCGI configuration inside nginx server but I don't know
how to restart fastCGI process or Django process itself.
How can I do that?
El viernes, 8 de marzo de 2013
On Sun, Mar 3, 2013 at 8:16 AM, Asier Hernández Juanes
wrote:
> i have a remote Linux server with a Django application running in a nginx
> server
Django application's don't run in the nginx server. There must be
some other process running your app. Either uWSGI,
efer to delete the .pyc fie for issues such as these wherein
>>>>> changes are not reflected despite server restart.
>>>>>
>>>>> On Sun, Mar 3, 2013 at 9:59 PM, Serge G. Spaolonzi
>>>>> <se...@cobalys.com>wrote:
>>>>&g
gt;>>>
>>>>> Maybe the server is loading an old .pyc file. try to delete the
>>>>> urls.pyc file and restart the server.
>>>>>
>>>>>
>>>>> On Sun, Mar 3, 2013 at 11:16 AM, Asier Hernández Juanes <
>>>
;wrote:
>>>
>>>> Maybe the server is loading an old .pyc file. try to delete the
>>>> urls.pyc file and restart the server.
>>>>
>>>>
>>>> On Sun, Mar 3, 2013 at 11:16 AM, Asier Hernández Juanes <
>>>> asier...@gmai
;
>>> On Sun, Mar 3, 2013 at 11:16 AM, Asier Hernández Juanes <
>>> asier...@gmail.com> wrote:
>>>
>>>> Hi everyone,
>>>>
>>>> i have a remote Linux server with a Django application running in a
>>>> nginx server b
gt;>> Hi everyone,
>>>
>>> i have a remote Linux server with a Django application running in a
>>> nginx server but when I make a change in urls.py like adding a new
>>> urlpattern the server is not applying the changes. I have restarted nginx
>>>
and restart the server.
>
>
> On Sun, Mar 3, 2013 at 11:16 AM, Asier Hernández Juanes <
> asiertxo...@gmail.com> wrote:
>
>> Hi everyone,
>>
>> i have a remote Linux server with a Django application running in a nginx
>> server but when I make a cha
nginx
> server but when I make a change in urls.py like adding a new urlpattern the
> server is not applying the changes. I have restarted nginx server but the
> new url is not loading.
>
> Does anyone know what may be the problem?
>
> Thanks a lot!
>
> --
> You rec
Hi everyone,
i have a remote Linux server with a Django application running in a nginx
server but when I make a change in urls.py like adding a new urlpattern the
server is not applying the changes. I have restarted nginx server but the
new url is not loading.
Does anyone know what may
Thanks Babatunde, I was aware of your solution. I am just curious if it is
possible to make it just in the urls.py. Anyone?
Em 09/02/2013 13:20, "Babatunde Akinyanmi" <tundeba...@gmail.com> escreveu:
> >The problem I have is that I want to use a view (rather not modifing it
rom my Windows Phone
--
From: Thiago Carvalho D' Ávila
Sent: 2/9/2013 12:23 PM
To: Django Users
Subject: Doubt in urls.py filter
Hello Guys,
The problem I have is that I want to use a view (rather not modifing it) to
show all person in a group.
The problem is I don't k
Hi Thiago,
I have believe MyListView is a subclass of ListView. The cleaner way to do
what you are trying to achieve will be to override the get_queryset()
method.
The code you gave is not working because pk will not be available when
python starts to evaluate your urls.py file. pk becomes 'alive
Hello Guys,
The problem I have is that I want to use a view (rather not modifing it) to
show all person in a group.
The problem is I don't know how to use the pk in the regex to filter in the
same line...
I wanted something like:
url(r'^groups/(?P\d+)/$',
and your
>> parenthesis are not nested properly.
>>
>>
>> On Tuesday, December 18, 2012 12:19:24 PM UTC-8, maiquel wrote:
>>>
>>> 'm trying to do the following
>>>
>>> Artigo.objects.all () inside urls.py
>>>
>
iquel wrote:
>>
>> 'm trying to do the following
>>
>> Artigo.objects.all () inside urls.py
>>
>> urlpatterns = patterns ('',
>> # url (r '^ blog / $', 'blog.views.archive_index.**index')
>> (r '^ $', 'django.views.generic.date_**based.archive
Need a comma between the view name, and {'queryset...' and your parenthesis
are not nested properly.
On Tuesday, December 18, 2012 12:19:24 PM UTC-8, maiquel wrote:
>
> 'm trying to do the following
>
> Artigo.objects.all () inside urls.py
>
> urlpatterns = patterns ('',
>
'm trying to do the following
Artigo.objects.all () inside urls.py
urlpatterns = patterns ('',
# url (r '^ blog / $', 'blog.views.archive_index.index')
(r '^ $', 'django.views.generic.date_based.archive_index'
{'queryset': Artigo.objects.all ()), # invalid syntax
'date_field
Thank you. It's quite logical when you know it. :-)
> This isn't something you do in the urlconf. You do that in your view,
> where the current user is available already as `request.user`.
> --
> DR.
>
--
You received this message because you are subscribed to the Google Groups
"Django
logged in user in my
> urls.py, like this:
>
> # urls.py
>> from django.contrib.auth.decorators import login_required
>> from django.views.generic import list_detail
>> from myproj.myapp.models import App1
>>
>
>> app1_info = {
>> 'queryset
Hello,
I've set up a user profile according to
this<https://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users>and
now I'm trying to access the id of the currently logged in user in my
urls.py, like this:
# urls.py
> from django.contrib.auth.d
On Mon, Oct 22, 2012 at 5:39 PM, Tomas Ehrlich wrote:
> Hello,
> you need to make 'year' argument optional:
>
> def student_reports(request, year=None):
> year = year or datetime.date.today().year
> ...
Perfect - thanks
>
> Another option could be passing
1 - 100 of 449 matches
Mail list logo