Re: django: object has no attribute 'clean_data', Help me!!!

2008-11-04 Thread Daniel Hepper
> 26. username=self.clean_data['username'] clean_data was renamed to cleaned_data. See http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Newforms:clean_datachangedtocleaned_data Regards, Daniel Hepper --~--~-~--~~~---~--~~

Re: How to log the cause of a 500 error

2008-11-05 Thread Daniel Hepper
> The problem I'm having right now is that I'm getting a 500 error > instead of 404s when Debug=False. I get 404s as expected when > Debug=True. I can't for the life of me figure out what is breaking, > since I don't have any error data to go off. Django sends you exception logs by mail if you se

Re: Newbie question: HTML formatting not applied to pages

2008-11-05 Thread Daniel Hepper
> I feel like I'm missing something simple. I read up on the autoescape > tags, but I'm not sure that's the solution. Any ideas? Can you paste your code to dpaste.com and post the link? Any ideas would be a guess without some further information. Regards, Daniel --~--~-~--~~---

Re: Installation of django in user account

2008-11-06 Thread Daniel Hepper
> On Wed, Nov 5, 2008 at 12:18 PM, Tim O'Toole <[EMAIL PROTECTED]> wrote: > > But I obviously cant do the following without root access > > > > ln -s `pwd`/django-trunk/django SITE-PACKAGES-DIR/django > > > > Whilst I can set the PYTHONPATH, I can't then write to PythonPath in > > the Apache conf

Re: URLs Syntax Error

2008-09-03 Thread Daniel Hepper
t;, line 1, in TypeError: dict expected at most 1 arguments, got 2 The only thing that comes to my mind is: dict(archive_info.items() + [('template_name','blog/archive.html')] ) A bit messy though. > On Sep 3, 8:40 am, Daniel Hepper <[EMAIL PROTECTED]> wrote: > &g

Re: URLs Syntax Error

2008-09-03 Thread Daniel Hepper
Adding a comma will probably not help, because you then have 5 values in the tuple, but the expected format is: (regular expression, Python callback function [, optional dictionary [, optional name]]) Either you put the argument 'template_name' into the archive_info dict or you make two separate

Re: DjangoCon video

2008-09-12 Thread Daniel Hepper
I'm also looking forward to the videos and just wanted to share this: "Videos should be available around Monday next week." http://twitter.com/djangocon/statuses/918620831 Daniel Am Donnerstag, den 11.09.2008, 19:25 +0700 schrieb Ronny Haryanto: > On Thu, Sep 11, 2008 at 5:28 PM, Petar Marić

Re: User subclass vs. User-Profile

2008-09-17 Thread Daniel Hepper
> But if you use the user-profile approach, how do you create a single > form for entering user data and profile data, and how do you process > this form data in a view, including user creation, without handling > each field separately, which is not in the Django (DRY) spirit? You can display two

Re: name '_' is not defined

2008-09-23 Thread Daniel Hepper
from django.utils.translation import ugettext_lazy as _ HTH, Daniel Am Dienstag, den 23.09.2008, 04:12 -0700 schrieb laspal: > Hi, > I am using 1.0 version ran into problem. > > My model : > from django.db import models > > from django.contrib.auth.models import User > > > > IPSecurity = Tr

Re: Django directory

2008-10-06 Thread Daniel Hepper
Hi, if django is in your python path, you can try: >>> import django >>> django.__file__ On a side note, it's probably not a good idea to edit anything in your django installation because you will loose these changes once you run an update. Maybe have a look at the docs how to define your own

Re: Is a Complex filter with __in and __exact possible?

2009-03-04 Thread Daniel Hepper
You can try this query: Book.objects.filter(categories=1,categories=2,categories=3) Hope that helps -- Daniel On 4 Mrz., 18:58, Alfonso wrote: > I've set up a simple filter to grab a queryset of objects matching a > list of (many to many) categories like this: > > Book.objects.filter(categori

Re: Is a Complex filter with __in and __exact possible?

2009-03-05 Thread Daniel Hepper
-04 at 15:06 -0800, Daniel Hepper wrote: > > You can try this query: > > > Book.objects.filter(categories=1,categories=2,categories=3) > > > Hope that helps > > It won't. A filter() method is a normal Python function or method call. > You can only specify each

Re: Is a Complex filter with __in and __exact possible?

2009-03-06 Thread Daniel Hepper
> > Book.objects.filter(Q(categories=1), Q(categories=2), Q(categories=3)) > > Not if you were trying to solve the original poster's question. Your > query is exactly the same as what he tried to do originally. I played a bit with the query and just wanted to clarify that it is not exactly the sa

Re: More than one DB configuration in settings.py

2009-03-17 Thread Daniel Hepper
There is a page on the wiki which list several possible solutions to this problem: http://code.djangoproject.com/wiki/SplitSettings Regards, Daniel On Mar 17, 1:59 pm, Julián C. Pérez wrote: > Hi everyone > I need some help here > I'm in a rush, so I don't took first the time to explore the boa

Re: 500 error when DEBUG = False but not True

2009-08-28 Thread Daniel Hepper
The stacktrace shows that the 500.html template is missing [1], so go ahead and create one. You should also make sure that you have configured the admin email address and settings for sending mail correctly, so Django can send you a traceback by mail when DEBUG = False Cheers, Daniel [1] http:/

Re: Problem creating object

2009-04-21 Thread Daniel Hepper
On Mon, Apr 20, 2009 at 7:48 PM, bax...@gretschpages.com wrote: > > I'm trying to manually create an object (from a signal). My problem is > that the object has a 'sites' M2M field: > > class News_item(models.Model): >    ... >    sites = models.ManyToManyField(Site) >   ... > > but when I try to

Re: django security

2008-04-03 Thread Daniel Hepper
Hi Andy, a good start is to have a look at chapter 19 in the django book, available online under http://djangobook.com/en/1.0/chapter19/ Additionally, chapter 14 covers Cross-site request forgery http://djangobook.com/en/1.0/chapter14/ Daniel On Thu, Apr 3, 2008 at 9:41 AM, andy baxter <[EMA

Django praised on Meebo blog

2008-04-22 Thread Daniel Hepper
I thought you might find it interesting that Django is used be Meebo and mentioned in a positive way on their blog: "It's worth mentioning that we've been using the Django framework to build the site and that's allowed us to move much faster than if we had hand-coded each page individually. We hi

Re: Largest django sites?

2008-04-23 Thread Daniel Hepper
You can also have a look at www.djangosites.org , it lists some sites running django. Revver (www.revver.com), a video-sharing site is one of them. On Wed, Apr 23, 2008 at 12:23 PM, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > > On 23-Apr-08, at 3:34 PM, bcurtu wrote: > > > But, turning back

Re: serving root from static

2008-06-11 Thread Daniel Hepper
> (r'^$', 'django.views.static.serve', {'document_root': '/path/to/static'}), I would not expect that to work, something like this might do the trick: (r'^$', 'django.views.static.serve', {'document_root': '/path/to/static','path':'index.html'}), I can't test that right now, ymmv. Daniel --~--

Re: Django HTML Editor

2008-06-16 Thread Daniel Hepper
There is a Dreamweaver Extension for Django template editing. http://store1.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1557518 Never tried it though, it was mentioned here on the list yesterday. Am Sonntag, den 15.06.2008, 12:36 +0200 schrieb James Matthews: > Th

Re: Model - Only allow One

2008-06-17 Thread Daniel Hepper
If you just want an editable "about" page, the flatpages app might do what you want. http://www.djangoproject.com/documentation/flatpages/ Regards, Daniel Am Montag, den 16.06.2008, 13:23 -0700 schrieb ocgstyles: > The client wants certain parts of the site to be editable, I don't > particularl

Re: Overwriting the delete() Method in a Model

2008-06-17 Thread Daniel Hepper
AFAIK, related models are not deleted by invoking delete(). A better way to recognize deletion is the use of signals, i.e. pre_delete and post_delete http://code.djangoproject.com/wiki/Signals Hope that helps. Regards, Daniel Am Dienstag, den 17.06.2008, 02:54 -0700 schrieb Daniel Austria: >

Re: Overwriting the delete() Method in a Model

2008-06-17 Thread Daniel Hepper
> It isn't very clear from that sentence which of the two methods Django > uses to delete those child records, but looking at the code, it seems > to be method #2. Since it's using the more-efficient batch delete, no > custom delete methods are being called, no signals are being sent, > which is e

Re: redirect with post parameters

2008-06-17 Thread Daniel Hepper
Hi ! > I must login a user in my site than redirect to another site with 2 > parameters via post method. > It's possible do that in my registration view? This is not how a redirect works. If your view returns a HttpResponseRedirect, Django sends a HTTP 302 code back to the browser along with the

Re: How can I convert .py file to .pyc file.

2008-06-19 Thread Daniel Hepper
Python source code (.py) is automatically compiled to byte code (.pyc) when you import a module. More info here: http://effbot.org/zone/python-compile.htm However, it seems that pyc files can still be decompiled, google for "uncompile pyc" for more info. HTH, Daniel Am Donnerstag, den 19.06.2

Re: How can I convert .py file to .pyc file.

2008-06-19 Thread Daniel Hepper
> Try py2exe www.py2exe.org Besides being Windows only, Py2Exe just bundles your byte code with an interpreter in a convenient package. The byte code can still be extracted and decompiled. It just raises the bar. FWIW, I think if you use an interpreted language, you just have to live with the fac

Re: A little help with an idea

2008-07-03 Thread Daniel Hepper
Hi Bryan, maybe I don't quite get what you are trying to do. URLs like www.mysite.com/Foo/ don't relate to filesystem paths (like /home/django/Foo). They are mapped to python functions. This might confuse you if you come from a PHP background. Usually you don't clone project, apps or any kind of

Re: deleting a session

2008-07-03 Thread Daniel Hepper
Try: for key in request.session.keys(): del request.session[key] Regards, Daniel Hepper Am Mittwoch, den 02.07.2008, 20:57 -0700 schrieb Bobby Roberts: > > for key in request.session: > > del request.session[key] > > > I get the following error: > > Exc

Re: A little help with an idea

2008-07-03 Thread Daniel Hepper
Hey Bryan, > So basically when I roll it out, the website would have no blogs on > it, just a front page welcoming me and possibly displaying some > statistics or news on it and allowing register/login. So if I were > the first to create an account, I would gain access to > www.mysite.com/bbeau

Re: common problem: set author, update date on save

2008-07-08 Thread Daniel Hepper
Hi! > on saving a Post > wish to set created_on and updated_on You can use a date time field with auto_now_add one with and auto_now for that. http://www.djangoproject.com/documentation/model-api/#datetimefield Regards, Daniel --~--~-~--~~~---~--~~ You received

Re: Non ForeignKey field type as

2008-07-08 Thread Daniel Hepper
You can use the choices option in your model. http://www.djangoproject.com/documentation/model-api/#choices class Details(models.Model): ... PROJECT_TYPES = ( ('A', 'Type A'), ('B', 'Type B'), ) project_type = models.CharField(max_length=30,choices=PROJECT_TYPES)

Re: not allowing me to login to admin site

2008-07-08 Thread Daniel Hepper
Hi! When you change the password with phpmyadmin, did you consider that passwords are not stored in plaintext, but as salted hashes? You can try to set it to this value: sha1$3a68b$7fbea95491a9d04e3cf647d5c8e675da69e1d458 This should set your password to 'passwort' (without apostrophes). Altern

Re: How to force user login before do anything

2008-07-08 Thread Daniel Hepper
Writing a middleware is probably a good solution. You can use this one: http://superjared.com/entry/requiring-login-entire-django-powered-site/ HTH, Daniel Am Dienstag, den 08.07.2008, 02:13 -0700 schrieb [EMAIL PROTECTED]: > Django offers @login_required to redirect user to login method. > But

Re: Apache2 displays django app as a file list

2007-03-12 Thread Daniel Hepper
Try to set PythonPath to the path where your project lives, not to your django installation: Replace : PythonPath "['/home/mike/downloads/trunk/'] + sys.path" with: PythonPath "['/home/mike/www'] + sys.path" I hope that does the trick. Am Sonntag, den 11.03.2007, 09:35 -0700 schrieb Mikey: > I

Re: Starting a new, external process

2007-03-14 Thread Daniel Hepper
Hi! I had exactly the same problem. I solved it by having Django write the Video file to a directory. In the background, a process checks every couple of seconds if there is a new FLV to convert. This process is completely independent of Django. You might want to start it with an init.d script or

Re: django structure and basic flow

2012-03-16 Thread Daniel Hepper
> I am confused that different tutorial gives different method of doing > things. I want to know how to setup basic cms site, > what folder should I create, sometime people create apps, sometimes > they don't. There are different ways to structure your project, but if you want to use the database

Re: Templates Directory Question

2011-01-03 Thread Daniel Hepper
You can put the templates anywhere you want, by a good place is a directory named templates in the base directory of your project, i.e. C:\DjangoProjects\mysite\templates\ Don't forget to add this path to the TEMPLATE_DIRS variable in your settings.py. The template file from the example would be

Re: Constant Invalid HTTP_HOST header spam

2017-12-19 Thread Daniel Hepper
>From my understanding, deciding which certificate to use and actually serving the request are two separate step in Nginx. I assume you only have one valid domain name you want to serve. Every other HTTPS request will result in a certificate warning and should be rejected. You could try a confi

Re: 'Question' object has no attribute 'choice_text'

2017-12-24 Thread Daniel Hepper
Are you sure your polls/models.py is correct? I assume you are at „Part 2: Playing with the API“. Here is what your polls/models.py should look like at this point of the tutorial: https://github.com/consideratecode/django-tutorial-step-by-step/blob/2.0/2.4/mysite/polls/models.py My guess is that

Re: How do I exactly change from SQLite to MySQL ?

2018-01-15 Thread Daniel Hepper
Hi Daniel, you can use SQLite locally and MySQL on Heroku. On Heroku, your database settings must be loaded from an environment variable. The section on Database Configuration in Heroku's guide for setting up Django apps ( https://devcenter.heroku.com/articles/django-app-configuration#database-co

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

2018-01-21 Thread Daniel Hepper
It's not the new project referencing the old project, it is actually your browser caching the redirect from http://127.0.0.1:8000/ to http://127.0.0.1:8000/catalog/. Because it is a permanent redirect, your browser won't access http://127.0.0.1:8000/, it will go http://127.0.0.1:8000/catalog/. You

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

2018-01-21 Thread Daniel Hepper
I realized that the Mozilla tutorial is a wiki, so I took the liberty to remove the "permant=True" from the redirect. On Sun, Jan 21, 2018 at 6:23 PM, Daniel Hepper wrote: > It's not the new project referencing the old project, it is actually your > browser caching t

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

2018-01-21 Thread Daniel Hepper
ote: > > That got it Daniel...thanks for the quick help. Was it " permanent=True" > in particular that was the problem? > Thanks again, > Doug > > On Sunday, January 21, 2018 at 10:29:33 AM UTC-7, Daniel Hepper wrote: >> >> I realized that the Mozilla tutor

Re: Django first app

2018-01-23 Thread Daniel Hepper
Here is a repository that follows the tutorial step by step: https://github.com/consideratecode/django-tutorial-step-by-step/ You can compare your code to what it should look like at the step where you are stuck. Alternatively, post your code and the exact error message here, as others have su

Re: Django first app

2018-01-23 Thread Daniel Hepper
You are using the new syntax to define URLs from Django 2.0 with the old urls() method. If you are using Django 2.0, polls/urls.py should look like this: from django.urls import path from . import views urlpatterns = [ # ex: /polls/ path('', views.index, name='index'), # ex: /polls/5/

Re: App 'polls' could not be found. Is it in INSTALLED_APPS?

2018-02-03 Thread Daniel Hepper
Well, did you check if the app „polls“ is in INSTALLED_APPS? Assuming you are refering to the step „Activating models“ in the Part 2 of the tutorial, make sure you made the correct changes in your settings.py. https://docs.djangoproject.com/en/2.0/intro/tutorial02/#activating-models You can dou

Re: Tutorial 2 - Ver2.0 - python manage.py makemigrations polls - Error message when running

2018-02-04 Thread Daniel Hepper
Hi, you have a typo in your models.py in this line: votes = models.InterferField(default=0) It should be IntegerField. Cheers, Daniel CanuckT schrieb am So. 4. Feb. 2018 um 21:06: > Hi, new to programming and trying the tutorial out for Django. > > Using this guide: https://docs.djangoproj

Re: How to understand below html code?

2018-03-27 Thread Daniel Hepper
Hi, I just want to chime in and clarify that while Django does indeed support Jinja2, it is not the default template language. Django comes with its own template language, which is used in the tutorial, the documentation and probably most articles related to Django. The documentation gives a goo

Re: Django tutorial 2.0 problem on admin site

2018-03-28 Thread Daniel Hepper
My guess is that there is a problem with your URL definition. Double-check your mysite/urls.py and polls/urls.py When in doubt, post the source of both files (preferably as text, not screenshot). Hope that helps, Daniel On Wednesday, March 28, 2018 at 6:25:12 PM UTC+2, Zhizhong Kang wrote: > >

Re: url () to path()

2018-05-02 Thread Daniel Hepper
Hi! First of all, you still can use regular expressions to define URLs by using django.urls.re_path. You could even the old django.conf.urls.url, which is still available, so you don't have to change any existing code. What you are asking for is the corresponding path converter to a regular expre

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 Daniel Hepper
I kind of agree with James, but I think a) that the exception message is not really self-explanatory and b) the instructions in the tutorial at this point are somewhat unclear. You started a plain Python shell with the command "python". You should have used "python manage.py shell" instead, as was

Re: While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to reso

2018-05-11 Thread Daniel Hepper
The error message is a hint that Django is not properly initialized. My guess is that you are using a plain python shell, which you started using the command „python“. Use „python manage.py shell“ instead. As explained in part 2 of the tutorial, this properly initializes Django. Hope that help

Re: First Django app tutorial

2018-05-14 Thread Daniel Hepper
Your template looks fine, and as the question_text is displayed correctly, it probably safe to assume that your view is correct too. Two things you can check: - does this question actually have any related choices? You can check in the admin. - check your models.py if you actually named the model

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

2018-05-16 Thread Daniel Hepper
That's definitely PyCharm, Django does not modify your settings file. I'm a big fan of PyCharm myself, but when following the tutorial, I would suggest using its more advanced features and use like a plain text editor to avoid any confusion. On Wed, May 16, 2018 at 2:00 PM, Paolo Chilosi wrote

Re: ImportError : cannot import name include

2018-05-17 Thread Daniel Hepper
You are using Django 1.11 with the tutorial written for Django 2.0. Therr should be a version picker on the bottom right of the tutorial. You are seeing this error because the way to import ‚include’ has changed from 1.11 to 2.0 Hope that helps, Daniel > Am 17.05.2018 um 19:34 schrieb Tristan

Re: ImportError : cannot import name include

2018-05-18 Thread Daniel Hepper
Your problem is right here: > django-admin --version 1.11.13 You are using Django 1.11. The documentation you are using refers to a newer version of Django, version 2.0. Use the right documentation for your version of Django: https://docs.djangoproject.com/en/1.11/ You are seeing this specific

Re: Page not found (404).Please check i am unable to run server.It is showing error

2018-05-25 Thread Daniel Hepper
What would you expect the server to display for that URL? — Daniel > Am 25.05.2018 um 19:18 schrieb Avitab Ayan Sarmah : > > In my windoes powershell: > > PS C:\Users\AVITABAYAN\mysite> python manage.py runserver > Performing system checks... > > System check identified no issues (0 silenced).

Re: Advice: django deploy vps error 502

2017-03-07 Thread Daniel Hepper
won't help against a proper DDoS attack. Note that if you configure request limiting, that one person running ab will see errors, but the site will still work for anyone with a different IP address. Hope that helps, Daniel Hepper https://consideratecode.com On Thursday, March 2, 2017 at 6:

Re: Django queryset High CPU Usage

2017-03-11 Thread Daniel Hepper
In additions to the suggestions you already received from others, have a look at django-import-export. It allows you to easily export data in various formats. Hope that helps, Daniel Hepper https://consideratecode.com On Friday, March 10, 2017 at 12:06:13 PM UTC+1, Web Architect wrote: > &

Re: Is this a bug? KeyError: 'is_popup' on mysite/admin, while logging level = DEBUG. Django 1.10.6.

2017-03-11 Thread Daniel Hepper
Yes, this is normal behavior. What you are seeing is the log output for a missing template variable. Django logs these in log level debug. See https://docs.djangoproject.com/en/1.10/topics/logging/#django-template To get rid of these, you can configure the logger for the template system to only

Re: Is it good practice to access the request from a model manager?

2017-03-11 Thread Daniel Hepper
t need a middleware, have less global state and you keep your manager decoupled from the request. It's a bit more typing though :) Cheers, Daniel Hepper https://consideratecode.com On Thursday, March 9, 2017 at 1:37:20 PM UTC+1, Antonis Christofides wrote: > > So you've reb

Re: is there any way to dump all sqlmigrations automatically ?

2017-08-23 Thread Daniel Hepper
You can try this command: python manage.py showmigrations -p | sed -e 's/\[ ] \(.*\)\.\(.*\)/\1 \2/' | xargs -L1 python manage.py sqlmigrate Here is what it does: 1. "python manage.py showmigrations -p" shows all migrations in the order they will be applied as a list with checkboxes. 2. "sed

Re: Retrieving objects created in trasaction

2017-08-24 Thread Daniel Hepper
I cannot reproduce this behavior with Django 1.11 and PostgreSQL 9.6. What database are you using? Does your Bar model maybe use non-standard Manager? Can you actually fetch to objects after the transaction has finished? On Wednesday, August 16, 2017 at 8:29:09 PM UTC+2, Александр Христюхин w

Re: How rewrite query in Django ORM?

2017-08-25 Thread Daniel Hepper
You have to assign the left side of the comparison to a field name with annotate. At least I'm not aware of another way, except falling back to raw SQL. Assuming VALUE in your example is just a variable: T.objects.annotate(field_replaced=F('field'), Value('-'), Value(' '), function='replace'))

Annotating a query with comparison result e.g. F('foo') == F('bar')

2017-09-01 Thread Daniel Hepper
I'm looking for a way to build a query that resembles this: select id, user_id, user_id=7 as mine from app_status order by mine desc; (This question originally comes from a thread on Reddit). My first instinct was that it should be possible with an F expression: Status.objects.annotat

Re: Django Tutorial

2020-03-19 Thread Daniel Hepper
There seems to be an equal sign missing after “name”: path('', views.index, name='index') > Am 19.03.2020 um 14:13 schrieb Eddie Nash : > >  > I am going through the tutorial yet when I check to see if it is working, I > get this error code. Please help me fix this! > > > Exception in thread

Re: Simple subprocess help

2016-03-26 Thread Daniel Hepper
If I understand you correctly, you want to pipe the value of request.POST['post'] to the program run_pipeline.sh and store the output in a field of your instance. You are calling subprocess.Popen incorrectly. It should be: p = subprocess.Popen(['/path/to/run_pipeline.sh'], stdin=subprocess.PIP

Re: Django Forms vs Angularjs

2016-03-26 Thread Daniel Hepper
Fabio, if you are using Django 1.9, you can use the newly introduced disabled attribute on forms.Field, see https://docs.djangoproject.com/ja/1.9/ref/forms/fields/#disabled On Tuesday, March 22, 2016 at 3:36:34 PM UTC+1, Fabio Caritas Barrionuevo da Luz wrote: > > > self.fields[name].widget.at

Re: Trouble with sqlite

2018-06-11 Thread Daniel Hepper
The SQLite file does not contain any Python code, it contains the database. It is stored in a binary format which you can't look at with a text editor. You will need a special program to look at the contents of this file, a quick Google search brings up https://sqlitebrowser.org/ Hope that helps,

Re: manage.py linux mint TypeError

2018-07-10 Thread Daniel Hepper
Your model class definition is wrong. It should be: class Question(models.Model): On Tue, Jul 10, 2018 at 1:29 PM Forest Rally Media < bornsupercars@gmail.com> wrote: > Hi there guys! I'm pretty new to the "django" game and I'm having a little > trouble with the manage.py function of the

Re: Problem in the Django tutorial?

2018-08-21 Thread Daniel Hepper
That shouldn't be necessary, as the tutorial has you put the CSS file into the static directory in your polls app, not your project. Static files in your polls app should be found with the default settings: Django’s STATICFILES_FINDERS >

Re: path('/',views.polls_details,name="polls_details") TypeError: list indices must be integers or slices, not tuple

2018-10-11 Thread Daniel Hepper
You are missing a =. It should be: urlpatterns = [ ... ] instead of: urlpatterns[ ... ] On Thu, Oct 11, 2018 at 11:42 AM tribhuvan kishor < tribhuvankishor...@gmail.com> wrote: > please help me I am searching about this error throw out DAY . > > -- > regards > Tribhuvan Kishor Bhaskar > > --

Re: path('/',views.polls_details,name="polls_details") TypeError: list indices must be integers or slices, not tuple

2018-10-11 Thread Daniel Hepper
Happens to the best of us :) Glad I could help! - Daniel On Thu, Oct 11, 2018 at 11:54 AM tribhuvan kishor < tribhuvankishor...@gmail.com> wrote: > thanks man ... i was doing school boy error . thanks for shaving my day :) > > On Thu, Oct 11, 2018 at 3:20 PM Daniel Hepper &g

Re: Trouble With Tutorial #1 - NameError: name 'polls' is not defined

2018-12-17 Thread Daniel Hepper
Check out this repository: https://github.com/consideratecode/django-tutorial-step-by-step It's not updated for Django 2.1 yet, but the differences should not matter in your case. Hope that helps, Daniel On Sun, Dec 16, 2018 at 8:18 PM Sarthak Khandelwal wrote: > can you send your file structu

Re: 'Question' object has no attribute 'choice_text'

2021-05-07 Thread Daniel Hepper
ing below error > > 'Question' object has no attribute 'choice_set' > selected_choice = question.choice_set.get(pk=request.POST['choice']) > Can you advice > > Regards > Rishi > On Monday, 25 December 2017 at 05:22:55 UTC+5:30 Daniel Hepper wrote: >

Re: Problem when i turn debug False

2021-09-02 Thread Daniel Hepper
As far as I can tell a2hosting offers plain virtual servers. Have you read the documentation on Serving static files in production? https://docs.djangoproject.com/en/3.2/howto/static-files/deployment/ On Thu, Sep 2, 2021 at 10:46 AM luca72.b...@gmail.com < luca72.bertolo...@gmail.com> wrote: >

Re: AttributeError

2019-10-02 Thread Daniel Hepper
You have a typo in your details view: question=Question.object.get( Should be: question=Question.objects.get( Cheers, Daniel > Am 02.10.2019 um 06:38 schrieb Jorge Gimeno : > >  > > >> On Tue, Oct 1, 2019 at 9:24 PM yasar arafath Kajamydeen >> wrote: >> Hi , >> >> While try to execute

Re: MDN Locallibrary project - syntax error on 'export DJANGO_DEBUG=False'

2019-10-11 Thread Daniel Hepper
The export statement does not belong in your settings file, you are supposed to type it into your shell, like you do with “python manage.py ...” commands > Am 11.10.2019 um 15:51 schrieb fishbite : > >  > Hi there, > > I've been working on the MDN Locallibrary project and am just preparing to

Re: Why is the Django server running even when pytlinter shows that there's some bug in the code?

2019-12-03 Thread Daniel Hepper
Python is a dynamic programming language with a dynamic type system (as opposed to a static type system like for example Java), see https://en.wikipedia.org/wiki/Dynamic_programming_language Among other things, that means that type checks are done during runtime. That means, if Item really does n

Re: Difficulty with Tutorial Part 2

2019-12-09 Thread Daniel Hepper
You can fix your code by changing datetime.timedelta to timedelta: *def* was_published_recently(self): return self.pub_date >= timezone.now() - timedelta(days=1) The statement "from datetime import datetime, timedelta" imports the classes datetime and timedelta from the module dateti

Re: Removing Hardcoded urls in Templates

2019-12-10 Thread Daniel Hepper
It should be {% url 'polls:detail' question.id %} I think you mixed up the steps "Removing hardcoded URLs in templates" and "Namespacing URL names" Hope that helps, Daniel On Tue, Dec 10, 2019 at 11:58 AM Bruckner de Villiers < bruckner.devilli...@gmail.com> wrote: > Running Django 3.0 & Python