Re: ./manage.py collectstatic permission denied

2015-05-27 Thread James Schneider
Oh yeah, see Tim's answer to your duplicate post. -James On May 27, 2015 6:05 PM, "James Schneider" wrote: > Do you have a /static directory on your server? Does your user have write > privileges to it? I suspect you are trying to copy to a local directory in > your

Re: ./manage.py collectstatic permission denied

2015-05-27 Thread James Schneider
Do you have a /static directory on your server? Does your user have write privileges to it? I suspect you are trying to copy to a local directory in your project named static, and not one located at the root of your file system, so you probably need to change where your static files point. -James

Re: django1.8 collectstatic permission denied

2015-05-27 Thread Tim Graham
STATIC_ROOT should be the absolute path to the directory static files should be collected to. Example: "/var/www/example.com/static/" It looks like you set it to "/static" which probably doesn't exist (or at least your user doesn't have write privileges to it). On Wednesday, May 27, 2015 at

Re: how to mock REST calls during development?

2015-05-27 Thread Jirka Vejrazka
Hi Abraham, I guess my advantage is that my applications are quite tightly coupled, so I can set some flags in settings.py. The key point is that I'm importing class instance from my API code. That instance represents either the real endpoint or mocked endpoint based on some flags in

./manage.py collectstatic permission denied

2015-05-27 Thread sudhin babu
How can we solve this problem? copying admin static files to STATIC_ROOT may solve this .But how (hackernews)junkuos@ hackernews$ ./manage.py collectstatic You have requested to collect static files at the destination location as specified in your settings: /static This will overwrite

django1.8 collectstatic permission denied

2015-05-27 Thread sudhin babu
i am using ubntu14.04 copying admin static files to STATC_ROOT may solve this problem but how can i run this command successfully? (hackernews)junkuos@ hackernews$ ./manage.py collectstatic You have requested to collect static files at the destination location as specified in your settings:

Re: How to pass a queryset for each different field Admin Inlines

2015-05-27 Thread Felipe
Does not work, why? remember, we need get each form inline guided on the next line self.initial = [{'attribute': attribute} for attribute in obj.category. attributes.all()] # Important: This start each form with a different value, [{'attribute': 'Colors'}, {'attribute': 'Sizes'}, ..] if

Help with customizing Django authentication

2015-05-27 Thread Carlos Ribas
Hello All, I am currently extending the existing User model to store additional information. So, basically I have: # models.py class Person(models.Model): user = models.OneToOneField(User, verbose_name=_('User')) zipcode = models.CharField(_('Zip Code'), max_length=9, blank=True,

Re: how to do a django data migration on a massive Postgres data table (solved)

2015-05-27 Thread Vernon D. Cole
Hmm. Sorry, I think that I sent the download link when I intended the web link. The trailing ".git" made things bad. Try https://gist.github.com/vernondcole/9adedbab1899224a4eaf On Tuesday, May 26, 2015 at 4:51:59 AM UTC-6, aRkadeFR wrote: > > Thanks for the email on the django-user ML. > >

Re: how to mock REST calls during development?

2015-05-27 Thread Abraham Varricatt
Hello Jirka, That's right. I'd forgotten that the settings.py could be used to initialize something like this! (facepalm!) But since you mentioned it, .. how would you initialize (or call mock_setup()) from your app or model? I can't recollect any entry point which can be used. -Abraham V.

Re: Django formset hidden id field

2015-05-27 Thread Matthias Müller
> > Just in general, is it a good idea to expose primary keys like this? > sometimes you can see them in urls too, like: www.yoursite/blog/1/, 1 > would be the primary key of a blog. It's an easy way to refer to an object. Unless there is a secure connection it's this is IMHO the best way to

Re: Django formset hidden id field

2015-05-27 Thread Cheng Guo
Thank you! Yes, I forgot about the csrf. You are right, it would be difficult to fake the CSRF string. Just in general, is it a good idea to expose primary keys like this? sometimes you can see them in urls too, like: www.yoursite/blog/1/, 1 would be the primary key of a blog. On Wednesday,

Re: Django formset hidden id field

2015-05-27 Thread Matthias Müller
Without looking at the link I guess that you explantion is more or less correct. But it's not a security issue that the database is updated by a form. It has to be updated by a form. To make it a correct django form there is a hidden field with the CSRF token. This protects the database being

Django formset hidden id field

2015-05-27 Thread Cheng Guo
Hello, I have a formset and when I render it, Django would include this line in the HTML: I am curious what is the purpose of having an id field here. I mean in what situation would you use it. I did look through Django's documentation on formset

Re: How to pass a queryset for each different field Admin Inlines

2015-05-27 Thread Filipe Ximenes
Think I got it now. Can you see if this stackoverflow answer solves your problem: http://stackoverflow.com/questions/5329586/django-modelchoicefield-filtering-query-set-and-setting-default-value-as-an-obj On Wed, May 27, 2015 at 9:41 AM, Felipe wrote: > Hello, Filipe Ximenes,

Re: How to pass a queryset for each different field Admin Inlines

2015-05-27 Thread Felipe
Hello, Filipe Ximenes, in fact it is not so difficult. To avoid using ajax, what I do is initialize each form inline with a default value. Few ATTRIBUTES has verified and initialize no possibility that the fronentd they can edit. All right up here, but the problem is that for each attribute

Re: InMemoryUploadedFile object retrieved from request.FILES got closed automatically on django 1.7

2015-05-27 Thread Lin Cai
Russ, I have a view which create a new thread to process files user uploaded. I found either InMemoryUploadedFile or TempUploaedFile is closed in the new thread. I think that might be caused by the exit of the view thread. Do you have any idea how to re-open the closed UploadedFile or clone

Re: How to pass a queryset for each different field Admin Inlines

2015-05-27 Thread Filipe Ximenes
>From what I could understand, you want to change the options of the "value options" field depending on the selected "attribute". Since the choosing of the "attribute" happens in the frontend and there's no page refresh, the backend does not know about it, and therefore cannot filter the "value

Re: Changing a form field's value during cleaning

2015-05-27 Thread Gergely Polonkai
In this case the problem comes if the user also filled the other ~60 non-approved fields and has to start over, which makes this approach a no-go for me :( 2015-05-27 10:25 GMT+02:00 James Schneider : > If you are able to catch the validation error, then perhaps you can

Re: Changing a form field's value during cleaning

2015-05-27 Thread James Schneider
If you are able to catch the validation error, then perhaps you can redirect users back to the original form URL (since the form should have the new correct values on the next load). Check out the form.invalid() when working with the form directly or form_invalid() for CBV's. If you catch that

Re: Changing a form field's value during cleaning

2015-05-27 Thread Gergely Polonkai
Hello, although the data is from the database, the form itself is not a ModelForm derivative. Also, this code you suggest will only modify the model handling part of the form, thus, the user will see a value he entered, although the database holds a different one. Best, Gergely 2015-05-27 9:16

Re: datepicker

2015-05-27 Thread aRkadeFR
Hey, Look at the widgets in the fields forms: https://docs.djangoproject.com/en/1.8/ref/forms/widgets/ Implement your own widget, so it includes the javascript and the css your datepicker needs. Then render it in your template (the medias included). Have a good one On 05/26/2015 07:30 PM,

Re: Changing a form field's value during cleaning

2015-05-27 Thread Klaas Feenstra
Hi, Maybe you can solve this in the views.py with commit=False https://docs.djangoproject.com/en/1.8/topics/forms/modelforms/ And from here you can render the new form with the initial data # Create a form instance with POST data.>>> f = AuthorForm(request.POST) # Create, but don't save the