Re: where to report django issues?

2019-09-22 Thread James Schneider
>From the main website: https://code.djangoproject.com/ Also from the FAQ: https://docs.djangoproject.com/en/2.2/faq/help/#i-think-i-ve-found-a-bug-what-should-i-do https://docs.djangoproject.com/en/2.2/internals/contributing/bugs-and-features/#reporting-bugs HTH, -James On Sun, Sep 22,

Re: Reverse for 'modification' with no arguments not found issue

2019-08-31 Thread James Schneider
> > The line with a problem is that one > > return render(request, 'insertion/modification.html', locals()) > > > > And I really can't figure it out why, according the fact that "locals()" > contains my variable and even if I send directly my variable instead, I get > the same ! > There's

Re: Reverse for 'modification' with no arguments not found issue

2019-08-28 Thread James Schneider
On Wed, Aug 28, 2019, 2:00 AM Ali IMRANE wrote: > Thanks James for your help. > > Indeed, I tought about that problem but I already managed to see an number > on an other page, as well as using that ID to read information behind my > informations (as you can see in the third line I gave on

Re: page not found but url exists

2019-08-26 Thread James Schneider
> Using the URLconf defined in bnt.urls, Django tried these URL patterns, > in this order: > >1. admin/ >2. [name='home'] >3. /login [name='clogin'] >4. /login/customer [name='cpage'] >5. /register [name='cregister'] >6. /register/customer [name='cpage'] > > The current

Re: reload the page and the logged in user converted to the admin

2019-08-24 Thread James Schneider
> request.user there is a current user, but if I reload the page, the > currennt user converted to the admin ? > Enter code here... > def countries_rate(request): > auth_user = request.user > if request.user.is_authenticated: > auth_user = request.user > if

Re: Get queryset outside models.py

2019-08-23 Thread James Schneider
> > > I would like to know if it is possible to retrieve *models*.mymodel > instance from outside the models.py to retrieve a queryset. > Yes, a vast majority of the time you'll be retrieving instances from your views and templates. There are only a few cases where you would retrieve instances

Re: Hello, everybody! I've tried using FormMixin with DetailView and I get error 405 on post method. Can anybody help me? Thanks a lot.

2019-08-22 Thread James Schneider
Post the full error message and/or traceback reported by the server when the error occurs. -James On Thu, Aug 22, 2019, 12:31 PM Catalina Popescu < catalina.t.pope...@gmail.com> wrote: > views.py > > class BookDisplay(DetailView): > model = Book > template_name =

Re: Reverse for 'modification' with no arguments not found issue

2019-08-22 Thread James Schneider
> > lire.html > ... >type="button">Editer larequête > ... > > urls.py > path('edit/', views.view_modif, name='modification'), > error : > NoReverseMatch at /edit/1 > > Reverse for 'modification' with no arguments not found. 1 pattern(s) tried: > ['edit/(?P[0-9]+)$'] > > Request Method: GET >

Re: Syntax Error django, python issue

2019-07-28 Thread James Schneider
On Sun, Jul 28, 2019, 10:54 AM Kean wrote: > Hi Chetan > > pls see setup below > It looks like you may have copied in the ellipses (...) from the example. Remove those lines and try again. -James > -- You received this message because you are subscribed to the Google Groups "Django users"

Re: How to set (global) context value from a templatetag?

2019-07-28 Thread James Schneider
> > > > from django.template import RequestContext; rc = RequestContext(request) > > > rc contains all the context that had been passed on to TemplateResponse > within the view, o I want to add few more there from the template tag and > just cant figure out how. > > Thanks a lot for any ideas! >

Re: Running pending migrations in Middleware

2019-07-28 Thread James Schneider
On Sun, Jul 28, 2019, 12:47 AM David Grant wrote: > Anyone see any problems with running migrations in Middleware? > What's the actual problem you are trying to solve by doing this? This is a bad idea for a number of reasons, and I can't think of any good ones. -James > -- You received this

Re: Accessing request from form

2019-05-31 Thread James Schneider
> > Don't beat yourself up :) > It's actually slightly cathartic and humbling to do that every once in a great while. ;-) > No-one stops looking and just waits for the answer. You have to assume > your own motivation to find it is stronger than everyone else's. It is just > good manners to

Re: Accessing request from form

2019-05-30 Thread James Schneider
I always dread being the guy that responds to his own thread with "Hey guys, I fixed it." At any rate, I'm currently stuck having to create relatively empty > ModelForm shell classes for the simple reason of including a form mixin > that grabs the request before __init__() (because the ModelForm

Accessing request from form

2019-05-30 Thread James Schneider
Does anyone know a philosophical reason (or I suppose a technical one, although I don't think that's the case) why the request is not made available by default in ModelForms when using CBV's? Almost all of the models I use have "audit" fields (created_by, updated_by, etc.) that reference the

Re: set python 3.6.8 default in my ubuntu

2019-05-22 Thread James Schneider
No On Wed, May 22, 2019, 10:22 AM johnpaul mulongo wrote: > > > On Wednesday, May 22, 2019 at 3:48:16 PM UTC+3, omar ahmed wrote: >> >> hello .. >> just finished my first project with django but i can not publish it >> because my default python is python 2.7.12 and Heroku now does not support >>

Re: Sponsor subdomain pointing to part of our Django site?

2018-06-04 Thread James Schneider
On Mon, Jun 4, 2018, 12:37 PM Melvyn Sopacua wrote: > On maandag 4 juni 2018 20:40:03 CEST Richard Brockie wrote: > > > On Mon, Jun 4, 2018 at 9:01 PM Melvyn Sopacua > wrote: > > > > This isn't a problem. Neither url nor reverse is capable of returning > URLs > > > > with hostnames, at least

Re: Is it possible to instantiate a model (create an object) and flag the instance as unsaveable?

2018-06-02 Thread James Schneider
On Sat, Jun 2, 2018, 6:14 PM Bernd Wechner wrote: > I'd like to instantiate a model, and play around with it, but ensure it's > never saved. At bare minimum instantiate it, play around with it then > delete it, but ideally disable saving somehow. I imagine I can override > save() on the

Re: Django UnicodeDecodeError

2018-04-17 Thread James Schneider
> > iit's all right in unbuntu,but maybe something wrong with my windows. > Every time someone posts an error like this, it is because the hostname of the machine contains a non-ASCII character. What is the hostname? -James -- You received this message because you are subscribed to the Google

Re: Stripping HTML tags and replacing for newlines

2018-04-17 Thread James Schneider
> > > Now when I send the emails I of course want to send both text content and > HTML. My idea from the beginning was to take my HTML content and strip the > HTML tags and then send that. I did this via the django utils that strip > tags. Now this works, HOWEVER I don't get any newlines for my

Re: Can you people explain why the def _str_() method is used below?

2018-01-06 Thread James Schneider
https://docs.djangoproject.com/en/2.0/intro/tutorial02/#playing-with-the-api https://docs.djangoproject.com/en/2.0/ref/models/ instances/#django.db.models.Model.__str__ -James On Jan 6, 2018 8:32 PM,

Re: How to delete all the objects which are referring the current object without DELETE_CASCADE

2018-01-04 Thread James Schneider
On Jan 3, 2018 4:29 AM, "Jani Tiainen" wrote: Hi, As I posted on other thread you can do that using meta api. But why you want to do that manually. DELETE_CASCADE does the same thing exactly. While I don't know the motivations of the OP, one reason you may want to do this

Re: Django storing byte string for image

2018-01-03 Thread James Schneider
On Jan 3, 2018 6:16 PM, wrote: As i am doing a django rest framework API for IOS mobile app currently, my >> partner told me that he will sent me a byte string for image. Then i have >> to convert the byte into image when a user request it. > > Storing the file in the

Re: I can't print a queryset value.

2018-01-02 Thread James Schneider
My other problem is when using a queryset value in my method: This works: insert_to_db(id) But this does not: insert_to_db(id, result) Any help would be greatly appreciated :) What is the insert_to_db function? That's probably where your issue is. Without that code, there probably isn't

Re: 404 for some matching urls too (Version 2)

2018-01-02 Thread James Schneider
On Dec 31, 2017 7:26 AM, "Sundararajan Seshadri" wrote: Thanks for the support and responses. The error was due to an interesting line of code. I had a middleware where I used: match = resolve(request.get_full_path()) and this was causing the error I

Re: Django: text, font, and style

2018-01-01 Thread James Schneider
On Jan 1, 2018 6:01 PM, "Malik Rumi" wrote: I'm sorry, James. What the heck is 'steering' in this context? It's not, my phone auto corrected it to steering. It was supposed to be 'string'. -- You received this message because you are subscribed to the Google Groups

Re: Django: text, font, and style

2018-01-01 Thread James Schneider
Have you verified that object.content contains un-escaped (raw) HTML? Is it possible that the steering is being escaped before it is saved? s/steering/string/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: Django: text, font, and style

2018-01-01 Thread James Schneider
On Jan 1, 2018 2:29 PM, "Malik Rumi" wrote: Well, as I said at the beginning, I don't seem to 'get' autoescape and safe. For example, I put this in my template: {{ object.content|linebreaks|safe }} But the result in my web page is: Friday, November 17, 2017 Have

Re: 404 for some matching urls too (Version 2)

2017-12-29 Thread James Schneider
admin/ [name='index'] admin/ login/ [name='login'] admin/ logout/ [name='logout'] admin/ password_change/ [name='password_change'] admin/ password_change/done/ [name='password_change_done'] admin/ jsi18n/ [name='jsi18n'] admin/ r/// [name='view_on_site'] .. (corresponds to the tables defined)

Re: Still having trouble with django-filebrowser

2017-12-28 Thread James Schneider
However, the same treatment fails on my Windows runserver dev platform. Brand new virtualenv for Py27 and Py36 still fail to show the little browse link on the right-hand end of the Source field. Have you verified that your Windows virtualenv is not including the global system Python libraries

Re: How to parse json and display it in CBV.

2017-12-27 Thread James Schneider
On Dec 27, 2017 1:02 PM, "tango ward" wrote: Follow up question. Apologies for the continuation. I tried integrating the API from OpenDOTA https://api.opendota.com/api/h eroes. my code: import requests import json url =

Re: Search results in template

2017-12-26 Thread James Schneider
*And the result:* !DOCTYPE This is the first page - ('2017-10-09 Incentive, a further review', 0.151982) - ('2017-11-14 Pulling The Trigger', 0.151982) - ('2017-10-05 A Failure of Incentive?', 0.121585) - ('2017-10-20 spider refactor', 0.121585) And now for something

Re: Search results in template

2017-12-26 Thread James Schneider
The template context says I have a queryset I see it there. Can you post up the model for Entry? And so does the selection Yes. It appears that you will have 4 results in your queryset. I put print statements in the view: ## Quit the server with CONTROL-C. This is the value of

Re: Search results in template

2017-12-24 Thread James Schneider
On Dec 23, 2017 5:36 PM, "Malik Rumi" wrote: FIRST, James, let me say how much I *greatly* appreciate you hanging in there and trying to help me. No worries. 2nd, as to your two points about the html: a. This template, serp_list.html, is identical to ktab_list.html,

Re: Search results in template

2017-12-22 Thread James Schneider
> > > > {% for object in object_list %} >

Re: Search results in template

2017-12-22 Thread James Schneider
Here's your problem. Your results are being entered in to your header and not in to the body of the HTML. I bet if you look at the source code of the rendered page, they're all there. Scratch that, I'm thinking of not . -- You received this message because you are subscribed to the Google

Re: Search results in template

2017-12-22 Thread James Schneider
{% for object in object_list %}

Re: Search results in template

2017-12-20 Thread James Schneider
On Dec 19, 2017 5:12 PM, "Malik Rumi" wrote: I am implementing search on a local Django project: Django 1.11.5, Python 3.6.3, Ubuntu 16.04. My issue is getting the search results onto the template. I am using standard CBV for everything else in the site, but for this one

Re: Many to Many fields and through table

2017-12-19 Thread James Schneider
On Dec 19, 2017 1:53 PM, "Mark Phillips" wrote: Is there any downside to creating a through table in a many to many relationship when there isn't any "extra" related data, but there might be in the future? I have read that migrating from a simple m2m relationship to

Re: Django picks up wrong urs in application urs.py

2017-12-18 Thread James Schneider
On Dec 18, 2017 7:19 PM, "Tsuyoshi Takahashi" wrote: when application urs.py decribed as below urlpatterns = [ url('card', views.card), url('welcome', views.welcome), url('cards', views.cards), ] Django picks up "url('card', views.card)" when I enter

Re: Model Design Questions

2017-12-17 Thread James Schneider
On Dec 16, 2017 4:46 PM, "Mark Phillips" wrote: I am building an electronic document management system using django and mysql. The purpose of this system is to catalog and retrieve electronic documents. There is no inventory of the physical documents. There are about

Re: No Reverse Match Exception

2017-12-17 Thread James Schneider
Update It gives the No Reverse Error. I dont seem to understand why Instead of User.id, try user.id, capitalization matters. Trying not to confuse things, but in this instance you may instead want to use object.id, since you may be referring to a different User object than the one that is

Re: No Reverse Match Exception

2017-12-17 Thread James Schneider
On Dec 17, 2017 12:30 AM, "yingi keme" wrote: The problem is that, it works perfectly when i put the number on the template like this Update But when i do Update It gives the No Reverse Error. I dont seem to understand why Instead of User.id, try user.id,

Re: Passing parameters to SOAP Zeep client

2017-11-28 Thread James Schneider
On Nov 28, 2017 1:20 AM, "giuseppe ricci" wrote: I'm using Zeep library to query a SOAP webservice wrote in Java. My piece of the wsdl file is: This is the Django users mailing list, so we probably won't be of much help. You should investigate the support forums for

Re: reg:not able to open registration form web page

2017-11-18 Thread James Schneider
Here's how I would modify the view: views.py def SignUpFormView(request): user_form = 'SignUpForm' template_name = 'test.html' Delete the above two lines. It appears you are mixing class-based and function-based views. In this case, you are using a function-based view.

Re: reg:not able to open registration form web page

2017-11-16 Thread James Schneider
On Nov 15, 2017 8:32 AM, "'Amitesh Sahay' via Django users" < django-users@googlegroups.com> wrote: Hello Members, I am new to Django, and trying to create a mock Django registration page. I am using default Django "User" model to do that, and I am not customizing anything. Its a very simple

Re: Manager isn't available; 'auth.User' has been swapped for 'common.User'

2017-11-15 Thread James Schneider
On Nov 15, 2017 8:18 PM, "Mike Dewhirst" wrote: Any hints appreciated. I'm stumped. Traceback at the end. Many thanks Mike - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - I have a custom user based on

RE: Download a file on Django and delete it after return

2017-11-14 Thread James Schneider
On Nov 14, 2017 3:04 PM, "Matthew Pava" wrote: We can download PDFs in our project. We start out generating the PDF on the server. We read the contents of it into a variable to put it into memory. Then we delete the file on the server (it’s still in memory), and the

Re: Rails User management system to django user management system for REST API

2017-11-12 Thread James Schneider
On Nov 11, 2017 10:55 PM, "Asif Saifuddin" wrote: Hi, I have and existing live project running on rails. I have to expose the API's using django for now. I have generated models and edited them to create django model and mapping and exposed some API locally. I have one issue

Re: Callback Function Not running

2017-11-12 Thread James Schneider
But this callback function dont get to run. The API is to issue a GET http request to the url specified as my callback url. The url specified is 'https://Jshhhtoo.localtunnel.me/callback/blue-cap' And in my urls.py i have this pattern url(r'^callback/(?P[-\w]+)/$', call_back, name='callback'),

Re: Django raising error - hostname doesnot match.

2017-11-10 Thread James Schneider
On Nov 10, 2017 3:45 AM, "Rahul Paul" wrote: Hi, I am using requests package to send a post request to an API within my application. I am using the request as : *requests.post("https://xx.xxx.xxx.xxx/my-admin/api/api2 ",

Re: Unable to use custom StaticFilesStorage

2017-11-03 Thread James Schneider
On Wed, Nov 1, 2017 at 11:35 AM, Stodge wrote: > I'm trying to add an extra directory for each app that will contain > Javascript/CSS files. I created a custom storage.py in my app containing a > copy of the code from Django's AppDirectoriesFinder class, but I changed >

Re: return jwt token as json

2017-11-03 Thread James Schneider
if user: payload = { 'id': user.pk, 'username': user.username, 'staff': user.email, 'exp': datetime.utcnow() I think that datetime.utcnow() returns a datetime object, not a string, and I don't think it can be

Re: return jwt token as json

2017-11-03 Thread James Schneider
On Oct 31, 2017 4:36 AM, "Rakhee Menon" wrote: class Login(APIView): def post(self, request, *args, **kwargs): import ipdb;ipdb.set_trace() username = request.POST.get('username') password = request.POST.get('password') user =

Re: do i always have to reload/return render a page to show the errors? if i press go back on browser, i see screens with the error message

2017-11-02 Thread James Schneider
On Thu, Nov 2, 2017 at 12:57 PM, fábio andrews rocha marques < fabioandrewsrochamarq...@gmail.com> wrote: > To use django forms is to use the django Form class and it's components on > a view? How will this solve the issue? If i use the components, don't i > have to re-render the page when a user

Re: Re-runnable sql scripts in the migrations framework

2017-11-02 Thread James Schneider
On Nov 2, 2017 4:01 AM, "Chris Wedgwood" wrote: Hi As part of my deployment process I want to be able to have some db scripts that are re-runnable For example I have some internal configuration tables that I would like to be able to change values with a merge statement in

Re: do i always have to reload/return render a page to show the errors? if i press go back on browser, i see screens with the error message

2017-10-31 Thread James Schneider
On Oct 31, 2017 11:02 AM, "fábio andrews rocha marques" < fabioandrewsrochamarq...@gmail.com> wrote: How did you use the never_cache? Because if i just put @never_cache before the def of my view: def cadastrarprofessor(request):, it's like it doesn't do anything (i am on the login page, I go to

Re: do i always have to reload/return render a page to show the errors? if i press go back on browser, i see screens with the error message

2017-10-31 Thread James Schneider
On Oct 30, 2017 4:46 PM, "fábio andrews rocha marques" < fabioandrewsrochamarq...@gmail.com> wrote: Let's say i have a "register a new user" View and on this page, when the user forgets to inform a password or a username, i show a message to him on the same page saying "you forgot the password".

Re: Creating a server problem

2017-10-30 Thread James Schneider
On Oct 30, 2017 9:09 AM, "md fahad" wrote: Hey I am just new to django i have a problem using the term "from django.http import HttpResponce it is showing error to it so plz help me out Check your spelling: from django.http import HttpResponse -James -- You received

Re: MultipleChoiceField records down choices as a list, but CharField converts them to a list?

2017-10-30 Thread James Schneider
On Thu, Oct 26, 2017 at 7:54 AM, Jack wrote: > I have a model field for choosing multiple options. Here is the code for > models and forms: > > *models.py:* > CONDO_APARTMENT = 'Condo Apartment' > DETACHED_HOUSE = 'Detached House' > SEMI_DETACHED =

Re: Django 11 ImproperlyConfigured: AUTH_USER_MODEL refers to model 'authex.UserProfile' that has not been installed

2017-10-30 Thread James Schneider
> > File "/Library/Python/2.7/site-packages/django/contrib/auth/forms.py", > line 22, in > UserModel = get_user_model() > File "/Library/Python/2.7/site-packages/django/contrib/auth/__init__.py", > line 198, in get_user_model > "AUTH_USER_MODEL refers to model '%s' that has not been

Re: Passing 3 user inputs as argument in url, for a search form

2017-10-25 Thread James Schneider
On Wed, Oct 25, 2017 at 11:29 AM, Jack wrote: > I am building a search form where the user inputs 3 values on a form, and > I search the database for all records that match the 3 inputs. Right now I > am stuck on the user input part. > > If you look at my *urls.py*, you

Re: Adding several user models

2017-10-25 Thread James Schneider
> When you say 'share the database', are you referring to the same database > server but separate database instances? Or are you expecting both projects > to access the same tables in the same database instance? > It will be the same tables in the same database instance. You like to live

Re: Adding several user models

2017-10-24 Thread James Schneider
On Oct 24, 2017 3:46 AM, "Andréas Kühne" wrote: Hi all, I would love to pick your collective brains for a second. I am working on an application that will be first and foremost an administration system. As such there will be very few users in the system. It will have

Re: DoesNotExist behavior in db.models query.py

2017-10-23 Thread James Schneider
On Oct 23, 2017 4:06 PM, "'Aaron C. de Bruyn' via Django users" < django-users@googlegroups.com> wrote: The difference between .filter() and .get() is definitely 'by-design'. When you filter through a list of objects, you could end up with zero, one, or many objects returned. When you call

Re: How to store a key to a something that can be either a person or an organization?

2017-10-23 Thread James Schneider
On Oct 21, 2017 2:06 AM, "Antonis Christofides" < anto...@djangodeployment.com> wrote: Hello James, You are right that the correct term in everyday language for the superclass of organization and person is "entity". However, I didn't want to name it "entity" in the code, because, really,

Re: I may found a bug

2017-10-23 Thread James Schneider
On Oct 21, 2017 7:12 PM, "otloal" wrote: Hi, I think I may discovered a bug in django, but I’m not sure [03:19am] The bug is this: 1. You make a ManyToManyField related the same model in wich you are creating the field [03:20am] Example: [03:21am] > > class

Re: Generating a unique 10 digit ID for each model instance

2017-10-23 Thread James Schneider
On Oct 22, 2017 9:29 AM, "Andréas Kühne" wrote: Hi, When you say "globally unique" - I am supposing you mean within your application? What you need to do is set a field to be the primary key, see : https://docs.djangoproject.com/en/1.11/topics/db/models/#

Re: Generating a unique 10 digit ID for each model instance

2017-10-23 Thread James Schneider
On Oct 22, 2017 4:36 PM, "Mark Phillips" wrote: I thought python's uuid.uuid4 guaranteed a unique value. Am I missing something? Mark >From a practical perspective, you are correct, uuid.uuid4() will create a unique value every time. There is no guarantee, though,

Re: Generating a unique 10 digit ID for each model instance

2017-10-23 Thread James Schneider
On Oct 22, 2017 8:52 AM, "Jack Zhang" wrote: Let's say I have a model called 'Dogs'. Users can create instances of Dogs. For every Dogs instance that is created, I want to assign a globally unique ID to it. The ID will be 3 capitalized letters followed by 7 numbers.

Re: Generating a unique 10 digit ID for each model instance

2017-10-22 Thread James Schneider
On Oct 22, 2017 12:29 PM, "Andréas Kühne" wrote: Hi, I think you are correct with your pseudocode - you can do a Model.objects.filter(unique_code==random_code).count() - and then loop on that. It should work. I wouldn't do this, it can lead to a race condition

Re: Django Forms

2017-10-21 Thread James Schneider
Since each form is set to only allow you to select 1 multiple choice option, if I add many forms in one page, I can only select one option overall. So if I answer question 1, I can't answer any of the other questions without it unselecting question 1's answer. Does anyone know how to fix this?

Re: How to store a key to a something that can be either a person or an organization?

2017-10-21 Thread James Schneider
What I do is I create a superclass that I call Lentity (short for "legal entity", despite the fact that it could refer to a group of people and is not necessary legal) and the two subclasses Person and Organization, with multi-table inheritance. Seems silly to name a model as such given that it

Re: How to store a key to a something that can be either a person or an organization?

2017-10-21 Thread James Schneider
On Oct 20, 2017 4:15 AM, "Jani Tiainen" wrote: Hi. I've resolved such a case with two nullable fkeys and a discriminator field to tell which one fkey is used. Another option that is slightly safer is to override the save() method to set the opposing FK to None every time

Re: Tutorial part 4 - get_queryset

2017-10-17 Thread James Schneider
On Oct 17, 2017 4:44 AM, "tking" wrote: Hi, I've decided to teach myself Django and I'm enjoying the tutorial which I've so far found exceptionally detailed but I'm a bit confused by the get_queryset function in the IndexView class. Essentially my question is what calls this

Re: How do I request a new feature in 1.11.x?

2017-10-10 Thread James Schneider
On Oct 10, 2017 8:50 PM, "Chris Beck" wrote: So there is a new feature being worked on in the master branch: https://code.djangoproject.com/ticket/28668 (adding ON CONFLICT DO NOTHING support to bulk_create) How might I add a request that that feature be included in a future

Re: LDAPSearch Troubleshooting

2017-10-10 Thread James Schneider
On Oct 10, 2017 12:38 PM, "Ken Jenney" wrote: Good catch! I just fixed it and re-tried and it works now. I had to get past the group search but ultimately my mispellings caught me up. Thanks for all the help James! Nice. Glad to have helped. Interestingly enough, your

Re: LDAPSearch Troubleshooting

2017-10-10 Thread James Schneider
On Oct 10, 2017 11:55 AM, "Ken Jenney" wrote: I fixed the DN for the service account: AUTH_LDAP_BIND_DN = "UID=netbox,CN=users,DC=kenset,DC=priv" I've tried at least a 100 different things so far and nothing is getting me there. from django_auth_ldap.config import

Re: django project avoid reload page where work algorithm

2017-10-09 Thread James Schneider
On Oct 8, 2017 11:25 AM, "Xristos Xristoou" wrote: > In the background celery worker picks your task and executes it. It > doesn't matter how long that takes. Once task is completed worker waits for > next task. > > Every task gets id which you can return to frontend and

Re: LDAPSearch Troubleshooting

2017-10-09 Thread James Schneider
On Oct 8, 2017 9:44 PM, "Ken Jenney" wrote: 1) I'm using a service account. I verified the DN's by connecting using Apache Directory Studio. I'm assuming this means that you only verified that your intended DN strings are valid and that the passwords for both the service

Re: tox?

2017-10-09 Thread James Schneider
On Oct 8, 2017 3:21 PM, "Christophe Pettus" wrote: On a Django-related project I maintain, someone's submitted a PR that includes a tox.ini file. I'll admit I've not used tox before; how standard is it for Django testing? I like the idea of being able to run tests against

Re: LDAPSearch Troubleshooting

2017-10-08 Thread James Schneider
On Oct 8, 2017 7:33 PM, "Ken Jenney" wrote: I've got LDAPSearch configured to work with my Synology Directory Server. Users can authenticate fine but when I try to map a user to a group I get INVALID_CREDENTIALS: Are you binding to LDAP using the users' credentials, or do

Re: Implementation Advice: Categories and Product Specifications

2017-10-05 Thread James Schneider
On Oct 2, 2017 11:07 AM, "Paul" wrote: I have Product and Categories. A product can be in multiple categories and off course a Category have multiple products. Many to many relationship, likely with a custom 'through' model so you can attach other fields to the

Re: There is any way to prevent cascade delete on FK field, without using signal?

2017-10-04 Thread James Schneider
On Oct 4, 2017 4:36 AM, "Fellipe Henrique" wrote: I read the docs, but doesn't work for me... still delete the record... I looking something directly to model, not using view... there's any way to do that? What exactly did you "do"? The on_delete keyword is applied at the

Re: QueryDict and unicode

2017-10-04 Thread James Schneider
On Oct 2, 2017 1:53 PM, "Alexey Lozickiy" wrote: Hi all, Why is it so that QueryDict for PY3 handles input query string different from PY2 (part of __init__ of QueryDict from Django 1.11.5): if six.PY3: if isinstance(query_string, bytes): # query_string

Re: django.urls.exceptions.NoReverseMatch: Reverse for 'index' not found. 'index' is not a valid view function or pattern name.

2017-09-28 Thread James Schneider
On Sep 27, 2017 8:59 PM, "harsh sharma" wrote: i m a noob in django And i dont know why i am getting this error my views.py file: from django.shortcuts import render,render_to_response from django.http import HttpResponse from all.models import ALL from

Re: Guidance for contributing to django

2017-09-25 Thread James Schneider
On Sep 25, 2017 2:05 PM, "KUNAL SINGHAL" wrote: As our minor project for the year, we were asked to contribute to Django. However, the problem with this is that I don't really know where to start. I have read the documentation, but still need guidance about what to do,

Re: Rendering DataBase Image File

2017-09-25 Thread James Schneider
On Sep 24, 2017 11:55 AM, "yingi keme" wrote: Okk. I will like to know how to set the MEDIA_ROOT and MEDIA_URL.? And then, my images are uploaded to a directory named 'img' inside my static files directory. Does it affect how you set the MEDIA_ROOT and MEDIA_URL? Yes. The

Re: capturing url pattern from html forms

2017-09-23 Thread James Schneider
On Sep 23, 2017 1:27 PM, "Mel DeJesus" wrote: Unfortunately, I didn't show my entire URLpatterns list, and the ^item/$ seems to interfere with the ^$ of the previous: Any suggestions for a work around? thanks again. from django.conf.urls import include, url from

Re: best practices for location of start up code

2017-09-23 Thread James Schneider
On Sep 22, 2017 2:58 PM, "Larry Martell" wrote: We have some code we want to run 1 time when our django app is started. What is the best place for this? I tried putting it in my app's config function, but from there I get: *** AppRegistryNotReady: Apps aren't loaded

Re: Django - Best option to check file types, even fake or without extensions

2017-09-22 Thread James Schneider
On Sep 21, 2017 11:23 PM, "Paul" wrote: I'm trying to validate mime types of files uploaded with a predefined list of validate mime types. I need to do the check the file in the buffer before save, even if they are faked or no extensions. You're better off specifying

Re: coming back to register user page after not filling a text field is causing the already filled text fields come with an annexed "/" at the end of the values

2017-09-21 Thread James Schneider
On Thu, Sep 21, 2017 at 11:07 AM, fábio andrews rocha marques < fabioandrewsrochamarq...@gmail.com> wrote: > Solved it: If i remove the "/" from all my tags, it's solved. > Before: > nomeusuariocadastro }}/> > After: > nomeusuariocadastro }}> > You should be encapsulating the value of

Re: Mark as deleted instead of actually deleting in DeleteView

2017-09-21 Thread James Schneider
On Sep 21, 2017 2:39 AM, "Rakhee Menon" wrote: Hello Everyone , Can anyone tell me how to write views where, when clicked on delete button the data shouldn't get deleted only the flag should turn 0 Just use a standard update view that toggles the field that you are

Re: How to install mod_wsgi after upgrading to python3.5 from python2.7

2017-09-15 Thread James Schneider
On Sep 15, 2017 2:04 AM, "BIJAL MANIAR" wrote: Hi, I had a production application running with Python2.7 and Django1.11 through Apache and mod_wsgi. Now I have upgraded to Python3.5 and created virtual env. pip install mod_wsgi is giving below error. (p3_venv) bash-4.1# pip

Re: django custom authentication

2017-09-15 Thread James Schneider
, However, when i try to access my homepage,i expect it to render my custom login page(login.html). But it always say TemplateDoesNotExist. I also tried putting the template folder inside an app. But the login page doesnt get rendered still. I need help urgently.Thanks The error page

Re: View to download a tar archive

2017-09-14 Thread James Schneider
On Sep 14, 2017 3:48 PM, wrote: Hey guys, I'm trying to make a view so that my users can download a compressed tar archive. I've seen a ton of examples about downloading files yet cannot seem to find anything regarding tar. Anyone want to drop me an awesome example?

Re: More bizarre URL behaviour after deploying

2017-09-14 Thread James Schneider
The technical issue is that a URL like this: http://domain.tld/script/path is split into these two variables by Lighttpd: SCRIPT_NAME: /script PATH_INFO: /path and Django wants this: SCRIPT_NAME: PATH_INFO: /script/path Your example is a bit misleading/lacking. Both

Re: type object 'Story' has no attribute 'object'

2017-09-11 Thread James Schneider
On Sep 11, 2017 7:20 AM, "harsh sharma" wrote: why i m getting this error :-type object 'Story' has no attribute 'object' this is my views.py file: from django.shortcuts import render,render_to_response from django.http import HttpResponseRedirect from

Re: Using data migration to create initial users errors

2017-09-09 Thread James Schneider
On Sep 7, 2017 10:36 AM, "Tim Huang" wrote: Hi Melvyn, I am lack of knowledge how to use model manager. Would you mind give a quick example? Thanks - timh There's a fairly substantial doc page for model managers:

Re: How to pre-load model data?

2017-09-09 Thread James Schneider
On Sep 9, 2017 8:59 AM, "Derek" wrote: "If you dump data directly in to models or the database, then you risk dumping in data that hasn't been evaluated by your application which may produce subtle bugs of the worst kind where things work in dev and break in prod because

Re: How to pre-load model data?

2017-09-08 Thread James Schneider
On Sep 8, 2017 12:12 PM, "Mark Phillips" wrote: Thanks for all your replies and helpful suggestions. To answer some of your questions - 1. Where is the data coming from? - It is textual data in a spec/spreadsheet. The data is a lot of meta data (name and one or more

  1   2   3   4   5   6   7   8   >