Re: How to modify LOGGING settings in unittest

2019-06-10 Thread panfei
Still get the same error message vineeth sagar 于2019年6月11日周二 上午2:08写道: > Try this with the override_settings decorator. like this. > > @override_settings(LOGGING_DIR='/tmp/test_logs/' > def test_function1(self): > pass > > On Mon, Jun 10, 2019 at 7:15 PM panfei wrote: > >> There is a

formset has_changed always return true.

2019-06-10 Thread Mei B
if request.method == "POST": formset = forms.Formset(data=request.POST, initial=initial) if not formset.has_changed(): #has_changed always returns true! msg = "No changes detected." if formset.has_changed() and formset.is_valid()

Re: Testing - get_object_or_404 returns 200 status code

2019-06-10 Thread Chetan Ganji
Whats your question? I failed to understand that  On Tue, Jun 11, 2019, 1:45 AM Cristhiam Gabriel Fernández < cristhiang...@gmail.com> wrote: > Hi Django super heroes > > I'm making of test cases for my simple Django application. When I test a > view with get_object_or_404 shortcut it returns

Testing - get_object_or_404 returns 200 status code

2019-06-10 Thread Cristhiam Gabriel Fernández
Hi Django super heroes I'm making of test cases for my simple Django application. When I test a view with get_object_or_404 shortcut it returns 200 status code. def my_view(self, request): obj_id = request.POST.get('id') obj = get_object_or_404(MyModel, pk=id) # Test case ...data =

Re: my file uploads missing/deleted

2019-06-10 Thread omar ahmed
almost i did all of these instructions collectstatic - DEBUG = True - install and use whitenoise in my app the problem is heroku is ephemeral ( that's mean image clubs appear and after one hour it disappear ) i want to use something like Dropbox (permenant) but i don't know how to make it my

Re: Testing - get_object_or_404 returns 200 status code

2019-06-10 Thread Cristhiam Gabriel Fernández
Hi RyuCoder Should not get_object_or_404 shortcut retry 404 status code? El lunes, 10 de junio de 2019, 15:29:24 (UTC-5), RyuCoder escribió: > > Whats your question? > I failed to understand that  > > On Tue, Jun 11, 2019, 1:45 AM Cristhiam Gabriel Fernández < > cristh...@gmail.com > wrote: >

How do you make a public user create polls on the site not just the admin

2019-06-10 Thread Progress Onyema
-- 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-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com.

Re: How to fix: Django forms: {{ form }} is not working in a dynamic html page

2019-06-10 Thread Sim
Form should be provided in context render of index view . Try this please and let me know if it worked On Sunday, June 9, 2019, Marvelous Ikechi wrote: > I couldn't find a description field in the creation of your ContactForm. > Maybe it's an oversight from me. However, if it isn't, I'm not

Unknown column 'boericke_joints.id' in 'field list

2019-06-10 Thread Rishi Raj Jain
I'm using an already existing database in mysql. When I try to list the contents of the database it gives the following error: (1054, "Unknown column 'boericke_joints.id' in 'field list'") The table doesn't contain an ID field. models.py looks like this ; class BoerickeJoints(models.Model):

Unknown column 'boericke_joints.id' in field list

2019-06-10 Thread Rishi Raj Jain
I'm using an already existing database and I followed steps in the documentation. It connects fine, but when I try to view data already in the database I get the error: (1054, "Unknown column 'boericke_joints.id' in 'field list'") I added a primary Id key that's required by django but I keep

Re: my file uploads missing/deleted

2019-06-10 Thread omar ahmed
hiii Sagar .. what is your Error ? i followed this tutorial https://medium.com/@BennettGarner/deploying-django-to-heroku-procfile-static-root-other-pitfalls-e7ab8b2ba33b if you want to connect heroku postgres continue with this

Login problems

2019-06-10 Thread Luka Nik
I can't login into my django admin. I created superuser, but django can't seem to recognize it. I tried to login, but it says the username or password is incorrect. I checked password through chrome settings, so that is ok. But username remains blank, and can't see any recognize any through python

Re: Form with CheckBoxSelectMultiple not validating

2019-06-10 Thread Sithembewena L. Dube
Thanks for responding @Joe. I had figured out what the issue was. I ended up with: ``` tour_options = forms.MultipleChoiceField( label='Select tour activities', choices=settings.TOUR_OPTIONS, widget=forms.CheckboxSelectMultiple() ) ``` Kind regards, Lloyd *Sent with Shift

How to modify LOGGING settings in unittest

2019-06-10 Thread panfei
There is a logger path for production environment, but I want to put the logs in /tmp/ in unittests. This is the LOGGING settings for production environment: LOGGING_DIR = '/data0/bridge_logs_test/' LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': {

Re: Login problems

2019-06-10 Thread Abhishek Anvekar
Create a new superuser n try On Mon 10 Jun, 2019, 6:02 PM Luka Nik, wrote: > I can't login into my django admin. I created superuser, but django can't > seem to recognize it. I tried to login, but it says the username or > password is incorrect. I checked password through chrome settings, so

Re: Login problems

2019-06-10 Thread Desh Deepak
> Hi, Luka You can create again superuser and save it. -- 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-users+unsubscr...@googlegroups.com. To post to

Re: DateInput not accepting format argument

2019-06-10 Thread Sithembewena L. Dube
Thanks @Joe. I had been trying to avoid using a third party app if I could help it. I ended up using the default Django DateTime widget as-is. Will try out your recommendation if the need arises. Kind regards, Lloyd *Sent with Shift

Re: Login problems

2019-06-10 Thread Luka Nik
Yeah, worked perfectly. Cheers On Mon, 10 Jun 2019, 3:57 pm Abhishek Anvekar, wrote: > Create a new superuser n try > > On Mon 10 Jun, 2019, 6:02 PM Luka Nik, wrote: > >> I can't login into my django admin. I created superuser, but django can't >> seem to recognize it. I tried to login, but it

Re: my file uploads missing/deleted

2019-06-10 Thread Joe Reitman
A couple of things to check. 1. Is the photo located in directory above? 2. Did you run collectstatic? 3. In your settings.py are STATIC_ROOT, STATIC_URLS and STATICFILES_DIRS configured 4. In your template you have setup like this example: {% load static %} Also, it looks like you have DEBUG

Re: Lazy evaluation of django custom context processor in base.html

2019-06-10 Thread BIJAL MANIAR
Hi, Can anyone help with django custom context processors. Have written above custom context processor that retrieves a value from database. This value has to be available in all templates as I have to pass it in "custom dimension" to google analytics. Is there an efficient way to pass this

Re: How to modify LOGGING settings in unittest

2019-06-10 Thread vineeth sagar
Try this with the override_settings decorator. like this. @override_settings(LOGGING_DIR='/tmp/test_logs/' def test_function1(self): pass On Mon, Jun 10, 2019 at 7:15 PM panfei wrote: > There is a logger path for production environment, but I want to put the > logs in /tmp/ in unittests. >