I want to associate a REST API end point to two urls, "manager" and "manager/". So I added two path entries in the urlpatterns with these urls. But it seems something that can be handled with some kind of configuration. Is there such a configuration with django? thanks

Member Avatar
Member Avatar
+0 forum 1

I'm jumping into Python/Django, and have been hitting some speed bumps. I'm a somewhat novice programmer. I know the basics, but haven't done anything more than create a PHP webform, and build very simple websites. I have a thousand questions about Django (most centering around Views and customizing the Admin, specifically as they relate to querying the DB), but I'll start with this seemingly simple one, and hopefully someone can help me out. In views.py, I begin with 'from django.http import HttpResponse'. I then create a boring function: def hello(request) return HttpResponse("Hello world") Seems simple enough, right?. While reading [the …

Member Avatar
Member Avatar
+0 forum 2

I'm trying to run a project that uses Django and uWSGI in a Docker container. But I'm new to Docker and uWSGI so I'm not quite sure how I'm supposed to do it. At first I build the project with the below command: docker build -t saleor . Then I run it: docker run --env SECRET_KEY="<the key>" -p 4000:80 saleor And this is what I get: [uWSGI] getting INI configuration from /app/saleor/wsgi/uwsgi.ini [uwsgi-static] added mapping for /static => /app/static *** Starting uWSGI 2.0.15 (64bit) on [Tue Dec 19 14:02:19 2017] *** compiled with version: 4.9.2 on 19 December 2017 09:11:22 …

Member Avatar
Member Avatar
+0 forum 2

I am wondering if anyone could recommend the best CMS for an Airbnb-style marketplace that allows people to sublet their apartments, and other people to search, filter, and pay for the apartments listed. These are the main requirements: - Ability to sign up both buyers and sellers. - Accounts for buyers can be created automatically without approval by an administrator. Seller accounts will require approval. - Sellers can have multiple listings, but each listing must be approved by an administrator before going live in the system. - For each apartment listing, seller can fill out information for a number of …

Member Avatar
Member Avatar
+0 forum 4

[Linux Mint] Linux Mint I'm following a book on Django and it has this -> https://hellowebapp.com/setup/ accompanying website. Take a look below at what I'm getting when I get to the "Start your Django project" section of the link. Here's a peak at my terminal input and feedback. (venv) user@mothership myhellowebapp $ pip install Django==1.9.6 Collecting Django==1.9.6 Downloading Django-1.9.6-py2.py3-none-any.whl (6.6MB) 100% |████████████████████████████████| 6.6MB 138kB/s Installing collected packages: Django Successfully installed Django-1.9.6 You are using pip version 8.1.1, however version 9.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. (venv) user@mothership myhellowebapp $ git init Initialized …

Member Avatar
Member Avatar
+0 forum 7

Hello. I want to insert data into django db from a function in the **views.py** file. I'm using **linux**, **python 3.4**, **django 1.8.2**, **PyMySQL**

Member Avatar
Member Avatar
+0 forum 2

Hello. With running this command: `python manage.py validate` I faced with this error: `Unknown command: 'validate'` What should I do now? For more explanations: - Linux - Virtualenv - Python 3.4.3+ - Django (1, 9, 2, 'final', 0)

Member Avatar
Member Avatar
+0 forum 1

**Bold Text Here**Hi there I'm just wondering what the best or a good table layout would be for a little project I'm trying to do at work. I work at a temp to perm agency where companies use us for the probationary peroid of employement and then hire the workers on once they have completed the necessary amount of hours at their facility. So I'm trying to set up an online application signup and management system for our jobs and employees. So basically we have many employees and many jobs and I'd like to store information about each employee and …

Member Avatar
Member Avatar
+0 forum 5

Heya guys, i've been learning python for few weeks now and it's one of the best decisions i have made in my life so far..it's quite an interesting language and very helpful for beginners, i must say..now i tried to do some tickling with django and somehow managed to install it well..When i started to create a project using this info: https://docs.djangoproject.com/en/1.7/intro/tutorial01/ i've hit a wall..Here in this info, while activating the models i tried to do the same as advised but this error always pops in my command prompt everytime i enter the instructed code..(error:) AttributeError: 'module' object has …

Member Avatar
Member Avatar
+0 forum 3

Hi All, I've just tried to get going with Django using MySQL, but linking them has been a nasty headache. I am using Python v3.5, Django v1.9 and MySQL 5.6. I've definately got MySQL/Python talking, but Django always has the problem: File "X:\Program Files\Python\lib\site-packages\django-1.9-py3.5.egg\django\db\backends\mysql\base.py", line 25, in <module> import MySQLdb as Database ImportError: No module named 'MySQLdb' Any ideas much appreciated! Matt

Member Avatar
Member Avatar
+0 forum 1

i am using cartridge-mezzanine for site but now it not saved order when i goes in complete.html it shows a "page not found error" because it can't access in order object in shop/views.py in def complete(request, template="shop/complete.html"): try: order = Order.objects.from_request(request) except Order.DoesNotExist: raise Http404 items = order.items.all() how i solve that i search a lot but can't find solution please help! Thanks in advance!

Member Avatar
+0 forum 0

Hi, I've had a rather ambitious project on my mind for as long as I've been at my job (almost a year) -- to pretty much rewrite their central application, which is a listing database/"portal", around and upon which their entire IT infrastructure and web and computing tasks and operations are haphazardly based. What they have is in ASP.NET, and their developer is not even logical and has little to no knowledge of their business model, and this "Sales Portal" is still buggy after two years in development and active use... Not to mention that the company is trying to …

Member Avatar
Member Avatar
+0 forum 1

I'm trying to write a search enigne. Nothing fancy like google or so, just a simple one for educational purposes. I have done a little research and I know that Google uses Python, Java and C++. I on the other hand know C++, PHP, some Java and C# and even less Python. I see that Ruby on Rails have a lot of heat for some reason. I am willing to know a new language and framework as long as it isn't to difficult. I want something fast, rather portable, easy to maintain and update. I have made a few web …

Member Avatar
Member Avatar
+0 forum 1

Hi, Looking for a bit of advice if possible. I have a Django website I'm trying to deploy onto a new server but the documentation I have been able to find hasnt done me much good. I have all the files loaded onto the server in the same structure as they were on the last server and the database has been imported and connected into the settings file. If possible could someone give me a few pointers on the next steps to take in order to set it live? Thanks in advance

Member Avatar
Member Avatar
+0 forum 1

Hello Guys, Good Day. I have this kind of error `OperationalError: no such table: table_name` when I make a query like `modelname.objects.all()` in **manage.py shell**. But I already did the ff: 1. settings.py > Databases > django.db.backends.postgresql_psycopg2 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), }, 'db_foo': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'db_foo', 'USER': 'user_foo', 'PASSWORD': 'pwd_foo', 'HOST': '', 'PORT': '', } } 2. manage.py syncdb 3. `from appname.models import modelname` Did I missed something to configure? Thanks. Long Live Daniweb!

Member Avatar
Member Avatar
+0 forum 1

I've been really interested in Django lately, so I came here to check out the scene on the forums, only to find there's no Python/Django subforum in Web Development. Where can I come on here for support regarding web development with Django?

Member Avatar
Member Avatar
+0 forum 3

Hey everyone. I'm new to Python and Django, and I've been trying to get Django up and running for over 10 hours now. I've scoured the web, but with very little good documentation available, I thought I'd ask others for help. I'm trying to write a program which will connect to my database, but I can't even get started because Django is throwing fits. Here is the code I'm trying to run: import os import sys from django.db import connection print(sys.path) It produces this error: from django.db import connection File "C:\Python27\lib\site-packages\django\db\__init__.py", line 11, in <module> if settings.DATABASES and DEFAULT_DB_ALIAS not …

Member Avatar
Member Avatar
+0 forum 5

models.py class Settings(models.Model): date_format = models.CharField('Date format', max_length=100) time_format = models.CharField('Time format', max_length=100) views.py for saving the date and time format in database as boolean. def date_format(request): settings = Settings.objects.get(user=request.user) settingsForm = SettingsForm(instance=settings) if request.method =='POST': settingsForm = SettingsForm(request.POST,instance=settings) if (settingsForm.is_valid()): settings=settingsForm.save() return redirect('/member/follow-up/') return render_to_response( 'incident/date_format.html', { 'about_menu': True, 'SettingsForm':settingsForm, }, context_instance=RequestContext(request)) forms.py Date_Format = ( ('0', ' dd / mm / yyyy'), ('1', 'mm / dd / yyyy'), ) Time_Format = ( ('0', ' 12 hour AM / PM '), ('1', ' 24 hour '), ) class SettingsForm(forms.ModelForm): date_format = forms.ChoiceField(widget=forms.RadioSelect(), choices=Date_Format) time_format = forms.ChoiceField(widget=forms.RadioSelect(), choices=Time_Format) class Meta: …

Member Avatar
Member Avatar
+0 forum 1

I am using django1.3.7 for developing a web application.How to display a datepicker using jquery.I am having jquery datepicker which is working fine with html.The only requirement is i am using model form,so how to render the datepicker is my question.Kindly help me in this problem. Thanks

Member Avatar
Member Avatar
+0 forum 2

Hi, I've succesfully created a new project in Python Django, but when I try to run the server using: python manage.py runserver I receive this error: Validating models... Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x10166b250>> Traceback (most recent call last): File "/Library/Python/2.6/site-packages/django/core/management/commands/runserver.py", line 92, in inner_run self.validate(display_num_errors=True) File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 280, in validate num_errors = get_validation_errors(s, app) File "/Library/Python/2.6/site-packages/django/core/management/validation.py", line 35, in get_validation_errors for (app_name, error) in get_app_errors().items(): File "/Library/Python/2.6/site-packages/django/db/models/loading.py", line 166, in get_app_errors self._populate() File "/Library/Python/2.6/site-packages/django/db/models/loading.py", line 72, in _populate self.load_app(app_name, True) File "/Library/Python/2.6/site-packages/django/db/models/loading.py", line 96, in load_app models = import_module('.models', app_name) …

Member Avatar
Member Avatar
+0 forum 1

Hi, After having come to grips with PHP, I've decided that it's time to move onto a more sophisticated language for building web applications. I've chosen Python, utilising the Django framework. Could somebody provide me with the software I will need for writing the code? My first guess would have been to use notepad++ (as I do for PHP), but it seems that many others use the command line. Are there any specific conventions? Where is the bulk of the code written? Many Thanks, Ed

Member Avatar
Member Avatar
+0 forum 1

If I make a website using Django, is there any need to use Javascript? Can Django work in place of Javascript itself?

Member Avatar
Member Avatar
+0 forum 6

I am wondering if anyone could recommend the best CMS for an Airbnb-style marketplace that allows people to sublet their apartments, and other people to search, filter, and pay for the apartments listed. These are the main requirements: - Ability to sign up both buyers and sellers. - Accounts for buyers can be created automatically without approval by an administrator. Seller accounts will require approval. - Sellers can have multiple listings, but each listing must be approved by an administrator before going live in the system. - For each apartment listing, seller can fill out information for a number of …

Member Avatar
Member Avatar
+0 forum 1

Just polling for users who are familiar with Django. Deployment? Development? Maintenance? Doesn't matter! Just trying to get a head count, maybe spawn some topics, make some friends, or whatever. Django is a pretty fantasitic project. It is extensive and documented extremely well (almost too well; reminds me of the OpenGL Red and Blue books!). For anybody working individually or in small teams, one of the biggest shortcomings of Django (IMHO), is the direct community support. So lately, I have been trying to find out where all the Django guru's are hiding, in case of emergencies :)

Member Avatar
Member Avatar
+0 forum 1

hi everyone. i'm tryng to use Reportlab to output an invoice on a simple Django app. it seems quite difficult to do simple things like this. here's my code: def print_pdf(fattura, soggetto, buffer=None): import time from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY from reportlab.lib.pagesizes import letter from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image, ParagraphAndImage from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet from reportlab.lib.units import inch static_files_dir_path = settings.SITE_ROOT+'/'+settings.CURRENT_APP_NAME+settings.STATIC_URL+'user/images/'; img_file = 'Logo_effetti.jpg' img_height = 75 img_width = 99 str_data_fatt = (fattura.data).strftime('%d/%m/%Y') fattura_file_name = str('fattura_'+str_data_fatt+'_'+str(fattura.soggetto)+'.pdf') img = Image(static_files_dir_path+img_file, img_width, img_height) styles = getSampleStyleSheet() normalStyle = styles["Normal"] nfattura_ptext = 'numero fattura: '+str(fattura.numerofattura) if buffer: doc …

Member Avatar
+0 forum 0

I have been asked to look into getting a web framework up and running here at work. I come from a PHP background and have developed a few tools various people use around the office. I have recently become part of a small team of developers who only use Python, so my PHP scripts have to go. I will be testing this on my webfaction first as they do all the installation and I can look at how easy it is to develop on these platforms. Any suggestions as to which one is the easiest to get going, keeping in …

Member Avatar
+0 forum 0

I am developing the Django application which runs the Matlab code and create some txt and png files on the server.when I run these below python command on server, it works fine but when I try to run from the server (it is coded in Viewspy).It shows file is updated.(from timestamp).But when I open the file its not updated.I checked error log and access log.But they is no error in them. [CODE]os.chdir('/var/www/djangoapps/practicum/LineShapeKin_Simulation_4.1.4/LineShapeKin_Simulation_4.1/Python/') os.system('/usr/local/MATLAB/R2011b/bin/matlab -nojvm -nosplash -nodisplay -r runscript') [/CODE]

Member Avatar
+0 forum 0

hi everyone. hi have a template with a form and many inputs that pass some data trough a POST request to a view, that process them and send the result to another template. in the final template, if i use the browser back button to jump to the first view, i can see again old data. i refresh the page, old data are flushed, and i insert new data, i submit again but some old data remains when i see the final view. the problem remain even if i restart the debug server. it seems that there's some data-caching problem …

Member Avatar
+0 forum 0

[CODE]class InspectionGroup(models.Model): group = models.CharField(max_length=50) class InspectionItem(models.Model): group = models.ForeignKey(InspectionGroup) item = models.CharField(max_length=50) class InspectionQuestion(models.Model): item = models.ForeignKey(InspectionItem) question = models.CharField(max_length=200) question_pass = models.BooleanField() class InspectionResult(models.Model): question = models.ForeignKey(InspectionQuestion) vehicle = models.ForeignKey(Vehicle) result = models.BooleanField() submitted_by = models.ForeignKey(User, editable=False) date_time_submitted = models.DateTimeField(default=datetime.today, editable=False)[/CODE] From the above structure, I'd like to have the user choose an inspection group, then from that group they'll be presented with all the questions under that group, with their item headers being used for grouping in the template. They'll then answer the questions and post the results. I was thinking of using inline formsets for this, …

Member Avatar
Member Avatar
+0 forum 1

I am new to Django. When I tried creating a template, I got the following error. Please help. [CODE]>>> from django.template import Template, Context >>> t = Template("The name is {{name}}") Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> t = Template("The name is {{name}}") File "C:\Python27\lib\site-packages\django\template\base.py", line 106, in __init__ if settings.TEMPLATE_DEBUG and origin is None: File "C:\Python27\lib\site-packages\django\utils\functional.py", line 276, in __getattr__ self._setup() File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 40, in _setup raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE) ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.[/CODE]

Member Avatar
Member Avatar
+0 forum 1

The End.