Hey I just figured it out. I ran requirements.txt before running “pip freeze > requirements.txt” Sent from Mail for Windows 10 From: Mike DewhirstSent: Thursday, 25 February 2021 23:21To: django-users@googlegroups.comSubject: Re: requirements.txt On 25/02/2021 8:38 pm, Spence Buzz wrote:> Hello> I
-commands/
On Wed, Oct 14, 2015 at 10:53 AM, 'Chris Norman' via Django users
mailto:django-users@googlegroups.com>>
wrote:
Hi again,
I would like to set up a cron job to email the day's journeys to a
pre-defined set of email addresses, using the model I describe
Hi again,
I would like to set up a cron job to email the day's journeys to a
pre-defined set of email addresses, using the model I described in the
previous example.
I have it so I can type:
python manage.py shell
import journey_sender
This does everything.
Thing is, I would like to use the
Hi all,
I have written a Journey model, which has an out and a back field, both
of which are datetime fields.
What I want to do is something like:
from datetime import datetime
now = datetime.now()
for journey in Journey.objects.filter(out__month = now.month, out__day =
now.day):
print jour
Ok, I have version 1.6.5. I will see about updating. HmmmI had googled and
this is the first im hearing of this. Got to love Django. :-)
On Tuesday, September 2, 2014 5:40:52 PM UTC-4, Collin Anderson wrote:
>
> The newest version of django, version 1.7, has migrations built in.
>
--
You receiv
. :-)
thanks
On Fri, Aug 22, 2014 at 11:42 PM, Norman Bird
wrote:
> how about: python manage.py sql myapp
> I just changed my model and I had to runt that in order to build the
> tables.
>
>
> On Fri, Aug 22, 2014 at 11:49 AM, Norman Bird
> wrote:
>
>> I stand correcte
how about: python manage.py sql myapp
I just changed my model and I had to runt that in order to build the
tables.
On Fri, Aug 22, 2014 at 11:49 AM, Norman Bird
wrote:
> I stand corrected. :-)
>
>
> On Fri, Aug 22, 2014 at 11:47 AM, Larry Martell
> wrote:
>
>> On Fri,
I stand corrected. :-)
On Fri, Aug 22, 2014 at 11:47 AM, Larry Martell
wrote:
> On Fri, Aug 22, 2014 at 9:55 AM, Norman Bird
> wrote:
> > I am new, just completed the tutorials, but from my understanding you run
> > "python manage.py syncdb" and that rebuilds th
I believe so. Wont hurt to try it and see what happens.
On Fri, Aug 22, 2014 at 11:03 AM, Néstor wrote:
> is that true if the table is already there?
>
>
> On Fri, Aug 22, 2014 at 6:55 AM, Norman Bird
> wrote:
>
>> I am new, just completed the tutorials, but from
I am new, just completed the tutorials, but from my understanding you run
"python manage.py syncdb" and that rebuilds the tables etc.
On Friday, August 22, 2014 3:32:43 AM UTC-4, termopro wrote:
>
> Hi there,
>
> I am using Django 1.7 RC2.
> I have created models and have run all the migrations
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
How do I unsubscribe from this list?
Jim Norman
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkwMVVMACgkQ677kSNWvnhS3EQCeO2OguYmNhKiyywl2HqXnLslF
Hi,
I'm trying to test simple portal with two apps and two sub domains
mysite.com and blog.mysite.com, but I cant find any example of ngnix
configuration file on local ubuntu server.
So my question is - how to setup ngnix and django to test such
multihost on single django instance and local pc?
hello,
I look for email alert functionality, where readers sign up to get
notifications when news happens. But I can't find any suitable django
app.
So where can I find something like this?
Any snippet or source code?
regards, nomanek
--~--~-~--~~~---~--~~
You
per-view cache is not a solution because I need only a method to
retrieve fresh (not cached) data from middleware.
I wanna take cached list of stories and not cached vote results for
it.
regards, Norman
On Jul 21, 3:13 pm, Michael wrote:
> On Tue, Jul 21, 2009 at 9:02 AM, Norman wr
Hi all,
I cache my view that show a list of stories, but I have also small
voting button (like digg). Voting is done be middleware class (it
reads user IP), so I can ask for view with list of stories and tell
that this list shall be cached and I have to ask middleware for vote
results.
Unfortuna
Hi,
Is there any app that can be used as comment - under blog entries -
and as forum - to see all blog comments ( /forum).
regards, Normanek
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To p
How to perform such simple query:
select p.text, b.title from books b, phrase p where p.book_id = b.id
on tables
books{
id : int,
title: varchar
}
phrase{
id : int,
book_id : int,
text: varchar
}
but using django models?
--~--~-~--~~~---~--~~
You received thi
is there
Sorry for the screw up
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
Get off the sidelines and huddle up with the Statesman all season long
for complete high school, college and pro
to recommend to Djangonista's just
starting out.
And you forgot wsgi options ;)
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
Get off the sidelines and huddle up with the Statesman all
e syntax would be this.
permission = Permission.objects.get(name="in_artist_pulldown")
users = permission.users.all()
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
Get off the sid
environment has a proj_settings.py that imports
proj_base_settings.py and overrides whatever is required. This is often
just setting DEBUG, email addy, and db. This file is not checked into
source control.
I prepend proj_ to all the settings files so I can have multiple
projects in same python
ecimal import Decimal, ROUND_HALF_UP, ROUND_HALF_DOWN
>
> With this >> ImportError: cannot import name MetaData
>
> Full trace: http://paste.pocoo.org/show/85970/
>
>
> Thanx again!
>
>
It looks like you have made a circular import:
statemachine imports myfunct
Charles Choiniere wrote:
> On Mon, Sep 22, 2008 at 10:46 AM, Norman Harman <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>
> nek4life wrote:
> > How would I go about getting a queryset into an include? Say I
> have a
> >
be the best approach
> to build these "widgets" for use on multiple pages? Any help would be
> much appreciated. Thanks.
Custom Template Tags?
http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#howto-custom-template-tags
--
Norman J. Harman Jr.
Senior Web Specialis
;, {} 'profile_myiq'),
The error indicates you were providing either empty string, '', or the
litteral characters '', (not sure the formating, probably is the former)
Neither of which match the regex for arg "name". "\w+" matches 1 or
more wor
advice. Esp based on the little bit of
information you have provided.
It is also probably not a Django question but a sysadmin question.
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
Get off the
;, line 7,
> in
> from django.db.models.fields import DateField
> File "C:\tools\Python25\lib\site-packages\django\db\models\fields
> \__init__.py"
> , line 666
> class DecimalField(max_digits = 32, decimal_places =
> 0)IntegerField(Field):
>
= MyForm()
add_links_to_context(context)
render_to_response(...
function handle_form(request, where_to_redirect_to):
form handling logic here
HttpRedirect(where_to_redirect_to)
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
_
ho-we-
> are', u'how-we-are-different')' and keyword arguments '{}' not found.
>
> What am I doing wrong?
Do you use {% url %} tag in that template 'dynamic_page.html'?
and I think it's better not to use *args, **kwargs unless
lect the correct template
like so:
t = loader.get_template('%s_list.html' % model.__name__)
Create a wrapper aka "interface" or "proxy" that translates a standard
set of fieldnames into the model specific fieldnames. So as far as the
template is concerned th
instead of preserving the '+' symbols.
>
> Is there a way to prevent that?
http://docs.djangoproject.com/en/dev/ref/templates/builtins/#safe
http://docs.djangoproject.com/en/dev/topics/templates/#id2
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
ything will work if
you get rid of all of it. You need to add what Django requires.
But, it sounds like you don't know/understand Apache conf files which
you probably should.
--
Norman J. Harman Jr.
Senior Web Specialist, A
ducts])
def test_sum_products(self):
order = Order(number=1)
product_list = [Product(price=20.0), ]
self.assertEqual( 20.0, order.sum_products(product_list) )
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
_
all my apps plus
settings.py file in that directory.
some reading http://www.b-list.org/weblog/2007/nov/09/projects/
and
http://www.pointy-stick.com/blog/2007/11/09/django-tip-developing-without-projects/
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
__
One way to do this is to create helper functions.
def _get_artist_hometown(self):
return self.artist.hometown
list_display = ('album','release_date',_get_artist_hometown)
There're different options see
http://www.djangoproject.com/doc
presentation (text fields, with "now" etc. shortcuts)?
>
> Like, e.g.
>
> Created: 08/25/2008 09:20am
>
> Do you have links to examples?
http://www.djangosnippets.org/snippets/937/
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
abels
labels = property(_prop_get_labels, _prop_set_lables, doc="""lables!""")
Then your assignment
article.labels = labels
won't throw an exception, at least not for same reason ;)
--
Norman J. H
Robert wrote:
> Hello all,
Can we see your view code please?
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
It's August! Keep your cool with the Statesman. Check out our hot
deals
l-patterns
url tag in
templateshttp://www.djangoproject.com/documentation/templates/#url and
reverse() in views/models/other to be excellent solution and the best
way to handle this.
Define your urls once in one place, your urls.py file. Change them and
magically everything else just wor
free books, blogs,
cookbook/snippet site, IRC, and mailing lists. Help is abundant and in
many forms.
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
It's August! Keep your cool with the Stat
stomized pages:
The request instance that each view receives has a request.user
attribute which is the current user (could be anonymous) see
http://www.djangoproject.com/documentation/authentication/#users
This can be used to customize the view for the user in whatever way you
desire.
--
Nor
before i decided it was not tool I'd want to use for deployment
> My deployment procedure will be, I hope, an easy one:
>
> * download the version I want to deploy of the project (from
> subversion)
> * update database if needed
> * restart application server if needed
resumes
ends with one.
Another problem is your regex's don't include ^ match start of text.
Without you t run into problems with regex doing partial match at end of
string. Just like you are having your example.
Since you omit the match start your 1st urls matches:
/resumes/jss/no-
quot;id", flat=true)
courses = Course.objects.filter(users__id__in=user_ids)
I've used 'in' with a many hundreds ids. Have no idea how performant it
is compared to other solutions.
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
jelle wrote:
> Hi Norman,
>
> Yep, I'm just looping through the list.
> Pretty awkward, right?
Yes, very. Is the html output order seemingly random? or is there some
pattern to it? Cn you post the code for the view? I'm guessing there
is a typo or something s
lts in the wanted ordering.
> When rendered in html, I loose this precise ordering.
If you use the same code in your view as above then the ordering should
not change.
How are you displaying in template? Should be using something like
{% for article in articles %}
stuff
{% endfor %)
hole splitting dynamic/static content issue until and if
I run into scalability issues.
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
You've got fun! Check out Austin360.com for all the
ch. Probably works with trunk as well.
Is this new? I really thought numerical indexing did not work.
Are you not using trunk? If not you should be, and if so there must be
something else going on (username instead of user_name?) as t
Dane Hesseldahl wrote:
> How do I get to the image when the avatar field has an image uploaded
> through it?
http://www.djangoproject.com/documentation/upload_handling/
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Sta
del. http://www.djangoproject.com/documentation/contenttypes/
Ditch/copy Django's auth and roll your own/modify it to work they way
you need.
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
testing an object creation?
It's reasonable.
I'd probably just use count instead of len(), it should be faster and
more clearly indicates what you are testing. I'd also use assertEqual
instead of assertTrue for clarity.
before_count = Cartera.objects.filter(usuarioID=user.id).cou
se the Google
or you can just use re module and parse the text yourself.
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
You've got fun! Check out Austin
u meant by "alpha chars" but \w+ matches more than just
[A-Za-z]+
see http://docs.python.org/lib/re-syntax.html
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
You've got fun! Check
s of postres)
> to use column names in SQL queries instead of positional parameters?
Your example uses the Python DB API
http://www.python.org/dev/peps/pep-0249/
This explains how to do it with Django
http://www.djangoproject.com/documentation/db-api/#values-fields
--
Norman J. Harman
Brandon Taylor wrote:
> url(r'^(?P[w-]+)/$', 'my_site.groups.views.show_group',
That regex matches one or more w's and hyphens. You surely wanted [-\w]
to match letters, numbers, underscores and hyphens.
--
Norman J. Harman Jr.
Senior Web Specialis
and python.
Create a template.xml pass it and a context with your variables into
render_to_string
http://www.djangoproject.com/documentation/templates_python/#the-render-to-string-shortcut
Then use Python stdlib http://docs.python.org/lib/module-urllib2.html to
POST request.
--
Norman J. Harman Jr.
I would strip out or disable all your javascript and if the
/start_empty.gif requests stop you know the problem is in there somewhere.
Is Apache doing any redirects? Look in it's conf files. Also worth a
look at Apache's logs to find out more about exactly when and from were
the /star_em
tle test scripts not using Django?
You have provided too little information for anyone to tell you what is
wrong. But with the above information and a little investigation you
should be able to figure it out on your own :)
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
ut data in tables (i.e. it is ok if it is
all deleted) and you change models in the foo app you need to run the
following.
manage.py reset foo
manage.py syncdb
If you do care about data then back it up first. Then you must create
and run alter statements by hand or use a Django schema migration
delOne.objects.all()
context["twos"] = ModelTwo.objects.filter(somekey=somevalue)
render_to_response("main/index.html", context)
> If someone could give me a few pointers in a direction they'd approach
> this problem, it would be great
use it anyway.
Could use the cache system for something similar, your needs probably vary.
markup is good for sophisticated / power users / niches where markup is
expected (e.g. wikis)
TinyMCE / js editor is good for the masses.
--
Norman J. Har
t I'd use to implement "Setting and getting value of
this field actually runs some defined operation"
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
You've got f
hen outline how you are reimplementing HTTP because you don't want
to be "exposing the internal URLs" yet.
I suggest spending an hour, a day learning about how your webserver(s)
handle auth and start using it. My $.02US (only about .01 at today's rates)
Baring that, o
__all__.extend(django.newforms.widgets.__all__)
class StrippedCharField(CharField):
"""Newforms CharField that strips trailing and leading spaces."""
def clean(self, value):
if value i
is? I realize that there is a good chance
> that I am missing something obvious.
http://www.djangoproject.com/documentation/cache/#using-vary-headers
http://www.djangoproject.com/documentation/cache/#the-low-level-cache-api
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-States
'settings': get_safe_settings(),
})
So, it looks like "reason" is the template var you want.
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
Florencio Cano wrote:
> Where is the problem?
where you don't use django's TestCase
> import unittest
> class UserTestCase(unittest.TestCase):
from django.test import TestCase
class UserTestCase(TestCase):
--
Norman J. Harman Jr.
Senior Web Specialist, Austin
w
> functions.
Test system creates a new test database from scratch every time it is
run. manage.py loaddata has NO effect on test.
I could be wrong but I don't believe test runner automatically loads the
fixture initial_data.xml
You need to tell it what fixtures to load
Alex Koshelev wrote:
> Or may be a custom template tag for common stuff.
Or like any code anywhere just extract the common parts to a helper
function and call that.
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-States
blogs by the same author then there are 10 hits on
user_profile to read it each time.
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
You've got fun! Ch
Django developers and community to maintain multiple stable branches.
Compare Django release discipline and record to other major frameworks.
And your PHB's should be scared to use anything but Django.
--
Norman J. Harman Jr.
Senior W
There are reasons the
HTTP Internet has exploded in a way client server never did.
From my understanding of Comet it's more or less exactly what you are
asking for. http://www.google.com/search?q=django%20comet
--
Norman J. Harman Jr.
Senior Web Specialist,
tatus_code=302,
target_status_code=200)
http://www.djangoproject.com/documentation/testing/#assertions
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
You've got fun! Check out Austin360.com for all the
at
programmer".
btw, I really think IntegerField is the wrong column type for a zip
code. They can be upto 11 chars long and have hyphens. I'd make it
CharField or maybe even a USZipCodeField from
'contrib/localflavor/u
create my own field,
NullCharField or NullIntegerField that replaces "" or None with NULL
according to the null=true parameter.
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
You'v
e state in a stateless server, use persistent
storage like a DB.
There *are* two or more copies of the global. There are as many copies
as WebFaction runs instances of django (mod_python or whatever)
It works in dev cause manage.py runserver only starts one instance of
django.
--
Norman J. Har
t; root
url.
If so, I would determine this in the view and pass in a template
varible, 'is_root'. But I don't think wrapping an extends in a if/endif
will work.
Or do you mean the template is root as in it doesn't extend any other
templates.
In that case just skip the if/
model-api/#relationships
to_field The field on the related object that the relation is to. By
default, Django uses the primary key of the related object.
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
to work.
Other options would be putting them in a ChoiceField and using Select
(dropdown) RadioSelect (radio buttons) or some custom widget.
The choice field options will have only one delete button but require
user to select which record to delete. That may or may not be a better
ui than
path every time
/usr/local/python2.5/bin/python setup.py install
or you can use an alias (I suggest adding to your .bashrc or similar file)
alias python=/usr/local/python2.5/bin/python
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
__
e know what my template should contain to achieve admin look
> and feel.
look in django/contrib/admin/templates
extending admin/base_site.html is what I believe you want.
--
Norman J. Harman Jr.
Senior Web Specialist,
return render_to_response("mytemplate", extra)
see http://www.djangoproject.com/documentation/shortcuts/#render-to-response
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
You
primarily developing in Python,
which was pretty hard to find not so long ago.
Lately I've been answering what questions I can on this forum. Which is
my preferred way of saying "thanks". I wish it was easier to contribute.
--
Norman J. Harman Jr.
Senior Web Specialist,
This is what I'm talking about
http://www.djangoproject.com/documentation/model-api/#unique-for-date
Searching internets can not find any answer.
Thanks,
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Stat
a more Django way of doing it
> than me doing it manually.
http://www.djangoproject.com/documentation/db-api/#range
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
You've got fun! Check
Brian Rosner wrote:
> Hi Norman,
>
> On Jun 17, 2008, at 3:49 PM, Norman Harman wrote:
>
>> I want to use {% url %} to point into portions of the admin site(and
>> change the default url structure). I hacked this generally
>> unfullfilling but working version w
et the dynamic urls to work.
url(r"^$", site.root, name="ts_admin",
kwargs={"url":"specials/adspecial"}),
Actually, I'd really love to learn a cleaner way to d
_suggestion = False
def reject(self):
assert self.is_suggestion
# not sure how to delete relation
# self.suggestion.suggestion = None ???
self.delete()
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
ues()
If order is important:
list_o_dicts = [ dict_that_should_be_list[k] for k in
sorted(dict_that_should_be_list.keys()) ]
Then you can use the template for loop construct normally
{% for dict in list_o_dicts %}
{{ dict.post }} {{ dict.title }}
{% endfor %}
--
Norman J. Harman Jr.
> What about uniqueness, and composite field uniqueness?
> # unique_together = (("field1", "field2","field3"),)
>
> I'm thinking it would make sense to try to
> create 2 of an object and save them, and check that it fails
Yep two of the objects whose 3 fi
omething else is wrong ;)
btw hard coding a path "C:\dev\incidents\admin_media" in your
urlpatterns is probably a bad thing to do. As whoever uses your
app/where ever you deploy it for production is unlikely to install the
app in the same place you do on your dev machine.
--
Norma
to
use something like urllib2 and POST to 3rdpary in your view code, slurp
the response and send it back to user. It will have 3rdparty content
but come from your server, which is probably gonna cause problems.
--
Norman J. Harman
elf._calc_value()
super(FooModel, self).save()
def test_value_on_save(self):
test_data =( (dict(foo="", bar=""), 42 ),
(dict(foo="1", bar="3"), 37 ),
# test more edge cases, etc.
h Django is
http://superjared.com/entry/real-problem-django/. I didn't mean to
sound complainy in previous post, if anyone took it that way.
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
__
.session['m_key'] but I get an error that session does not have
> 'm_key' key.
I've spent a lot of time debugging session problems only to discover I
had made the bone headed mistake of having this settings combo
CACHE_BACKEND="dummy://"
SESSION_ENGINE=&quo
000
The spaceless tag helps sometimes, but not for your situation.
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
You've got fun! Check out Austin360.com for all the entertain
is and how it
should be formated. Users are more likely to know about changes to
their countries addressing scheme. Etc, etc.
With that in mind the best way to handle varying international addresses
is with a largish char column backend and multiline text input box on
frontend.
--
Norman J
and updated a
times_viewed field in the models.
Scaling that to more than one machine adds complexity. I'd probably
pursue a different solution when/if traffic warranted it.
--
Norman J. Harman Jr. 512 912-5939
Technology Solutions Group, Austin American-Statesman
__
'mykey')
Sounds like you have caching disabled or are using something like
dummycache. Are you sure memcached is running?
Reread
http://www.djangoproject.com/documentation/cache/#setting-up-the-cache
--
Norman J. Harman Jr. 512 912-5939
Techn
blog: %s" % entry.title)
return {"featured_blog_html": html}
except Entry.DoesNotExist:
pass
def index(request):
context = RequestContext(request)
get_featured_blog_context(context)
get_featured_foo(context)
get_featured_bar(context)
ret
1 - 100 of 128 matches
Mail list logo