Re: do i need a custom admin app or should i just use django admin?

2019-06-17 Thread James Farris
rmissions - > are there any examples someone can point to help illustrate? > > > > On Monday, June 17, 2019 at 11:40:53 AM UTC-5, James Farris wrote: >> >> Think of the Django Admin as a tool for developers or Database Admins. >> IMO, it should never be use

Re: do i need a custom admin app or should i just use django admin?

2019-06-17 Thread James Farris
Think of the Django Admin as a tool for developers or Database Admins. IMO, it should never be used by an end user. Create views as Andreas mentioned and give those views permissions. On Monday, June 17, 2019 at 4:12:53 AM UTC-7, Arya wrote: > > i'm planning to build a full ecommerce business

Re: my file uploads missing/deleted

2019-06-13 Thread James Farris
ot;/app/.heroku/python/lib/python3.6/site-packages/django/core/files/storage.py" > in get_storage_class > 358. return import_string(import_path or > settings.DEFAULT_FILE_STORAGE) > > File > "/app/.heroku/python/lib/python3.6/site-packages/django/utils/module_loadin

Re: my file uploads missing/deleted

2019-06-13 Thread James Farris
When you run the server does it give you any errors? On Thu, Jun 13, 2019 at 8:12 AM omar ahmed wrote: > i added django_dropbox_storage in installed apps in settings.py > what should i add else ? > thanks > On Thursday, June 13, 2019 at 4:43:23 PM UTC+2, James Farris wrote: >

Re: my file uploads missing/deleted

2019-06-13 Thread James Farris
ings] > i found this error > ModuleNotFoundError: No module named '[--settings=test_settings]' > and when i tried to open my site (club page that has image) i foun this error > No module named 'StringIO' > i searched at Google but no similar issues > >> On Thursday, June 13, 2019

Re: my file uploads missing/deleted

2019-06-12 Thread James Farris
you mean in any view function that will show page included images add > connect_to_dropbox() > and what about > > for entry in dbx.files_list_folder('').entries: > print(entry.name) > > > > On Thursday, June 13, 2019 at 12:38:11 AM UTC+2, James Farris wrote: >>

Re: my file uploads missing/deleted

2019-06-12 Thread James Farris
= dropbox.Dropbox('YOUR_ACCESS_TOKEN') > > dbx.users_get_current_account() > Try some API requests > > for entry in dbx.files_list_folder('').entries: > print(entry.name) > > where should i write these commands ? > thanks > > On Wednesday, June 12, 2019 at 1:13:11 AM UTC+

Re: my file uploads missing/deleted

2019-06-11 Thread James Farris
/backends/dropbox.html On Tue, Jun 11, 2019 at 2:17 PM omar ahmed wrote: > yes James you are right i need to upload images using the Django > admin, ... how can i use Dropbox for this issue ? > i need a good tutorial > > On Tuesday, June 11, 2019 at 6:14:10 PM UTC+2, James Farris

Unknown column 'boericke_joints.id' in 'field list

2019-06-11 Thread James Farris
If the database was originally created by Django, it would have been built with an ID field. Django is confused because it can’t find that field in the database. If you added ID to the model, did you run python manage.py makemigrations and then python manage.py migrate -- You received this

Re: my file uploads missing/deleted

2019-06-11 Thread James Farris
He is saying these aren’t static files. It sounds like he uploads them using the Django admin, which of course is like an end user on a client uploading files to the media directory. Since that is the case it sounds like the Dropbox option is the best. Documentation was provided earlier. So

Module lock error when starting development server

2019-06-11 Thread James Farris
Do you have a venv running in another venv? You could try installing and running gdb https://wiki.python.org/moin/DebuggingWithGdb It may give you more insight. But Deadlocking is essentially one python process clobbering another causing the app to lock up. -- You received this message

Re: mysqlclient installation error

2019-06-11 Thread James Farris
I have Django 2.2.x running with mysqlclient successfully mysql-connector-python==8.0.15 mysqlclient==1.3.13 -- 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

Re: This site can’t be reached 127.0.0.1 refused to connect.

2018-06-05 Thread James Farris
What’s the actual error? Did you mean ALLOWED_HOSTS? If so you can just add: ALLOWED_HOSTS=[‘*’] On Tue, Jun 5, 2018 at 12:55 PM Jamie Roberts wrote: > Hi, > > This is from memory and may not be your problem but ... I had to add > 127.0.0.1 to ALLOWED_USERS in settings.py > > Sent from my

Re: calculate the followers difference/grow by day

2018-06-05 Thread James Farris
I think you can do something like this stats = Statistics.objects.all().order_by('-last_update') latest_stat = 0 for stat in stats: print(abs(latest_stat - stat.followers)) latest_stat = stat.followers On Mon, Jun 4, 2018 at 11:24 AM, Daniel Germano Travieso < danielgtravi...@gmail.com> wrote:

Re: error: can not import the name 'path'

2018-06-05 Thread James Farris
As the previous reply suggests, what Django version are you using? Using django.conf.urls is a Django 1.11 and below utility function, Django 2.x uses this from django.urls import path *If you are using Django 1.x* this is what your urls.py should look like: from django.conf.urls import urlfrom

Re: Starting a poll

2018-05-24 Thread James Farris
If you open the app once the server is started by going to 127.0.0.1:8000 is it loading the website or are you getting a 404 error in the browser? I see the favicon 404 error all the time, but it doesn’t halt my site. It’s just django looking for a favicon. That shouldn’t break anything. Another

Re:

2018-05-23 Thread James Farris
I assume you mean TemplateDoesNotExist and I also assume you have created a templates folder in your project and have details.html in it. If that’s the case did you check your settings.py for your template settings? It should look something like this. TEMPLATES = [ { 'BACKEND':

Re: Django

2018-05-21 Thread James Farris
Start with the Django docs tutorials https://docs.djangoproject.com/en/2.0/intro/tutorial01/ On Mon, May 21, 2018 at 12:20 PM chaitanya goud wrote: > Google "full stack python " > > On 22-May-2018 12:49 am, "Shivprasad Khandapure" < > shivkhandapure...@gmail.com>

Re: need help

2018-05-19 Thread James Farris
window n 404 > error on de webpage. > On May 19, 2018 3:37 PM, "James Farris" <jamesafar...@gmail.com> wrote: > > If you set DEBUG = True > Then restart your python server then reload the page, what is the output? > > It’s best to leave debug on until you have

Re: need help

2018-05-19 Thread James Farris
t 8:32 AM, Umar Kambala <umarkamb...@gmail.com> wrote: > > I have been following de tutorials on web development but got lost on de > peronal. Wen I run my server its gud to go but it won't display de content on > de web browser. It always give me 404 error > >> On May 1

Re: need help

2018-05-19 Thread James Farris
Are you asking where DEBUG = False is? If so, it would be in your project folder/project name/settings.py Sent from my mobile device > On May 19, 2018, at 4:36 AM, Umar Kambala wrote: > > How to I set my debug = false? On my django settings.. I don't know where to >

Re: getting error while reloading the url"http://localhost:8000/polls/".The error is given below.Please tell my why i am seeing this error?

2018-05-18 Thread James Farris
What does your urls.py look like? According to the error it doesn’t appear that polls/ is defined in your urls.py file On Fri, May 18, 2018 at 10:05 AM Avitab Ayan Sarmah wrote: > Page not found (404) > Request Method: GET > Request URL: http://localhost:8000/polls/ > >

Re: ImportError : cannot import name include

2018-05-18 Thread James Farris
If you are not using a virtual env, did you install pip3? If so, since you are using puthon3 -V to get that python version, try running $ pip3 install django And see if you get a different result I think what is happening is when you run pip install it’s referencing another python version, not

Re: New project in virtual env referencing another project's default/redirected path

2018-05-18 Thread James Farris
This is where an IDE like PyCharm comes in handy. It will tell you right away that it doesn’t recognize something and will suggest importing that package. It does a pretty good job with its suggestions. On Fri, May 18, 2018 at 9:35 AM Nitin Kumar wrote: > you have to

Re: def get_queryset(self): ^ IndentationError: unindent does not match any outer indentation level

2018-05-18 Thread James Farris
The Indentation error is related to the spaces you have when you write your code. Based on looking at what you copy/pasted The indentation of your def get_queryset is different from your other def’s. Python is very picky of how much or how little you indent your code for good reason. Everything

Re: Error at login page of Django Admin

2018-05-16 Thread James Farris
Did you run python manage.py migrate on your dev server? And create a super user (python manage.py createsuperuser) On Wed, May 16, 2018 at 8:06 AM Stephen Farry wrote: > Hi All, > > I have a peculiar issue with the admin on Django. Using the Django > development

Re: Message from a django beginner user

2018-05-15 Thread James Farris
In addition to the Django docs, I recommend https://djangobook.com/ although it’s written for Django 1.11, a lot of concepts still apply. Another good website is https://tutorial.djangogirls.org/en/ Sent from my mobile device > On May 15, 2018, at 5:16 PM, Gerald Brown

Re: django 2.0 tutorial :: exception:: application labels are not unique.

2018-05-15 Thread James Farris
Just to note: Django doesn’t change the settings.py file, it only references it so it knows what configurations to load. On Tue, May 15, 2018 at 7:27 AM Paolo Chilosi wrote: > thanks for pointing out about the typo. However this was not the cause of > the exception.

Re: IOError when trying to send email in Django app

2018-05-11 Thread James Farris
You probably already have but check the docs https://docs.djangoproject.com/en/2.0/topics/email/ And your postfix configurations (or whatever email send system you are using) On Fri, May 11, 2018 at 12:07 PM Tom Tanner wrote: > I have a Django app running on a

Re: python django group

2018-05-11 Thread James Farris
What errors ? On Fri, May 11, 2018 at 4:41 PM Akinyiga Obadamilare < akinyigaobad...@gmail.com> wrote: > please, when I run my server in local host after creating my polls app in > django but it did not show the presence of polls app in my local host > instead of it to display the presence of

Re: Display Users Posts also whether it is logged in or logged out

2018-05-11 Thread James Farris
If you want to show posts, which I assume is blog posts or something (not seen in your code) You would add an additional queryset that is passed to your template Something like Posts.objects.filter(user_id=pk) Sent from my mobile device > On May 10, 2018, at 6:45 PM,

Re: Problem with debug = True/False

2018-05-11 Thread James Farris
I also recommend going through the deploy checklist. I ran into the same problem and then other problems after that because I didn’t follow this. https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/ Sent from my mobile device > On May 10, 2018, at 10:53 PM, Andréas Kühne

Re: integrating themes in django

2018-05-10 Thread James Farris
re it has been > implemented . > > On Thursday, May 10, 2018 at 12:48:44 PM UTC+5:30, James Farris wrote: >> >> Unless someone knows of an easier way, you will have to do some work to >> get html/css/js themes integrated as you will have to create templates for >>

Re: integrating themes in django

2018-05-10 Thread James Farris
Unless someone knows of an easier way, you will have to do some work to get html/css/js themes integrated as you will have to create templates for html and a static directory for css and js. Then hook the css and js into the template files you create. It's not like a Drupal or Wordpress site

Re: Getting error in migrate

2018-05-09 Thread James Farris
To be absolutely clear, you need to make sure if you made changes to models.py you need to run $ python manage.py makemigrations Then $ python manage.py migrate -James Sent from my mobile device > On May 9, 2018, at 11:26 AM, Pradeep Sharma > wrote: > > Did u

Re: While going through the django tutorial i found error while scripting automated testing.The code and exeptions are mentioned below. Please find what is the error .

2018-05-09 Thread James Farris
Instead of giving the answer, I suggest looking at the Traceback section you posted below because the answer is there. Giving you the answer will not help your trouble shooting skills. Sent from my mobile device > On May 9, 2018, at 8:03 AM, Avitab Ayan Sarmah wrote: >

Re: Working through the Django tutorial and have run into a problem I cannot figure out. Help would be appreciated. What am I missing here? whenever is search the url "http://127.0.0.1:8000/polls/" th

2018-05-03 Thread James Farris
In looks like there is a syntax error also in your polls/urls.py Your missing the opening < This: path(‘int:question_id>/vote/', views.vote, name='vote'), Should be this: path('/vote/', views.vote, name='vote'), On Thu, May 3, 2018 at 10:12 AM Avitab Ayan Sarmah wrote: >

Re: How can I use a variable from the instance of my data in the upload path for a FileField in my model?

2018-05-03 Thread James Farris
I did something very similar in my models.py. I think for the date you have to get the year, month with datetime. def get_upload_path(self, filename): return 'pictures/{0}/{1}'.format(self.user.username, filename) pet_image = models.ImageField(upload_to=get_upload_path, blank= True) On Thu, May

Re: serving admin files in Apache

2018-05-03 Thread James Farris
Did you run $ python manage.py collectstatic in your project folder on the server that is running Apache? This add all css, js, and images to the static root folder you specified in settings.py On Thu, May 3, 2018 at 4:40 PM sum abiut wrote: > Hi, > I have recently setup my

Re: i'm having issues displaying parent.model.childmodel_set.all on my template

2018-05-03 Thread James Farris
If you add {{ my_users }} to your template do you get any output? If not, you’re query set has no results. On Thu, May 3, 2018 at 4:51 PM stanley oguazu wrote: > //My template is only displaying the parent table, and not displaying > child table > > You received this message

Re: Need help: django-admin.py startproject [projectname] creates directory which I cannot access

2018-05-03 Thread James Farris
If you run these two commands from your command line, what is the output? python -V django-admin.py version > On May 3, 2018, at 5:23 AM, Duška Miloradović > wrote: > > Ayser, thank you very much but that did not help neither. It is still the > same - command ends

Re: Beginning Django.

2018-04-29 Thread James Farris
This is a great online book. Although written for Django 1.11 a lot still applies. https://djangobook.com/ Sent from my mobile device > On Apr 28, 2018, at 6:39 AM, Gerardo Palazuelos Guerrero > wrote: > > Hi > A quick online tutorial? The Django girls

Re: django-admin list in readonly

2018-04-27 Thread James Farris
In Django admin I would create a group and give it permissions and add users to that group. On Fri, Apr 27, 2018 at 2:58 AM Hervé Edorh wrote: > > In django admin, we have 3 rules that we can attribute to a table we can > add, modify and delete. when you choose for an user

Re: Current user ip address on form.py

2018-04-27 Thread James Farris
This should work https://github.com/un33k/django-ipware/blob/master/README.md On Fri, Apr 27, 2018 at 5:45 AM lakshitha kumara wrote: > Hello Andréas > > Thank for your reply. but unfortunately i need get user ip on form.py or > custom py file in django. is there way

Re: Django--Making query use part of the matching name

2018-04-26 Thread James Farris
could you > please show me how to use it in my example, since I am new to django.. > > 在 2018年4月26日星期四 UTC+1上午2:14:10,James Farris写道: >> >> I believe you want to use icontains rather than contains. It’s case >> insensitive. >> >> I’m not sure without using

Re: Django--Making query use part of the matching name

2018-04-25 Thread James Farris
I believe you want to use icontains rather than contains. It’s case insensitive. I’m not sure without using regex it’s possible to return the results based on any character in any order in the search string. > On Apr 25, 2018, at 5:13 PM, shawn...@gmail.com wrote: > > Hello everyone! > >

Re: Trying to understand two messages from `manage.py check --deploy`

2018-04-24 Thread James Farris
Hi, django.middleware.security.SecurityMiddleware is missing in your settings.py file in the middleware section. Read the Django docs for more details on what they each one of the security options do. https://docs.djangoproject.com/en/2.0/ref/middleware/ Sent from my mobile device > On

Re: Django generated migration fails with KeyError for field that was removed from the model.

2018-04-19 Thread James Farris
My guess is that field is not empty in the database or it’s being called in a view or template still. Sent from my mobile device > On Apr 18, 2018, at 2:59 PM, jackotonye wrote: > > A migration generated with `python manage.py makemigrations` Fails to execute > using

Re: What were your best resources in learning programming, python, ultimately django?

2018-04-09 Thread James Farris
Early on Lynda.com was my best friend for learning basics like HTML and CSS. Then a lot of practice. Later on I took a coding boot camp in my area that really accelerated my learning and filled in a lot of the missing pieces. It covered HTML, CSS, PHP, Ruby on Rails and SQL to name a few.

Re: no styling

2018-04-09 Thread James Farris
Hi Paul, Have you read this part of the docs? https://docs.djangoproject.com/en/2.0/howto/static-files/ You will need a static files directory and will need to tell Django where it is In settings.py Sent from my mobile device > On Apr 9, 2018, at 5:04 AM, Paul Baforh

Re: A first time programmer

2018-04-07 Thread James Farris
No one can walk you through how to use Django in this group. That is too much to explain. I recommend choosing a plain text editor like Sublime Text or many others that are free in order to start working on any coding project. Then once you have that, read the documentation and follow this

Re: Storing lists from api into database

2018-04-06 Thread James Farris
I would use the Requests module. It's much nicer and comes loaded with stuff. It's a module used to connect to API's. Here's the docs: http://docs.python-requests.org/en/master/ As far as using what you have, to save it to the database is just another few lines of code. You have to import

Re: Storing lists from api into database

2018-04-06 Thread James Farris
I would use the Requests module. It's much nicer and comes loaded with stuff. It's a module used to connect to API's. Here's the docs: http://docs.python-requests.org/en/master/ As far as using what you have, to save it to the database is just another few lines of code. You have to import

Re: A first time programmer

2018-04-06 Thread James Farris
Hi, If you type this in your terminal, you should see Django==2.0.4 (or some other version) $ pip freeze If not, Django is not installed. Also, what is the syntax error you are receiving? On Friday, April 6, 2018 at 10:33:39 PM UTC, Paul Baforh wrote: > > Please programmers, how do I engage

Multiple websocket connection vs single websocket connection when using django channels

2018-04-06 Thread James Farris
I’m looking into creating an app that may utilize chat and notifications as well. I’m interested in what others have to say about this as well -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: Populate a select dropdown based on queryset

2018-03-30 Thread James Farris
dmin. > > >> On Wednesday, 28 March 2018 23:02:36 UTC+2, James Farris wrote: >> Hi, >> >> I'm trying to populate a 'vaccine' dropdown based on a 'species' of a pet. >> For example, if a pet is a 'dog' I want to display vaccines for a dog only. >> If a pe

Re: Pythonanywhere Hosting issue

2018-03-29 Thread James Farris
Where is your DNS records stored? Godaddy or pythonanywhere. It sounds like the dns records are coming from godaddy since that’s the page you see when you load the site. The way I was taught is you point your cname to an A record which points to the server where your doc root is. It sounds

Populate a select dropdown based on queryset

2018-03-28 Thread James Farris
Hi, I'm trying to populate a 'vaccine' dropdown based on a 'species' of a pet. For example, if a pet is a 'dog' I want to display vaccines for a dog only. If a pet is a cat, I want to display a list of vaccines for cats only. How do I do this? I googled, but didn't come up with anything

Getting complex query set with a many to many relationship in django

2018-02-22 Thread James Farris
I am trying to *get all article objects that are part of a section* in an edition that is in an issue. I am stumped, even after looking at the documentation for django 2.x I can get all

How to install and use Django

2018-02-09 Thread James Farris
I highly recommend installing virtualenv and virtualenvwrapper. This will reduce the stress of creating a bunch of unnecessary modules on your computer and contain each project you create in a separate environment. For example you wouldn’t necessarily want to install Django globally but rather