Giter VIP home page Giter VIP logo

django-multiupload-lts's People

Contributors

revel109 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

django-multiupload-lts's Issues

Not working no post request

So I was integrating this with my website but I am facing some problems, main problem is like no post request is getting through.

My views.py:

class PageDetailView(View): 
     def get(self, request,**kwargs):
	page = get_object_or_404(Page, pk=self.kwargs['pk'])
	photos_list = Photo.objects.all()
	stories = page.story_set.all()
	users = User.objects.filter(groups__name= page.name)

	context = {
			'page':page,
			'photos':photos_list,
	}

	return render(self.request, 'page/page_detail.html', context=context)


     def post(self, request):
	form = PhotoForm(request.POST, request.FILES)
	if form.is_valid():
		photo = form.save()
		data = {'is_valid': True, 'name': photo.file.name, 'url': photo.file.url}
	else:
		data = {'is_valid': False}
	return JsonResponse(data)``

urls.py :

path('<int:pk>/', PageDetailView.as_view(), name='page_detail'),

my template view:

<button type="button" class="btn btn-primary js-upload-photos">
  <span class="glyphicon glyphicon-cloud-upload"></span> Upload photos
</button>
<input id="fileupload" type="file" name="file" multiple
       style="display: none;"
       data-url="{% url 'page_detail' pk=page.pk %}"
       data-form-data='{"csrfmiddlewaretoken": "{{ csrf_token }}"}'>

I kind of think all the js and other things are getting imported. But when I click the Upload button, no post request is there and nothing happens. It just is a complete disaster. What can I do?
Would be really really helpful if you can provide any solutions.

Random observations

Following your email on django-users group, here is some random observations :

  • photos is not the right name for the app, but it is ok :)
  • templates are pretty nice
  • Procfile logs nothing
  • DEBUG mode is ON
  • secret_key is shared on the github repository.
  • why are u using sqlite3 on heroku, it is gonna be reinitialized daily
  • why not use Pipfile with pipenv tool, it is the recommended way lastly ... rather then a requirements.txt
  • requirements.txt fix django version to 2.0 why not try it on 2.2 ?

could u please answer each one of the observations/questions ? thank u in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.